StartView finished

This commit is contained in:
Natlinux81
2022-08-12 15:46:04 +02:00
parent e98978a02a
commit bb3394b03f
3 changed files with 143 additions and 31 deletions

View File

@@ -12,15 +12,15 @@ namespace Apollon.WPF.ViewModels
{
private readonly SelectedTournamentStore _selectedTournamentStore;
private Tournament _selectedTournament => _selectedTournamentStore.SelectedTournament;
private Tournament SelectedTournament => _selectedTournamentStore.SelectedTournament;
public bool hasSelectedTournament => _selectedTournament != null;
public string Organisation => _selectedTournament?.Organisation ?? "keine Organisation";
public string Tournamentname => _selectedTournament?.Tournamentname ?? "kein Name";
public string Category => _selectedTournament?.Category ?? "keine Kategorie";
public string Startdate => _selectedTournament?.Startdate ?? "kein Datum";
public string Enddate => _selectedTournament?.Enddate ?? "kein Datum";
public string Location => _selectedTournament?.Location ?? "kein Ort";
public bool HasSelectedTournament => SelectedTournament != null;
public string Organisation => SelectedTournament?.Organisation ?? "keine Organisation";
public string Tournamentname => SelectedTournament?.Tournamentname ?? "kein Name";
public string Category => SelectedTournament?.Category ?? "keine Kategorie";
public string Startdate => SelectedTournament?.Startdate ?? "kein Datum";
public string Enddate => SelectedTournament?.Enddate ?? "kein Datum";
public string Location => SelectedTournament?.Location ?? "kein Ort";
public ApollonOverviewDetailsViewModel(SelectedTournamentStore selectedTournamentStore)
{
@@ -37,7 +37,7 @@ namespace Apollon.WPF.ViewModels
private void SelectedTournamentStore_SelectedTournamentChanged()
{
OnPropertyChanged(nameof(hasSelectedTournament));
OnPropertyChanged(nameof(HasSelectedTournament));
OnPropertyChanged(nameof(Organisation));
OnPropertyChanged(nameof(Tournamentname));
OnPropertyChanged(nameof(Category));

View File

@@ -17,7 +17,7 @@
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Border CornerRadius="20" Grid.RowSpan="2" Grid.ColumnSpan="3">
<Border CornerRadius="10" Grid.RowSpan="2" Grid.ColumnSpan="3">
<Border.Background>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color="#d7e8fd" Offset="0.2"/>

View File

@@ -11,63 +11,175 @@
BorderThickness="1"
CornerRadius="10">
</Border>
<StackPanel>
<TextBlock Text="{Binding Tournamentname}"
TextAlignment="Center"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0"
Margin="10"/>
<TextBlock Text="{Binding Organisation}"
TextAlignment="Center"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0"
Margin="10"/>
<TextBlock Text="{Binding Category}"
TextAlignment="Center"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0"
Margin="10"/>
<WrapPanel Margin="10" HorizontalAlignment="Center">
<TextBlock Text="vom "
TextAlignment="Center"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0"/>
<TextBlock Text="{Binding Startdate}"
TextAlignment="Center"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0"
Margin="0 0 5 0"/>
<TextBlock Text="bis "
TextAlignment="Center"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0"/>
<TextBlock Text="{Binding Enddate}"
TextAlignment="Center"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0"/>
</WrapPanel>
<TextBlock Text="{Binding Location}"
<TextBlock Text="erstelle eine neues Tournier oder wähle ein vorhandenes Tournier um es zu bearbeiten!"
TextAlignment="Center"
VerticalAlignment="Center"
FontFamily="Arial"
FontWeight="Bold"
FontSize="16"
Foreground="#0000a0"
Padding="25"
TextWrapping="WrapWithOverflow">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Visibility" Value="Hidden"/>
<Style.Triggers>
<DataTrigger Binding="{Binding HasSelectedTournament}" Value="false">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<StackPanel>
<TextBlock Text="{Binding Tournamentname}"
TextAlignment="Center"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0"
Margin="10"/>
</StackPanel>
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 Organisation}"
TextAlignment="Center"
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 Category}"
TextAlignment="Center"
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 Margin="10" HorizontalAlignment="Center">
<TextBlock Text="vom "
TextAlignment="Center"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0">
<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 Startdate}"
TextAlignment="Center"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0"
Margin="0 0 5 0">
<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="bis "
TextAlignment="Center"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0">
<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 Enddate}"
TextAlignment="Center"
FontFamily="Arial"
FontWeight="Bold"
FontSize="14"
Foreground="#0000a0">
<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>
<TextBlock Text="{Binding Location}"
TextAlignment="Center"
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>
</StackPanel>
</Grid>
</UserControl>