|
14 | 14 | <UserControl.Resources> |
15 | 15 | <converter:GameStatusToBooleanConverter x:Key="GameStatusToBooleanConverter" /> |
16 | 16 | </UserControl.Resources> |
| 17 | + <UserControl.Styles> |
| 18 | + <Style Selector=".start"> |
| 19 | + <Style Selector="^ Grid#StartGameArea"> |
| 20 | + <Setter Property="IsVisible" Value="True" /> |
| 21 | + </Style> |
| 22 | + <Style Selector="^ components|PegSelectionView#PegSelectionArea"> |
| 23 | + <Setter Property="IsVisible" Value="False" /> |
| 24 | + </Style> |
| 25 | + <Style Selector="^ ScrollViewer#PegScrollViewer"> |
| 26 | + <Setter Property="IsVisible" Value="False" /> |
| 27 | + </Style> |
| 28 | + </Style> |
| 29 | + <Style Selector=".playing"> |
| 30 | + <Style Selector="^ Grid#StartGameArea"> |
| 31 | + <Setter Property="IsVisible" Value="False" /> |
| 32 | + </Style> |
| 33 | + <Style Selector="^ components|PegSelectionView#PegSelectionArea"> |
| 34 | + <Setter Property="IsVisible" Value="True" /> |
| 35 | + </Style> |
| 36 | + <Style Selector="^ ScrollViewer#PegScrollViewer"> |
| 37 | + <Setter Property="IsVisible" Value="True" /> |
| 38 | + </Style> |
| 39 | + </Style> |
| 40 | + <Style Selector=".finished"> |
| 41 | + <Style Selector="^ Grid#StartGameArea"> |
| 42 | + <Setter Property="IsVisible" Value="False" /> |
| 43 | + </Style> |
| 44 | + <Style Selector="^ components|PegSelectionView#PegSelectionArea"> |
| 45 | + <Setter Property="IsVisible" Value="False" /> |
| 46 | + </Style> |
| 47 | + <Style Selector="^ ScrollViewer#PegScrollViewer"> |
| 48 | + <Setter Property="IsVisible" Value="True" /> |
| 49 | + </Style> |
| 50 | + </Style> |
| 51 | + </UserControl.Styles> |
17 | 52 | <Grid RowDefinitions="Auto,*,Auto"> |
18 | 53 | <components:GameResultDisplay Grid.Row="0" /> |
19 | | - <Grid Grid.Row="0" |
| 54 | + <Grid x:Name="StartGameArea" |
| 55 | + Grid.Row="0" |
20 | 56 | ColumnDefinitions="3*,1*" |
21 | 57 | RowDefinitions="Auto,Auto" |
22 | | - Margin="8" |
23 | | - IsVisible="{Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusToBooleanConverter}, ConverterParameter=Start}"> |
| 58 | + Margin="8"> |
24 | 59 | <StackPanel |
25 | 60 | Grid.Column="0" Grid.Row="0" |
26 | 61 | Grid.RowSpan="{OnFormFactor 2, Mobile=1}" Grid.ColumnSpan="{OnFormFactor 1, Mobile=2}" |
|
43 | 78 | </Button> |
44 | 79 | </Grid> |
45 | 80 | <components:PegSelectionView |
| 81 | + x:Name="PegSelectionArea" |
46 | 82 | Grid.Row="0" |
47 | | - IsVisible="{Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusToBooleanConverter}, ConverterParameter=Cancelable}" |
48 | 83 | Margin="{OnFormFactor '55,0,0,15', Mobile='0,0,0,15'}" /> |
49 | 84 | <ScrollViewer |
50 | | - x:Name="pegScrollViewer" |
| 85 | + x:Name="PegScrollViewer" |
51 | 86 | Padding="0,0,0,15" |
52 | | - Grid.Row="1" |
53 | | - IsVisible="{Binding GameStatus, Mode=OneWay, ConverterParameter=Running}"> |
| 87 | + Grid.Row="1"> |
54 | 88 | <ItemsControl |
55 | 89 | ItemsSource="{Binding GameMoves, Mode=OneWay}" |
56 | 90 | ItemTemplate="{StaticResource PegsTemplate}"> |
|
0 commit comments