|
14 | 14 | <ContentPage.Resources> |
15 | 15 | <conv:GameStatusToIsVisibleConverter x:Key="GameStatusVisibleConverter" /> |
16 | 16 | </ContentPage.Resources> |
17 | | - <Grid RowDefinitions="auto, auto, *" Padding="15"> |
| 17 | + |
| 18 | + <Grid RowDefinitions="auto, auto, *" Padding="15" x:Name="ContentWrapper"> |
| 19 | + <VisualStateManager.VisualStateGroups> |
| 20 | + <VisualStateGroup> |
| 21 | + <VisualState x:Name="Start"> |
| 22 | + <VisualState.Setters> |
| 23 | + <Setter TargetName="StartGameArea" Property="IsVisible" Value="True" /> |
| 24 | + <Setter TargetName="PegSelectionArea" Property="IsVisible" Value="False" /> |
| 25 | + <Setter TargetName="PegScrollView" Property="IsVisible" Value="False" /> |
| 26 | + </VisualState.Setters> |
| 27 | + </VisualState> |
| 28 | + <VisualState x:Name="Playing"> |
| 29 | + <VisualState.Setters> |
| 30 | + <Setter TargetName="StartGameArea" Property="IsVisible" Value="False" /> |
| 31 | + <Setter TargetName="PegSelectionArea" Property="IsVisible" Value="True" /> |
| 32 | + <Setter TargetName="PegScrollView" Property="IsVisible" Value="True" /> |
| 33 | + </VisualState.Setters> |
| 34 | + </VisualState> |
| 35 | + <VisualState x:Name="Finished"> |
| 36 | + <VisualState.Setters> |
| 37 | + <Setter TargetName="StartGameArea" Property="IsVisible" Value="False" /> |
| 38 | + <Setter TargetName="PegSelectionArea" Property="IsVisible" Value="False" /> |
| 39 | + <Setter TargetName="PegScrollView" Property="IsVisible" Value="True" /> |
| 40 | + </VisualState.Setters> |
| 41 | + </VisualState> |
| 42 | + </VisualStateGroup> |
| 43 | + </VisualStateManager.VisualStateGroups> |
| 44 | + |
18 | 45 | <components:GameResultDisplay Grid.Row="0" /> |
19 | 46 |
|
20 | 47 | <FlexLayout |
| 48 | + x:Name="StartGameArea" |
21 | 49 | Grid.Row="1" |
22 | 50 | MaximumWidthRequest="1500" |
23 | 51 | Wrap="Wrap" |
24 | 52 | JustifyContent="Start" |
25 | | - AlignItems="End" |
26 | | - IsVisible="{Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibleConverter}, ConverterParameter=Start}"> |
| 53 | + AlignItems="End"> |
27 | 54 | <VerticalStackLayout |
28 | 55 | FlexLayout.Basis="500" |
29 | 56 | Padding="5,0" |
|
41 | 68 | Margin="0,5,0,0" |
42 | 69 | Padding="5,0" |
43 | 70 | ColumnDefinitions="*, auto" |
44 | | - MinimumWidthRequest="250" |
45 | | - IsVisible="{Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibleConverter}, ConverterParameter=Start}"> |
| 71 | + MinimumWidthRequest="250"> |
46 | 72 | <Button |
47 | 73 | Grid.Column="0" |
48 | 74 | Text="Start the game" |
|
58 | 84 | </FlexLayout> |
59 | 85 |
|
60 | 86 | <components:PegSelectionView |
| 87 | + x:Name="PegSelectionArea" |
61 | 88 | Grid.Row="1" |
62 | | - MaximumWidthRequest="700" |
63 | | - IsVisible="{Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibleConverter}, ConverterParameter=Cancelable}"/> |
| 89 | + MaximumWidthRequest="700" /> |
64 | 90 |
|
65 | | - <ScrollView Grid.Row="2" Padding="0,15,0,15" x:Name="pegScrollView" HorizontalOptions="CenterAndExpand"> |
| 91 | + <ScrollView Grid.Row="2" Padding="0,15,0,15" x:Name="PegScrollView" HorizontalOptions="CenterAndExpand"> |
66 | 92 | <ListView |
67 | 93 | x:Name="test" |
68 | 94 | HorizontalOptions="FillAndExpand" |
69 | 95 | SelectionMode="None" |
70 | | - IsVisible="{Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibleConverter}, ConverterParameter=Running}" |
71 | 96 | ItemsSource="{Binding GameMoves, Mode=OneWay}" |
72 | 97 | ItemTemplate="{StaticResource PegsTemplate}"/> |
73 | 98 | </ScrollView> |
|
0 commit comments