|
|
<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> |
|
|
|
|
|
|
|
|
<Grid Grid.Column="0" Background="#F5F5F5"> |
|
|
<Grid.RowDefinitions> |
|
|
<RowDefinition Height="Auto"/> |
|
|
<RowDefinition Height="Auto"/> |
|
|
<RowDefinition Height="*"/> |
|
|
</Grid.RowDefinitions> |
|
|
|
|
|
|
|
|
<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> |
|
|
|
|
|
|
|
|
<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> |
|
|
|
|
|
|
|
|
<ListBox x:Name="ResultList" Grid.Row="2" Background="Transparent" BorderThickness="0" SelectionChanged="ResultList_SelectionChanged" DisplayMemberPath="DisplayText" /> |
|
|
</Grid> |
|
|
|
|
|
|
|
|
<GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Center" VerticalAlignment="Stretch" Background="#E0E0E0"/> |
|
|
|
|
|
|
|
|
<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> |
|
|
|