File size: 4,998 Bytes
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 |
<Window x:Class="mdict.MainWindow"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:mdict"
xmlns:views="clr-namespace:mdict.Views"
mc:Ignorable="d"
Title="MDict" Height="600" Width="900"
WindowStartupLocation="CenterScreen">
<Window.Resources>
<Style x:Key="NavRadioButtonStyle" TargetType="RadioButton">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="#666"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Padding" Value="15,12"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Border x:Name="Border" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" CornerRadius="8" Margin="5,2">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="Icon" Text="{TemplateBinding Tag}" FontFamily="Segoe MDL2 Assets" FontSize="18" VerticalAlignment="Center" HorizontalAlignment="Center" Width="24"/>
<ContentPresenter Grid.Column="1" VerticalAlignment="Center" Margin="12,0,0,0"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Border" Property="Background" Value="#E8E8E8"/>
<Setter Property="Foreground" Value="#333"/>
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Border" Property="Background" Value="#E3F2FD"/>
<Setter Property="Foreground" Value="#1976D2"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid Background="White">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="220"/> <!-- Sidebar -->
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Sidebar -->
<Border Grid.Column="0" Background="#F8F9FA" BorderBrush="#EEE" BorderThickness="0,0,1,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <!-- Header -->
<RowDefinition Height="*"/> <!-- Nav Items -->
<RowDefinition Height="Auto"/> <!-- Bottom -->
</Grid.RowDefinitions>
<!-- Header -->
<StackPanel Grid.Row="0" Margin="20,30,20,30">
<TextBlock Text="MDict" FontSize="24" FontWeight="Bold" Foreground="#333"/>
<TextBlock Text="Dictionary" FontSize="12" Foreground="#888" Margin="2,0,0,0"/>
</StackPanel>
<!-- Navigation -->
<StackPanel Grid.Row="1" Margin="10,0">
<RadioButton Content="Search" Tag="" GroupName="Nav" IsChecked="True" Style="{StaticResource NavRadioButtonStyle}" Click="Nav_Click" CommandParameter="Search"/>
<RadioButton Content="Library" Tag="" GroupName="Nav" Style="{StaticResource NavRadioButtonStyle}" Click="Nav_Click" CommandParameter="Library"/>
<RadioButton Content="History" Tag="" GroupName="Nav" Style="{StaticResource NavRadioButtonStyle}" Click="Nav_Click" CommandParameter="History"/>
<RadioButton Content="Favorites" Tag="" GroupName="Nav" Style="{StaticResource NavRadioButtonStyle}" Click="Nav_Click" CommandParameter="Favorites"/>
<RadioButton Content="Settings" Tag="" GroupName="Nav" Style="{StaticResource NavRadioButtonStyle}" Click="Nav_Click" CommandParameter="Settings"/>
</StackPanel>
<!-- Footer/Version -->
<TextBlock Grid.Row="2" Text="v1.0.0" Foreground="#CCC" HorizontalAlignment="Center" Margin="20" FontSize="10"/>
</Grid>
</Border>
<!-- Main Content -->
<ContentControl x:Name="MainContent" Grid.Column="1" Margin="0"/>
</Grid>
</Window>
|