|
14 | 14 | <ContentPage.Resources> |
15 | 15 | <conv:GameStatusToIsVisibleConverter x:Key="GameStatusVisibleConverter" /> |
16 | 16 | </ContentPage.Resources> |
17 | | - <Grid RowDefinitions="auto, *, auto"> |
18 | | - <components:GameResultDisplay |
19 | | - Grid.Row="0" /> |
20 | | - <ScrollView Grid.Row="1"> |
21 | | - <VerticalStackLayout |
22 | | - Spacing="25" |
23 | | - Padding="30,0" |
24 | | - VerticalOptions="FillAndExpand"> |
25 | | - <ActivityIndicator |
26 | | - IsRunning="{Binding InProgress, Mode=OneWay}" |
27 | | - HorizontalOptions="Center" |
| 17 | + <Grid RowDefinitions="auto, auto, *" Padding="15"> |
| 18 | + <components:GameResultDisplay Grid.Row="0" /> |
| 19 | + |
| 20 | + <FlexLayout |
| 21 | + Grid.Row="1" |
| 22 | + MaximumWidthRequest="1500" |
| 23 | + Wrap="Wrap" |
| 24 | + JustifyContent="Start" |
| 25 | + AlignItems="End" |
| 26 | + IsVisible="{Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibleConverter}, ConverterParameter=Start}"> |
| 27 | + <VerticalStackLayout |
| 28 | + FlexLayout.Basis="500" |
| 29 | + FlexLayout.Grow="2"> |
| 30 | + <Label |
| 31 | + VerticalTextAlignment="Center" |
| 32 | + Text="Enter your Gamername" |
| 33 | + FontSize="Header" /> |
| 34 | + <Entry |
| 35 | + IsEnabled="{Binding IsNameEnterable, Mode=OneWay}" |
| 36 | + Text="{Binding Name, Mode=TwoWay }" |
| 37 | + Placeholder="Enter your name"/> |
| 38 | + </VerticalStackLayout> |
| 39 | + <Grid |
| 40 | + FlexLayout.Basis="300" |
| 41 | + FlexLayout.Grow="1" |
| 42 | + Margin="0,5,0,0" |
| 43 | + ColumnDefinitions="*, auto" |
| 44 | + MinimumWidthRequest="250" |
| 45 | + IsVisible="{Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibleConverter}, ConverterParameter=Start}"> |
| 46 | + <Button |
| 47 | + Grid.Column="0" |
| 48 | + Text="Start the game" |
| 49 | + MinimumWidthRequest="150" |
| 50 | + Command="{Binding StartGameCommand, Mode=OneTime}" /> |
| 51 | + <ActivityIndicator |
| 52 | + Grid.Column="1" |
| 53 | + Margin="15,0,0,0" |
| 54 | + IsVisible="{Binding InProgress, Mode=OneWay}" |
| 55 | + IsRunning="True" |
28 | 56 | VerticalOptions="Center" /> |
| 57 | + </Grid> |
| 58 | + </FlexLayout> |
29 | 59 |
|
30 | | - <Grid |
31 | | - RowDefinitions="Auto, Auto" |
32 | | - ColumnDefinitions="*, Auto" |
33 | | - ColumnSpacing="8" |
34 | | - RowSpacing="8" |
35 | | - IsVisible="{Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibleConverter}, ConverterParameter=Start}"> |
36 | | - <Label |
37 | | - Grid.Column="0" |
38 | | - Grid.Row="0" |
39 | | - VerticalTextAlignment="Center" |
40 | | - Text="Enter your Gamername:" |
41 | | - FontSize="18" /> |
42 | | - <Entry |
43 | | - Grid.Column="0" |
44 | | - Grid.Row="1" |
45 | | - IsEnabled="{Binding IsNameEnterable, Mode=OneWay}" |
46 | | - Text="{Binding Name, Mode=TwoWay }" |
47 | | - Placeholder="Enter your name"/> |
48 | | - <Button |
49 | | - Grid.Column="1" |
50 | | - Grid.Row="1" |
51 | | - Padding="40,8" |
52 | | - HorizontalOptions="Fill" |
53 | | - VerticalOptions="EndAndExpand" |
54 | | - Text="Start the game" |
55 | | - IsVisible="{OnIdiom |
56 | | - Default={Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibleConverter}, ConverterParameter=Start}, |
57 | | - Phone=False, |
58 | | - Watch=False |
59 | | - }" |
60 | | - Command="{Binding StartGameCommand, Mode=OneTime}" /> |
61 | | - </Grid> |
62 | | - |
63 | | - <components:PegSelectionView IsVisible="{Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibleConverter}, ConverterParameter=Cancelable}" /> |
64 | | - |
65 | | - <ListView |
66 | | - IsVisible="{Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibleConverter}, ConverterParameter=Running}" |
67 | | - ItemsSource="{Binding GameMoves, Mode=OneWay}" |
68 | | - ItemTemplate="{StaticResource PegsTemplate}"/> |
69 | | - |
70 | | - </VerticalStackLayout> |
| 60 | + <FlexLayout |
| 61 | + Grid.Row="1" |
| 62 | + MaximumWidthRequest="700" |
| 63 | + IsVisible="{Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibleConverter}, ConverterParameter=Cancelable}" |
| 64 | + Wrap="Wrap" |
| 65 | + JustifyContent="Center" |
| 66 | + AlignItems="Center"> |
| 67 | + <components:PegSelectionView /> |
| 68 | + <Grid |
| 69 | + FlexLayout.Basis="200" |
| 70 | + FlexLayout.Grow="1" |
| 71 | + ColumnDefinitions="*, auto" |
| 72 | + Padding="0,10" |
| 73 | + MinimumWidthRequest="250"> |
| 74 | + <Button |
| 75 | + Grid.Column="0" |
| 76 | + Text="Move" |
| 77 | + MinimumWidthRequest="150" |
| 78 | + IsVisible="{Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibleConverter}, ConverterParameter=Cancelable}" |
| 79 | + Command="{Binding SetMoveCommand, Mode=OneTime}" /> |
| 80 | + <ActivityIndicator |
| 81 | + Grid.Column="1" |
| 82 | + Margin="15,0,0,0" |
| 83 | + IsVisible="{Binding InProgress, Mode=OneWay}" |
| 84 | + IsRunning="True" |
| 85 | + VerticalOptions="Center" /> |
| 86 | + </Grid> |
| 87 | + </FlexLayout> |
71 | 88 |
|
| 89 | + <ScrollView Grid.Row="2" Padding="0,0,0,15" x:Name="pegScrollView" HorizontalOptions="CenterAndExpand"> |
| 90 | + <ListView |
| 91 | + x:Name="test" |
| 92 | + HorizontalOptions="FillAndExpand" |
| 93 | + SelectionMode="None" |
| 94 | + IsVisible="{Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibleConverter}, ConverterParameter=Running}" |
| 95 | + ItemsSource="{Binding GameMoves, Mode=OneWay}" |
| 96 | + ItemTemplate="{StaticResource PegsTemplate}"/> |
72 | 97 | </ScrollView> |
73 | | - <VerticalStackLayout Grid.Row="2"> |
74 | | - <Button |
75 | | - Padding="8" |
76 | | - HorizontalOptions="Fill" |
77 | | - VerticalOptions="EndAndExpand" |
78 | | - Text="Start the game" |
79 | | - IsVisible="{OnIdiom |
80 | | - Default=False, |
81 | | - Phone={Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibleConverter}, ConverterParameter=Start} |
82 | | - }" |
83 | | - Command="{Binding StartGameCommand, Mode=OneTime}" /> |
84 | | - <Button |
85 | | - Margin="20" |
86 | | - HorizontalOptions="Fill" |
87 | | - VerticalOptions="End" |
88 | | - Text="Move" |
89 | | - IsVisible="{Binding GameStatus, Mode=OneWay, Converter={StaticResource GameStatusVisibleConverter}, ConverterParameter=Cancelable}" |
90 | | - Command="{Binding SetMoveCommand, Mode=OneTime}" /> |
91 | | - <Button Clicked="Button_Clicked" Text="To TestPage" /> |
92 | | - </VerticalStackLayout> |
93 | 98 | </Grid> |
94 | 99 | </ContentPage> |
0 commit comments