File size: 3,240 Bytes
fab29d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<UserControl
    x:Class="SlobViewer.Gui.DictionaryControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="clr-namespace:SlobViewer.Gui"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    <UserControl.Resources>
        <local:FlowDocumentConverter x:Key="FlowDocumentConverter" />
    </UserControl.Resources>
    <Grid>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="4" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="4" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <!--  Background property of this BackgroundRectangle must be set with a global theme style either to white or black  -->
        <local:BackgroundRectangle
            Grid.Row="0"
            Grid.RowSpan="6"
            Grid.Column="0"
            Grid.ColumnSpan="3" />

        <TextBox
            x:Name="_guiSearchText"
            Grid.Row="0"
            Text="{Binding SearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
        <GridSplitter
            Grid.RowSpan="6"
            Grid.Column="1"
            Width="20"
            HorizontalAlignment="Center"
            VerticalAlignment="Stretch"
            ShowsPreview="True" />

        <ListBox
            x:Name="_guiSearchList"
            Grid.Row="2"
            MaxHeight="1024"
            ItemsSource="{Binding KeyList}"
            SelectedValue="{Binding SelectedKeyInKeyList, Mode=TwoWay}"
            SelectionChanged="EhSearchSelectionChanged"
            SelectionMode="Single"
            VirtualizingStackPanel.VirtualizationMode="Recycling" />

        <ListBox
            x:Name="_guiBestMatchesList"
            Grid.Row="3"
            MaxHeight="1024"
            ItemsSource="{Binding BestMatchesList}"
            SelectionChanged="EhBestMatchSelectionChanged"
            SelectionMode="Single"
            VirtualizingStackPanel.VirtualizationMode="Recycling" />


        <FlowDocumentScrollViewer
            x:Name="_guiFlowDocReader"
            Grid.Row="0"
            Grid.RowSpan="4"
            Grid.Column="2"
            MouseDoubleClick="EhDocumentMouseDoubleClick">
            <FlowDocumentScrollViewer.Document>
                <MultiBinding Converter="{StaticResource FlowDocumentConverter}">
                    <Binding Path="FlowDocument" />
                    <Binding Path="IsInDarkMode" />
                </MultiBinding>
            </FlowDocumentScrollViewer.Document>
        </FlowDocumentScrollViewer>

        <Button
            x:Name="_guiHideButton"
            Grid.Row="5"
            Grid.Column="0"
            Grid.ColumnSpan="2"
            Click="EhHide"
            Content="Hide"
            Visibility="Collapsed" />
    </Grid>
</UserControl>