|
15 | 15 | <conv:ColorNameToBrushConverter x:Key="ColorConverter" /> |
16 | 16 | </Page.Resources> |
17 | 17 |
|
18 | | - <StackPanel Orientation="Vertical"> |
19 | | - <Button Click="Button_Click" Content="To TestPage" /> |
20 | | - |
21 | | - <Grid> |
| 18 | + <Grid> |
22 | 19 | <Grid.RowDefinitions> |
23 | 20 | <RowDefinition Height="Auto" /> |
24 | 21 | <RowDefinition Height="Auto" /> |
|
28 | 25 |
|
29 | 26 | <!--<StackPanel Orientation="Vertical" Grid.Row="0"> |
30 | 27 | --><!-- TODO: Create component for this, to make it (more) generic. --><!-- |
31 | | - <Grid Visibility="{Binding Path=ViewModel.InfoMessage.IsVisible, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}"> |
32 | | - <Grid.ColumnDefinitions> |
33 | | - <ColumnDefinition Width="Auto" /> |
34 | | - <ColumnDefinition Width="*" /> |
35 | | - <ColumnDefinition Width="Auto" /> |
36 | | - </Grid.ColumnDefinitions> |
| 28 | + <Grid Visibility="{Binding Path=ViewModel.InfoMessage.IsVisible, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}"> |
| 29 | + <Grid.ColumnDefinitions> |
| 30 | + <ColumnDefinition Width="Auto" /> |
| 31 | + <ColumnDefinition Width="*" /> |
| 32 | + <ColumnDefinition Width="Auto" /> |
| 33 | + </Grid.ColumnDefinitions> |
37 | 34 |
|
38 | | - <TextBlock Text="Information: " VerticalAlignment="Center" Margin="8,0" /> |
39 | | - <TextBlock Grid.Column="1" Text="{Binding ViewModel.InfoMessage.Message, Mode=OneWay}" VerticalAlignment="Center" Margin="8,0" /> |
40 | | - <Button |
41 | | - Grid.Column="2" |
42 | | - Content="{Binding ViewModel.InfoMessage.ActionTitle, Mode=OneWay}" Padding="30,8" |
43 | | - Command="{Binding ViewModel.InfoMessage.ActionCommand, Mode=OneWay}" /> |
44 | | - </Grid> |
45 | | - <Grid Visibility="{Binding Path=ViewModel.ErrorMessage.IsVisible, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}"> |
46 | | - <Grid.ColumnDefinitions> |
47 | | - <ColumnDefinition Width="Auto" /> |
48 | | - <ColumnDefinition Width="*" /> |
49 | | - <ColumnDefinition Width="Auto" /> |
50 | | - </Grid.ColumnDefinitions> |
| 35 | + <TextBlock Text="Information: " VerticalAlignment="Center" Margin="8,0" /> |
| 36 | + <TextBlock Grid.Column="1" Text="{Binding ViewModel.InfoMessage.Message, Mode=OneWay}" VerticalAlignment="Center" Margin="8,0" /> |
| 37 | + <Button |
| 38 | + Grid.Column="2" |
| 39 | + Content="{Binding ViewModel.InfoMessage.ActionTitle, Mode=OneWay}" Padding="30,8" |
| 40 | + Command="{Binding ViewModel.InfoMessage.ActionCommand, Mode=OneWay}" /> |
| 41 | + </Grid> |
| 42 | + <Grid Visibility="{Binding Path=ViewModel.ErrorMessage.IsVisible, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}"> |
| 43 | + <Grid.ColumnDefinitions> |
| 44 | + <ColumnDefinition Width="Auto" /> |
| 45 | + <ColumnDefinition Width="*" /> |
| 46 | + <ColumnDefinition Width="Auto" /> |
| 47 | + </Grid.ColumnDefinitions> |
51 | 48 |
|
52 | | - <TextBlock Text="Error: " VerticalAlignment="Center" Margin="8,0" /> |
53 | | - <TextBlock Grid.Column="1" Text="{Binding ViewModel.ErrorMessage.Message, Mode=OneWay}" VerticalAlignment="Center" Margin="8,0" /> |
54 | | - <Button |
55 | | - Grid.Column="2" |
56 | | - Content="{Binding ViewModel.ErrorMessage.ActionTitle, Mode=OneWay}" Padding="30,8" |
57 | | - Command="{Binding ViewModel.ErrorMessage.ActionCommand, Mode=OneWay}" /> |
58 | | - </Grid> |
59 | | - </StackPanel>--> |
| 49 | + <TextBlock Text="Error: " VerticalAlignment="Center" Margin="8,0" /> |
| 50 | + <TextBlock Grid.Column="1" Text="{Binding ViewModel.ErrorMessage.Message, Mode=OneWay}" VerticalAlignment="Center" Margin="8,0" /> |
| 51 | + <Button |
| 52 | + Grid.Column="2" |
| 53 | + Content="{Binding ViewModel.ErrorMessage.ActionTitle, Mode=OneWay}" Padding="30,8" |
| 54 | + Command="{Binding ViewModel.ErrorMessage.ActionCommand, Mode=OneWay}" /> |
| 55 | + </Grid> |
| 56 | + </StackPanel>--> |
60 | 57 | <components:GameResultDisplay |
61 | 58 | Panel.ZIndex="1" |
62 | 59 | Grid.Row="0"/> |
|
94 | 91 | Margin="86,0,0,8" |
95 | 92 | ViewModel="{Binding ViewModel, ElementName=Self, Mode=OneWay}" /> |
96 | 93 |
|
97 | | - <ListView |
98 | | - Height="Auto" |
99 | | - Visibility="{Binding ViewModel.GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibilityConverter}, ConverterParameter=Running}" |
100 | | - Grid.Row="2" |
101 | | - Background="LightGray" |
102 | | - ItemsSource="{Binding ViewModel.GameMoves, Mode=OneWay}" |
103 | | - ItemTemplate="{StaticResource PegsTemplate}" /> |
| 94 | + <ScrollViewer Grid.Row="2" Padding="0,0,0,15" x:Name="pegScrollViewer"> |
| 95 | + <ListView |
| 96 | + BorderThickness="0" |
| 97 | + SelectedIndex="-1" |
| 98 | + IsHitTestVisible="False" |
| 99 | + HorizontalContentAlignment="Stretch" |
| 100 | + Visibility="{Binding ViewModel.GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibilityConverter}, ConverterParameter=Running}" |
| 101 | + ItemsSource="{Binding ViewModel.GameMoves, Mode=OneWay}" |
| 102 | + ItemTemplate="{StaticResource PegsTemplate}" /> |
| 103 | + </ScrollViewer> |
104 | 104 |
|
105 | | - <TextBlock Grid.Row="3" Text="{Binding ViewModel.GameStatus,Mode=OneWay}" /> |
| 105 | + <Grid Grid.Row="3"> |
| 106 | + <Grid.ColumnDefinitions> |
| 107 | + <ColumnDefinition Width="Auto" /> |
| 108 | + <ColumnDefinition Width="*" /> |
| 109 | + <ColumnDefinition Width="Auto" /> |
| 110 | + </Grid.ColumnDefinitions> |
| 111 | + <TextBlock Grid.Column="0" Text="{Binding ViewModel.GameStatus,Mode=OneWay}" /> |
106 | 112 | <ProgressBar |
107 | | - Grid.Row="3" |
108 | | - Height="15" |
109 | | - Minimum="0" Maximum="100" IsIndeterminate="True" |
110 | | - Visibility="{Binding ViewModel.InProgress, Converter={StaticResource BooleanToVisibilityConverter}}" /> |
| 113 | + Grid.Column="1" |
| 114 | + Height="15" |
| 115 | + Minimum="0" Maximum="100" IsIndeterminate="True" |
| 116 | + Visibility="{Binding ViewModel.InProgress, Converter={StaticResource BooleanToVisibilityConverter}}" /> |
| 117 | + <Button Grid.Column="2" Click="Button_Click" Content="To TestPage" Padding="15,2" /> |
111 | 118 | </Grid> |
112 | | - </StackPanel> |
| 119 | + </Grid> |
113 | 120 | </Page> |
0 commit comments