Skip to content

Commit

Permalink
Úprava komponenty EndGameLabel
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Fischer committed Nov 8, 2023
1 parent f1e928c commit 6030392
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 71 deletions.
7 changes: 1 addition & 6 deletions SnakeGame/Components/EndGameLabel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,5 @@
<Label xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="SnakeGame.Components.EndGameLabel"
xmlns:vm="clr-namespace:SnakeGame.Components.ViewModels"
x:Name="EndGameLabelRef"
TextColor="{Binding CustomTextColor}">
<Label.BindingContext>
<vm:EndGameLabelViewModel />
</Label.BindingContext>
xmlns:vm="clr-namespace:SnakeGame.Components.ViewModels">
</Label>
26 changes: 26 additions & 0 deletions SnakeGame/Components/EndGameLabel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,30 @@ public EndGameLabel()
{
InitializeComponent();
}

private Color androidColor;
public Color AndroidColor
{
get => androidColor;
set
{
androidColor = value;
#if ANDROID
this.TextColor = value;
#endif
}
}

private Color windowsColor;
public Color WindowsColor
{
get => windowsColor;
set
{
windowsColor = value;
#if WINDOWS
this.TextColor = value;
#endif
}
}
}
65 changes: 0 additions & 65 deletions SnakeGame/Components/ViewModels/EndGameLabelViewModel.cs

This file was deleted.

4 changes: 4 additions & 0 deletions SnakeGame/ScorePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@
Text="Délka hada: "
VerticalOptions="Center"
HorizontalOptions="Center"
AndroidColor="Red"
WindowsColor="Aqua"
FontSize="Title"/>
<components:EndGameLabel
HorizontalOptions="Center"
FontSize="Title"
AndroidColor="Red"
WindowsColor="Aqua"
Text="{Binding Score, Source={x:Reference ScorePageRef}}" />
</StackLayout>
<Image
Expand Down

0 comments on commit 6030392

Please sign in to comment.