combobox not ready

This commit is contained in:
Natlinux81
2022-08-17 20:13:43 +02:00
parent 6cf060628f
commit 5f93b56b8e
5 changed files with 31 additions and 7 deletions

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Apollon.WPF.Models
{
public class Competition
{
public Competition(string competitionName, byte competitionImage)
{
CompetitionName = competitionName;
CompetitionImage = competitionImage;
}
public string CompetitionName { get; set; }
public byte CompetitionImage { get; set; }
}
}

View File

@@ -39,16 +39,16 @@ namespace Apollon.WPF.ViewModels
}
}
private string _category;
private string _competition;
public string Competition
{
get
{
return _category;
return _competition;
}
set
{
_category = value;
_competition = value;
OnPropertyChanged(nameof(Competition));
}
}

View File

@@ -17,7 +17,7 @@ namespace Apollon.WPF.ViewModels
public bool HasSelectedTournament => SelectedTournament != null;
public string Organisation => SelectedTournament?.Organisation ?? "keine Organisation";
public string TournamentName => SelectedTournament?.TournamentName ?? "kein Name";
public string Category => SelectedTournament?.Competition ?? "keine Kategorie";
public string Competition => SelectedTournament?.Competition ?? "keine Kategorie";
public string StartDate => SelectedTournament?.StartDate.ToString("d") ?? "kein Datum";
public string EndDate => SelectedTournament?.EndDate.ToString("d") ?? "kein Datum";
public string Location => SelectedTournament?.Location ?? "kein Ort";
@@ -41,7 +41,7 @@ namespace Apollon.WPF.ViewModels
OnPropertyChanged(nameof(HasSelectedTournament));
OnPropertyChanged(nameof(Organisation));
OnPropertyChanged(nameof(TournamentName));
OnPropertyChanged(nameof(Category));
OnPropertyChanged(nameof(Competition));
OnPropertyChanged(nameof(StartDate));
OnPropertyChanged(nameof(EndDate));
OnPropertyChanged(nameof(Location));

View File

@@ -57,11 +57,14 @@
Height="30"
VerticalContentAlignment="Center"
Background="LightGray"/>
<ComboBox Grid.Row="2"
<ComboBox Grid.Row="2"
Text="{Binding Competition}"
IsEditable="True"
Grid.Column="1"
Height="30"
Width="150"
FontSize="16"
VerticalContentAlignment="Center"
HorizontalAlignment="Left"/>

View File

@@ -72,7 +72,7 @@
</TextBlock.Style>
</TextBlock>
<WrapPanel HorizontalAlignment="Center">
<TextBlock Text="{Binding Category}"
<TextBlock Text="{Binding Competition}"
TextAlignment="Center"
VerticalAlignment="Center"
FontFamily="Arial"