clean up a bit

This commit is contained in:
Natlinux81
2022-08-17 01:36:42 +02:00
parent 4531f31658
commit b10a792aad
15 changed files with 80 additions and 56 deletions

View File

@@ -32,7 +32,7 @@ namespace Apollon.WPF.Commands
public override async Task ExecuteAsync(object parameter) public override async Task ExecuteAsync(object parameter)
{ {
AddEditDetailsViewModel formViewModel = _addTournamentViewModel.AddEditDetailsViewModel; AddEditDetailsViewModel formViewModel = _addTournamentViewModel.AddEditDetailsViewModel;
Tournament tournament = new Tournament(formViewModel.Organisation,formViewModel.Tournamentname, formViewModel.Category, formViewModel.Startdate, formViewModel.Enddate, Tournament tournament = new Tournament(formViewModel.Organisation,formViewModel.Tournamentname, formViewModel.Competition, formViewModel.Startdate, formViewModel.Enddate,
formViewModel.Location, formViewModel.Rounds); formViewModel.Location, formViewModel.Rounds);
try try

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -10,12 +10,12 @@
mc:Ignorable="d" mc:Ignorable="d"
Title="Apollon Auswertung Bogen" Title="Apollon Auswertung Bogen"
Height="680" Height="680"
Width="1080" Width="1100"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
Background="Transparent" Background="Transparent"
AllowsTransparency="True" AllowsTransparency="True"
WindowStyle="None" WindowStyle="None"
ResizeMode="CanResizeWithGrip"> ResizeMode="NoResize">
<Window.Resources> <Window.Resources>
<DataTemplate DataType="{x:Type vms:AddTournamentViewModel}"> <DataTemplate DataType="{x:Type vms:AddTournamentViewModel}">
<views:AddTournamentView/> <views:AddTournamentView/>
@@ -24,8 +24,6 @@
<views:EditTournamentView/> <views:EditTournamentView/>
</DataTemplate> </DataTemplate>
</Window.Resources> </Window.Resources>
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="auto"/> <RowDefinition Height="auto"/>
@@ -74,5 +72,4 @@
Click="Button_Exit"/> Click="Button_Exit"/>
</WrapPanel> </WrapPanel>
</Grid> </Grid>
</ScrollViewer>
</Window> </Window>

View File

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

View File

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

View File

@@ -22,7 +22,7 @@ namespace Apollon.WPF.ViewModels
{ {
Organisation = tournament.Organisation, Organisation = tournament.Organisation,
Tournamentname = tournament.Tournamentname, Tournamentname = tournament.Tournamentname,
Category = tournament.Category, Competition = tournament.Competition,
Startdate = tournament.Startdate, Startdate = tournament.Startdate,
Enddate = tournament.Enddate, Enddate = tournament.Enddate,
Location = tournament.Location, Location = tournament.Location,

View File

@@ -17,7 +17,7 @@ namespace Apollon.WPF.ViewModels
public bool HasSelectedTournament => SelectedTournament != null; public bool HasSelectedTournament => SelectedTournament != null;
public string Organisation => SelectedTournament?.Organisation ?? "keine Organisation"; public string Organisation => SelectedTournament?.Organisation ?? "keine Organisation";
public string Tournamentname => SelectedTournament?.Tournamentname ?? "kein Name"; public string Tournamentname => SelectedTournament?.Tournamentname ?? "kein Name";
public string Category => SelectedTournament?.Category ?? "keine Kategorie"; public string Category => SelectedTournament?.Competition ?? "keine Kategorie";
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";

View File

@@ -13,6 +13,7 @@ namespace Apollon.WPF.ViewModels
public Tournament Tournament { get;} public Tournament Tournament { get;}
public string Tournamentname => Tournament.Tournamentname; public string Tournamentname => Tournament.Tournamentname;
public string Location => Tournament.Location;
public ICommand DeleteCommand { get; } public ICommand DeleteCommand { get; }
public OverviewListingItemViewModel(Tournament tournament) public OverviewListingItemViewModel(Tournament tournament)

View File

@@ -6,36 +6,36 @@
xmlns:local="clr-namespace:Apollon.WPF.Views.Components" xmlns:local="clr-namespace:Apollon.WPF.Views.Components"
mc:Ignorable="d"> mc:Ignorable="d">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="55"/> <RowDefinition Height="55"/>
<RowDefinition Height="55"/> <RowDefinition Height="55"/>
<RowDefinition Height="55"/> <RowDefinition Height="55"/>
<RowDefinition Height="55"/> <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>
<ColumnDefinition Width="180"/> <ColumnDefinition Width="180"/>
<ColumnDefinition Width="400"/> <ColumnDefinition Width="400"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Text="Veranstalter: " <TextBlock Text="Veranstalter: "
Style="{StaticResource ModalTextBlock}"/> Style="{StaticResource ModalTextBlock}"/>
<TextBlock Grid.Row="1" <TextBlock Grid.Row="1"
Text="Turniername: " Text="Turniername: "
Style="{StaticResource ModalTextBlock}"/> Style="{StaticResource ModalTextBlock}"/>
<TextBlock Grid.Row="2" <TextBlock Grid.Row="2"
Text="Kategorie: " Text="Wettkampfart: "
Style="{StaticResource ModalTextBlock}"/> Style="{StaticResource ModalTextBlock}"/>
<TextBlock Grid.Row="3" <TextBlock Grid.Row="3"
Text="Startdatum: " Text="Startdatum: "
Style="{StaticResource ModalTextBlock}"/> Style="{StaticResource ModalTextBlock}"/>
<TextBlock Grid.Row="4" <TextBlock Grid.Row="4"
Text="Enddatum: " Text="Enddatum: "
Style="{StaticResource ModalTextBlock}"/> Style="{StaticResource ModalTextBlock}"/>
<TextBlock Grid.Row="5" <TextBlock Grid.Row="5"
Text="Veranstaltungsort: " Text="Veranstaltungsort: "
Style="{StaticResource ModalTextBlock}"/> Style="{StaticResource ModalTextBlock}"/>
<TextBlock Grid.Row="6" <TextBlock Grid.Row="6"
@@ -49,7 +49,7 @@
Height="30" Height="30"
Background="LightGray" Background="LightGray"
VerticalContentAlignment="Center"/> VerticalContentAlignment="Center"/>
<TextBox Grid.Row="1" <TextBox Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Text="{Binding Tournamentname, UpdateSourceTrigger=PropertyChanged}" Text="{Binding Tournamentname, UpdateSourceTrigger=PropertyChanged}"
FontFamily="Arial" FontFamily="Arial"
@@ -57,22 +57,22 @@
Height="30" Height="30"
VerticalContentAlignment="Center" VerticalContentAlignment="Center"
Background="LightGray"/> Background="LightGray"/>
<ComboBox Grid.Row="2" <ComboBox Grid.Row="2"
Grid.Column="1" Grid.Column="1"
ItemsSource="{Binding Category}"
Height="30" Height="30"
Width="150"
FontSize="16" FontSize="16"
HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
VerticalContentAlignment="Center"/> HorizontalAlignment="Left"/>
<DatePicker Grid.Row="3" <DatePicker Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Height="30" Height="30"
FontSize="16" FontSize="16"
Width="160" Width="160"
HorizontalAlignment="Left"/> HorizontalAlignment="Left"/>
<DatePicker Grid.Row="4" <DatePicker Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Height="30" Height="30"
FontSize="16" FontSize="16"
@@ -125,6 +125,6 @@
</Grid> </Grid>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@@ -17,7 +17,7 @@
FontWeight="Bold" FontWeight="Bold"
Background="Transparent" Background="Transparent"
BorderBrush="Transparent" BorderBrush="Transparent"
Padding="20" Padding="5"
ItemsSource="{Binding OverviewListingItemViewModels}" ItemsSource="{Binding OverviewListingItemViewModels}"
SelectedItem="{Binding SelectedOverviewListingItemViewModel}"> SelectedItem="{Binding SelectedOverviewListingItemViewModel}">
<ListView.ItemContainerStyle> <ListView.ItemContainerStyle>
@@ -32,7 +32,12 @@
<ColumnDefinition Width="*"></ColumnDefinition> <ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition> <ColumnDefinition Width="auto"></ColumnDefinition>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Tournamentname}"/> <WrapPanel Grid.Column="0">
<TextBlock Text="{Binding Tournamentname}"
Margin="0 0 4 0"/>
<TextBlock Text="{Binding Location}"/>
</WrapPanel>
<Button Grid.Column="1" <Button Grid.Column="1"
Background="Transparent" Background="Transparent"
BorderThickness="0" BorderThickness="0"

View File

@@ -71,8 +71,10 @@
</Style> </Style>
</TextBlock.Style> </TextBlock.Style>
</TextBlock> </TextBlock>
<WrapPanel HorizontalAlignment="Center">
<TextBlock Text="{Binding Category}" <TextBlock Text="{Binding Category}"
TextAlignment="Center" TextAlignment="Center"
VerticalAlignment="Center"
FontFamily="Arial" FontFamily="Arial"
FontWeight="Bold" FontWeight="Bold"
FontSize="14" FontSize="14"
@@ -89,7 +91,25 @@
</Style> </Style>
</TextBlock.Style> </TextBlock.Style>
</TextBlock> </TextBlock>
<WrapPanel Margin="10" HorizontalAlignment="Center"> <Image Grid.Column="2"
Grid.Row="2"
Source="D:\Projekte\Apollon\Apollon\Apollon.WPF\Images\TargetField.png"
Width="50"
Height="50">
<Image.Style>
<Style TargetType="Image">
<Setter Property="Visibility" Value="Hidden"/>
<Style.Triggers>
<DataTrigger Binding="{Binding HasSelectedTournament}" Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Image.Style>
</Image>
</WrapPanel>
<WrapPanel Margin="10" HorizontalAlignment="Center">
<TextBlock Text="vom " <TextBlock Text="vom "
TextAlignment="Center" TextAlignment="Center"
FontFamily="Arial" FontFamily="Arial"

View File

@@ -15,8 +15,8 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition/> <ColumnDefinition Width="auto"/>
<ColumnDefinition/> <ColumnDefinition Width="auto"/>
<ColumnDefinition/> <ColumnDefinition/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
@@ -61,7 +61,7 @@
<Image Grid.Column="2" <Image Grid.Column="2"
Grid.Row="2" Grid.Row="2"
Source="D:\Projekte\Apollon\Apollon\Apollon.WPF\Images\Scheibe.png" Source="D:\Projekte\Apollon\Apollon\Apollon.WPF\Images\Archery.png"
Width="250" Width="250"
Height="250"> Height="250">
</Image> </Image>
@@ -89,6 +89,7 @@
Foreground="#0000a0"/> Foreground="#0000a0"/>
<components:OverViewListing Height="400" <components:OverViewListing Height="400"
Width="400"
DataContext="{Binding OverviewListingViewModel}"/> DataContext="{Binding OverviewListingViewModel}"/>
</StackPanel> </StackPanel>