@@ -18,51 +18,52 @@ public GamePage()
18
18
. Background ( Theme . Brushes . Background . Default )
19
19
. Content (
20
20
new Grid ( )
21
- . Margin ( 20 )
22
- . RowDefinitions ( "*,auto,auto" )
23
- . Children (
24
- new Viewbox ( )
25
- . HorizontalAlignment ( HorizontalAlignment . Center )
26
- . Child (
27
- new ItemsRepeater ( )
28
- . ItemsSource ( ( ) => vm . Cells )
29
- . VerticalAlignment ( VerticalAlignment . Center )
30
- . Width ( 160 )
31
- . Height ( 160 )
32
- . Layout ( new UniformGridLayout ( )
33
- . Orientation ( Orientation . Vertical )
34
- . MaximumRowsOrColumns ( 16 ) )
35
- . ItemTemplate < Cell > ( cell => CellTemplate ( cell ) ) ) ,
36
- new TextBlock ( )
37
- . Text ( ( ) => vm . Score )
21
+ . Margin ( 20 )
22
+ . RowDefinitions ( "*,auto,auto" )
23
+ . Children (
24
+ new Viewbox ( )
38
25
. HorizontalAlignment ( HorizontalAlignment . Center )
39
- . Style ( Theme . TextBlock . Styles . HeadlineSmall )
40
- . Margin ( 10 )
41
- . Grid ( row : 1 ) ,
42
- new Slider ( )
43
- . MaxWidth ( 400 )
44
- . Margin ( 16 )
45
- . Maximum ( 1000 )
26
+ . Child (
27
+ new ItemsRepeater ( )
28
+ . ItemsSource ( ( ) => vm . Cells )
29
+ . VerticalAlignment ( VerticalAlignment . Center )
30
+ . Width ( 160 )
31
+ . Height ( 160 )
32
+ . Layout (
33
+ new UniformGridLayout ( )
34
+ . Orientation ( Orientation . Vertical )
35
+ . MaximumRowsOrColumns ( 16 ) )
36
+ . ItemTemplate < Cell > ( cell => CellTemplate ( cell ) ) ) ,
37
+ new TextBlock ( )
38
+ . Text ( ( ) => vm . Score )
39
+ . HorizontalAlignment ( HorizontalAlignment . Center )
40
+ . Style ( Theme . TextBlock . Styles . HeadlineSmall )
41
+ . Margin ( 10 )
42
+ . Grid ( row : 1 ) ,
43
+ new Slider ( )
44
+ . MaxWidth ( 400 )
45
+ . Margin ( 16 )
46
+ . Maximum ( 1000 )
46
47
#if __ANDROID__
47
- . Minimum ( 100 )
48
+ . Minimum ( 100 )
48
49
#else
49
- . Minimum ( 10 )
50
+ . Minimum ( 10 )
50
51
#endif
51
- . Grid ( row : 2 )
52
- . Value ( x => x . Binding ( ( ) => vm . Speed ) . TwoWay ( ) )
52
+ . Grid ( row : 2 )
53
+ . Value ( x => x . Binding ( ( ) => vm . Speed ) . TwoWay ( ) )
53
54
) ) ) ;
54
55
}
55
56
56
- private Grid CellTemplate ( Cell cell )
57
+ private Grid CellTemplate ( Cell cell )
57
58
=> new Grid ( )
58
59
. Children (
59
60
new Rectangle ( )
60
61
. Width ( 10 )
61
62
. Height ( 10 )
62
- . Fill ( ( ) => new SolidColorBrush ( CellColor ( cell ) ) ) ,
63
+ . Fill ( ( ) => cell , cell => new SolidColorBrush ( CellColor ( cell ) ) ) ,
63
64
new Ellipse ( )
64
65
. Width ( 10 )
65
66
. Height ( 10 )
66
- . Fill ( ( ) => new SolidColorBrush ( PlayerColor ( cell ) ) )
67
+ . Fill ( ( ) => cell , cell => new SolidColorBrush ( PlayerColor ( cell ) ) )
67
68
. Visibility ( ( ) => cell , cell => cell . HasBall ? Visibility . Visible : Visibility . Collapsed ) ) ;
68
69
}
0 commit comments