File size: 4,647 Bytes
07bbbbf
 
 
 
 
6667126
07bbbbf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e3ea2f2
07bbbbf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e3ea2f2
07bbbbf
 
 
 
 
 
 
6667126
e3ea2f2
07bbbbf
 
 
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="mdict.Views.SearchView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:cef="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    
    <UserControl.Resources>
        <Style x:Key="SegmentButtonStyle" TargetType="RadioButton">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Foreground" Value="#007AFF"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="10,5"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="RadioButton">
                        <Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="True">
                                <Setter Property="Background" Value="#007AFF"/>
                                <Setter Property="Foreground" Value="White"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="300" MinWidth="200" MaxWidth="500"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <!-- Left Panel: Lookup -->
        <Grid Grid.Column="0" Background="#F5F5F5">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <!-- Search Bar -->
            <Border Grid.Row="0" Margin="10" Background="White" CornerRadius="5" BorderBrush="#DDD" BorderThickness="1">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="🔍" VerticalAlignment="Center" Margin="8,0,0,0" Foreground="Gray"/>
                    <TextBox x:Name="SearchInput" Grid.Column="1" BorderThickness="0" Background="Transparent" 
                             VerticalContentAlignment="Center" Padding="5" Height="30"
                             Tag="Search..." KeyDown="SearchInput_KeyDown"/>
                </Grid>
            </Border>

            <!-- Segment Control (Mock) -->
            <Border Grid.Row="1" Margin="10,0,10,10" BorderBrush="#007AFF" BorderThickness="1" CornerRadius="5" ClipToBounds="True">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <RadioButton Grid.Column="0" Content="Index" IsChecked="True" Style="{StaticResource SegmentButtonStyle}"/>
                    <RadioButton Grid.Column="1" Content="Full Text" Style="{StaticResource SegmentButtonStyle}"/>
                </Grid>
            </Border>

            <!-- Results List -->
            <ListBox x:Name="ResultList" Grid.Row="2" Background="Transparent" BorderThickness="0" SelectionChanged="ResultList_SelectionChanged" DisplayMemberPath="DisplayText" />
        </Grid>

        <!-- Splitter -->
        <GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="#E0E0E0"/>

        <!-- Right Panel: Content -->
        <Grid Grid.Column="2" Background="White">
            <cef:ChromiumWebBrowser x:Name="ContentBrowser" Visibility="Hidden"/>
            <TextBlock x:Name="PlaceholderText" Text="Select a word to view definition" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#999" FontSize="20"/>
        </Grid>
    </Grid>
</UserControl>