|
4 | 4 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
5 | 5 | xmlns:vm="clr-namespace:Vocup.ViewModels;assembly=Vocup.Avalonia" |
6 | 6 | xmlns:views="clr-namespace:Vocup.Views;assembly=Vocup.Avalonia" |
7 | | - mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" |
| 7 | + mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="600" |
8 | 8 | x:Class="Vocup.Views.BookView" |
9 | 9 | x:DataType="vm:BookViewModel"> |
10 | 10 |
|
|
19 | 19 | <views:PracticeModeToVisibilityConverter x:Key="PracticeModeToVisibilityConverter" /> |
20 | 20 | </UserControl.Resources> |
21 | 21 |
|
22 | | - <Grid RowDefinitions="Auto, *" ColumnDefinitions="Auto, *"> |
23 | | - <Button Grid.Row="0" Command="{Binding AddWord}">Add Word</Button> |
24 | | - <Button Grid.Row="0" Grid.Column="1" Command="{Binding AddSynonym}">Add Synonym</Button> |
25 | | - <ScrollViewer Grid.Row="1" Grid.ColumnSpan="2"> |
26 | | - <ItemsControl ItemsSource="{Binding Words}"> |
27 | | - <ItemsControl.ItemTemplate> |
28 | | - <DataTemplate> |
29 | | - <Grid> |
30 | | - <Grid.ColumnDefinitions> |
31 | | - <ColumnDefinition Width="*" /> |
32 | | - <ColumnDefinition Width="*" /> |
33 | | - </Grid.ColumnDefinitions> |
| 22 | + <ScrollViewer> |
| 23 | + <ItemsControl ItemsSource="{Binding Words}"> |
| 24 | + <ItemsControl.ItemTemplate> |
| 25 | + <DataTemplate> |
| 26 | + <Grid> |
| 27 | + <Grid.ColumnDefinitions> |
| 28 | + <ColumnDefinition Width="*" /> |
| 29 | + <ColumnDefinition Width="*" /> |
| 30 | + </Grid.ColumnDefinitions> |
34 | 31 |
|
35 | | - <ItemsControl ItemsSource="{Binding MotherTongue}" Grid.Column="0"> |
36 | | - <ItemsControl.ItemTemplate> |
37 | | - <DataTemplate> |
38 | | - <StackPanel Orientation="Horizontal"> |
39 | | - <Ellipse Width="8" Height="8" VerticalAlignment="Center" |
40 | | - Fill="{Binding PracticeState, Converter={StaticResource PracticeStateToBrushConverter}}" |
41 | | - IsVisible="{Binding Word.Book.PracticeMode, Converter={StaticResource PracticeModeToVisibilityConverter}, ConverterParameter=AskForMotherTongue}" /> |
42 | | - <TextBlock Text="{Binding Value}" TextWrapping="Wrap" Margin="4" /> |
43 | | - </StackPanel> |
44 | | - </DataTemplate> |
45 | | - </ItemsControl.ItemTemplate> |
46 | | - </ItemsControl> |
47 | | - <ItemsControl ItemsSource="{Binding ForeignLanguage}" Grid.Column="1"> |
48 | | - <ItemsControl.ItemTemplate> |
49 | | - <DataTemplate> |
50 | | - <StackPanel Orientation="Horizontal"> |
51 | | - <Ellipse Width="8" Height="8" VerticalAlignment="Center" |
52 | | - Fill="{Binding PracticeState, Converter={StaticResource PracticeStateToBrushConverter}}" |
53 | | - IsVisible="{Binding Word.Book.PracticeMode, Converter={StaticResource PracticeModeToVisibilityConverter}, ConverterParameter=AskForForeignLang}" /> |
54 | | - <TextBlock Text="{Binding Value}" TextWrapping="Wrap" Margin="4" /> |
55 | | - </StackPanel> |
56 | | - </DataTemplate> |
57 | | - </ItemsControl.ItemTemplate> |
58 | | - </ItemsControl> |
59 | | - </Grid> |
60 | | - </DataTemplate> |
61 | | - </ItemsControl.ItemTemplate> |
62 | | - </ItemsControl> |
63 | | - </ScrollViewer> |
64 | | - </Grid> |
| 32 | + <ItemsControl ItemsSource="{Binding MotherTongue}" Grid.Column="0"> |
| 33 | + <ItemsControl.ItemTemplate> |
| 34 | + <DataTemplate> |
| 35 | + <DockPanel> |
| 36 | + <Ellipse Width="8" Height="8" VerticalAlignment="Center" DockPanel.Dock="Left" |
| 37 | + Fill="{Binding PracticeState, Converter={StaticResource PracticeStateToBrushConverter}}" |
| 38 | + IsVisible="{Binding Word.Book.PracticeMode, Converter={StaticResource PracticeModeToVisibilityConverter}, ConverterParameter=AskForMotherTongue}" /> |
| 39 | + <TextBlock Text="{Binding Value}" TextWrapping="Wrap" Margin="4" /> |
| 40 | + </DockPanel> |
| 41 | + </DataTemplate> |
| 42 | + </ItemsControl.ItemTemplate> |
| 43 | + </ItemsControl> |
| 44 | + <ItemsControl ItemsSource="{Binding ForeignLanguage}" Grid.Column="1"> |
| 45 | + <ItemsControl.ItemTemplate> |
| 46 | + <DataTemplate> |
| 47 | + <DockPanel> |
| 48 | + <Ellipse Width="8" Height="8" VerticalAlignment="Center" DockPanel.Dock="Left" |
| 49 | + Fill="{Binding PracticeState, Converter={StaticResource PracticeStateToBrushConverter}}" |
| 50 | + IsVisible="{Binding Word.Book.PracticeMode, Converter={StaticResource PracticeModeToVisibilityConverter}, ConverterParameter=AskForForeignLang}" /> |
| 51 | + <TextBlock Text="{Binding Value}" TextWrapping="Wrap" Margin="4" /> |
| 52 | + </DockPanel> |
| 53 | + </DataTemplate> |
| 54 | + </ItemsControl.ItemTemplate> |
| 55 | + </ItemsControl> |
| 56 | + </Grid> |
| 57 | + </DataTemplate> |
| 58 | + </ItemsControl.ItemTemplate> |
| 59 | + </ItemsControl> |
| 60 | + </ScrollViewer> |
65 | 61 |
|
66 | 62 | </UserControl> |
0 commit comments