File tree Expand file tree Collapse file tree 1 file changed +15
-16
lines changed
UI/PongWars/src/UnoPongWars/Presentation Expand file tree Collapse file tree 1 file changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -32,23 +32,9 @@ public GamePage()
32
32
. Layout ( new UniformGridLayout ( )
33
33
. Orientation ( Orientation . Vertical )
34
34
. MaximumRowsOrColumns ( 16 ) )
35
- . ItemTemplate < Cell > ( cell =>
36
- new Grid ( )
37
- . Children (
38
- new Rectangle ( )
39
- . Width ( 10 )
40
- . Height ( 10 )
41
- . Fill ( x => x . Binding ( ( ) => cell )
42
- . Convert ( cell => new SolidColorBrush ( CellColor ( cell ) ) ) ) ,
43
- new Ellipse ( )
44
- . Width ( 10 )
45
- . Height ( 10 )
46
- . Fill ( x => x . Binding ( ( ) => cell )
47
- . Convert ( cell => new SolidColorBrush ( PlayerColor ( cell ) ) ) )
48
- . Visibility ( x => x . Binding ( ( ) => cell )
49
- . Convert ( cell => cell . HasBall ? Visibility . Visible : Visibility . Collapsed ) ) ) ) ) ,
35
+ . ItemTemplate < Cell > ( cell => CellTemplate ( cell ) ) ) ,
50
36
new TextBlock ( )
51
- . Text ( x => x . Binding ( ( ) => vm . Score ) )
37
+ . Text ( ( ) => vm . Score )
52
38
. HorizontalAlignment ( HorizontalAlignment . Center )
53
39
. Style ( Theme . TextBlock . Styles . HeadlineSmall )
54
40
. Margin ( 10 )
@@ -66,4 +52,17 @@ public GamePage()
66
52
. Value ( x => x . Binding ( ( ) => vm . Speed ) . TwoWay ( ) )
67
53
) ) ) ;
68
54
}
55
+
56
+ private Grid CellTemplate ( Cell cell )
57
+ => new Grid ( )
58
+ . Children (
59
+ new Rectangle ( )
60
+ . Width ( 10 )
61
+ . Height ( 10 )
62
+ . Fill ( ( ) => new SolidColorBrush ( CellColor ( cell ) ) ) ,
63
+ new Ellipse ( )
64
+ . Width ( 10 )
65
+ . Height ( 10 )
66
+ . Fill ( ( ) => new SolidColorBrush ( PlayerColor ( cell ) ) )
67
+ . Visibility ( ( ) => cell , cell => cell . HasBall ? Visibility . Visible : Visibility . Collapsed ) ) ;
69
68
}
You can’t perform that action at this time.
0 commit comments