implement Rounds

This commit is contained in:
Natlinux81
2022-08-14 17:37:41 +02:00
parent 61f06a6b5d
commit a694685181
6 changed files with 76 additions and 9 deletions

View File

@@ -8,7 +8,7 @@ namespace Apollon.WPF.Models
{ {
public class Tournament public class Tournament
{ {
public Tournament(string organisation, string tournamentname, string category, string startdate, string enddate, string location) public Tournament(string organisation, string tournamentname, string category, string startdate, string enddate, string location, int rounds = 0)
{ {
Organisation = organisation; Organisation = organisation;
Tournamentname = tournamentname; Tournamentname = tournamentname;
@@ -16,8 +16,8 @@ namespace Apollon.WPF.Models
Startdate = startdate; Startdate = startdate;
Enddate = enddate; Enddate = enddate;
Location = location; Location = location;
Rounds = rounds;
} }
public string Organisation { get; } public string Organisation { get; }
public string Tournamentname { get; } public string Tournamentname { get; }
@@ -25,6 +25,7 @@ namespace Apollon.WPF.Models
public string Startdate { get; } public string Startdate { get; }
public string Enddate { get; } public string Enddate { get; }
public string Location { get; } public string Location { get; }
public int Rounds { get; }
} }
} }

View File

@@ -80,6 +80,20 @@ namespace Apollon.WPF.ViewModels
} }
} }
private int _rounds;
public int Rounds
{
get
{
return _rounds;
}
set
{
_rounds = value;
OnPropertyChanged(nameof(Rounds));
}
}
private string _location; private string _location;
public string Location public string Location
{ {

View File

@@ -21,6 +21,7 @@ namespace Apollon.WPF.ViewModels
public string Startdate => SelectedTournament?.Startdate ?? "kein Datum"; public string Startdate => SelectedTournament?.Startdate ?? "kein Datum";
public string Enddate => SelectedTournament?.Enddate ?? "kein Datum"; public string Enddate => SelectedTournament?.Enddate ?? "kein Datum";
public string Location => SelectedTournament?.Location ?? "kein Ort"; public string Location => SelectedTournament?.Location ?? "kein Ort";
public int Rounds => SelectedTournament?.Rounds ?? 0;
public OverviewDetailsViewModel(SelectedTournamentStore selectedTournamentStore) public OverviewDetailsViewModel(SelectedTournamentStore selectedTournamentStore)
{ {
@@ -44,6 +45,7 @@ namespace Apollon.WPF.ViewModels
OnPropertyChanged(nameof(Startdate)); OnPropertyChanged(nameof(Startdate));
OnPropertyChanged(nameof(Enddate)); OnPropertyChanged(nameof(Enddate));
OnPropertyChanged(nameof(Location)); OnPropertyChanged(nameof(Location));
OnPropertyChanged(nameof(Rounds));
} }
} }
} }

View File

@@ -39,9 +39,9 @@ namespace Apollon.WPF.ViewModels
_selectedTournamentStore = selectedTournamentStore; _selectedTournamentStore = selectedTournamentStore;
_apollonOverviewListingItemViewModels = new ObservableCollection<OverviewListingItemViewModel>(); _apollonOverviewListingItemViewModels = new ObservableCollection<OverviewListingItemViewModel>();
_apollonOverviewListingItemViewModels.Add(new OverviewListingItemViewModel(new Tournament("DSB", "Deutschemeisterschaft1", "Halle", "01.01.2021", "05.01.2021", "Wiesbaden"))); _apollonOverviewListingItemViewModels.Add(new OverviewListingItemViewModel(new Tournament("DSB", "Deutschemeisterschaft1", "Halle", "01.01.2021", "05.01.2021", "Wiesbaden",3)));
_apollonOverviewListingItemViewModels.Add(new OverviewListingItemViewModel(new Tournament("DSB", "Deutschemeisterschaft2", "im Freien", "01.01.2021", "05.01.2021", "Berlin"))); _apollonOverviewListingItemViewModels.Add(new OverviewListingItemViewModel(new Tournament("DSB", "Deutschemeisterschaft2", "im Freien", "01.01.2021", "05.01.2021", "Berlin",5)));
_apollonOverviewListingItemViewModels.Add(new OverviewListingItemViewModel(new Tournament("DSB", "Deutschemeisterschaft3", "Halle", "01.01.2021", "05.01.2021", "Bruchsal"))); _apollonOverviewListingItemViewModels.Add(new OverviewListingItemViewModel(new Tournament("DSB", "Deutschemeisterschaft3", "Halle", "01.01.2021", "05.01.2021", "Bruchsal", 6)));
} }
} }

View File

@@ -13,6 +13,7 @@
<RowDefinition Height="55"/> <RowDefinition Height="55"/>
<RowDefinition Height="55"/> <RowDefinition Height="55"/>
<RowDefinition Height="55"/> <RowDefinition Height="55"/>
<RowDefinition Height="55"/>
<RowDefinition Height="auto"/> <RowDefinition Height="auto"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@@ -37,8 +38,11 @@
<TextBlock Grid.Row="5" <TextBlock Grid.Row="5"
Text="Veranstaltungsort: " Text="Veranstaltungsort: "
Style="{StaticResource ModalTextBlock}"/> Style="{StaticResource ModalTextBlock}"/>
<TextBlock Grid.Row="6"
Text="Durchgänge: "
Style="{StaticResource ModalTextBlock}"/>
<TextBox Grid.Column="1" <TextBox Grid.Column="1"
Text="{Binding Organisation}" Text="{Binding Organisation}"
FontFamily="Arial" FontFamily="Arial"
FontSize="16" FontSize="16"
@@ -83,8 +87,18 @@
Height="30" Height="30"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
Background="LightGray"/> Background="LightGray"/>
<TextBox Grid.Row="6"
Grid.Column="1"
Text="{Binding Rounds}"
FontFamily="Arial"
FontSize="16"
Height="30"
Width="50"
VerticalContentAlignment="Center"
HorizontalAlignment="Left"
Background="LightGray"/>
<Grid Grid.Row="6" <Grid Grid.Row="7"
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
Margin="0 30 0 0" Margin="0 30 0 0"
Width="450" Width="450"

View File

@@ -180,6 +180,42 @@
</Style> </Style>
</TextBlock.Style> </TextBlock.Style>
</TextBlock> </TextBlock>
</StackPanel> <WrapPanel HorizontalAlignment="Center">
<TextBlock Text="Durchgänge:"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0"
Margin="10">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Visibility" Value="Hidden"/>
<Style.Triggers>
<DataTrigger Binding="{Binding HasSelectedTournament}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Text="{Binding Rounds}"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0"
Margin="10">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Visibility" Value="Hidden"/>
<Style.Triggers>
<DataTrigger Binding="{Binding HasSelectedTournament}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</WrapPanel>
</StackPanel>
</Grid> </Grid>
</UserControl> </UserControl>