File size: 3,915 Bytes
07bbbbf
 
 
 
 
 
 
 
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
<UserControl x:Class="mdict.Views.LibraryView"
             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" 
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid Background="#F0F2F5">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Border Background="White" Padding="20" BorderBrush="#E0E0E0" BorderThickness="0,0,0,1">
            <DockPanel>
                <TextBlock Text="Library" FontSize="24" FontWeight="Bold" VerticalAlignment="Center" Foreground="#333"/>
                <Button Content="Add Dictionary" Click="AddDictionary_Click" HorizontalAlignment="Right" Padding="15,8" Background="#007AFF" Foreground="White" BorderThickness="0">
                    <Button.Resources>
                        <Style TargetType="Border">
                            <Setter Property="CornerRadius" Value="6"/>
                        </Style>
                    </Button.Resources>
                </Button>
            </DockPanel>
        </Border>

        <ListView x:Name="DictionariesList" Grid.Row="1" Margin="20" BorderThickness="0" Background="Transparent">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <Border Background="White" Padding="15" Margin="0,0,0,10" CornerRadius="8">
                        <Border.Effect>
                            <DropShadowEffect Color="Black" Opacity="0.05" BlurRadius="10" ShadowDepth="2"/>
                        </Border.Effect>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Text="📖" FontSize="24" VerticalAlignment="Center" Margin="0,0,15,0"/>
                            <StackPanel Grid.Column="1" VerticalAlignment="Center">
                                <TextBlock Text="{Binding Name}" FontSize="16" FontWeight="SemiBold" Foreground="#333"/>
                                <TextBlock Text="{Binding FilePath}" FontSize="12" Foreground="#999" Margin="0,4,0,0"/>
                            </StackPanel>
                            <Button Grid.Column="2" Content="Remove" Click="RemoveDictionary_Click" Tag="{Binding}" Padding="10,5" Background="#FF3B30" Foreground="White" BorderThickness="0" VerticalAlignment="Center">
                                <Button.Resources>
                                    <Style TargetType="Border">
                                        <Setter Property="CornerRadius" Value="4"/>
                                    </Style>
                                </Button.Resources>
                            </Button>
                        </Grid>
                    </Border>
                </DataTemplate>
            </ListView.ItemTemplate>
            <ListView.ItemContainerStyle>
                <Style TargetType="ListViewItem">
                    <Setter Property="Background" Value="Transparent"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="ListViewItem">
                                <ContentPresenter/>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ListView.ItemContainerStyle>
        </ListView>
    </Grid>
</UserControl>