Skip to content

Commit 143d929

Browse files
chore: Adjust binding and indentation
1 parent 839df5d commit 143d929

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed

UI/PongWars/src/UnoPongWars/Presentation/GamePage.cs

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,51 +18,52 @@ public GamePage()
1818
.Background(Theme.Brushes.Background.Default)
1919
.Content(
2020
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()
3825
.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)
4647
#if __ANDROID__
47-
.Minimum(100)
48+
.Minimum(100)
4849
#else
49-
.Minimum(10)
50+
.Minimum(10)
5051
#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())
5354
)));
5455
}
5556

56-
private Grid CellTemplate(Cell cell)
57+
private Grid CellTemplate(Cell cell)
5758
=> new Grid()
5859
.Children(
5960
new Rectangle()
6061
.Width(10)
6162
.Height(10)
62-
.Fill(() => new SolidColorBrush(CellColor(cell))),
63+
.Fill(() => cell, cell => new SolidColorBrush(CellColor(cell))),
6364
new Ellipse()
6465
.Width(10)
6566
.Height(10)
66-
.Fill(() => new SolidColorBrush(PlayerColor(cell)))
67+
.Fill(() => cell, cell => new SolidColorBrush(PlayerColor(cell)))
6768
.Visibility(() => cell, cell => cell.HasBall ? Visibility.Visible : Visibility.Collapsed));
6869
}

0 commit comments

Comments
 (0)