Namelist to navbar

This commit is contained in:
Natlinux
2023-02-04 19:00:42 +01:00
parent b6a427ca29
commit 7ac59d15b3
12 changed files with 61 additions and 35 deletions

View File

@@ -9,6 +9,7 @@
<ItemGroup>
<None Remove="images\3d.png" />
<None Remove="images\Archery.png" />
<None Remove="images\targetField.png" />
<None Remove="images\targetHall.png" />
<None Remove="images\targetOutdoor.png" />
@@ -25,14 +26,13 @@
<ProjectReference Include="..\Apollon.EntityFramework\Apollon.EntityFramework.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Images\Logos\" />
</ItemGroup>
<ItemGroup>
<Resource Include="images\3d.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="images\Archery.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>
<Resource Include="images\targetField.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Resource>

View File

@@ -51,7 +51,8 @@ namespace Apollon.WPF
_navBarPreparationViewModel = new NavBarPreparationViewModel(CreateOverviewNavigationService(),
CreateGroupsNavigationService(),
CreateClassesNavigationService(),
CreateNamelistNavigationService(),
CreateClassesNavigationService(),
CreateArchersNavigationService());
}
@@ -105,6 +106,12 @@ namespace Apollon.WPF
_navigationStore, ()=> new ClassesViewModel(_navBarPreparationViewModel, _selectedTournamentStore));
}
private NavigationService<NameListViewModel> CreateNamelistNavigationService()
{
return new NavigationService<NameListViewModel>(
_navigationStore, () => new NameListViewModel());
}
private NavigationService<ArchersViewModel> CreateArchersNavigationService()
{
return new NavigationService<ArchersViewModel>(

View File

@@ -134,16 +134,16 @@ namespace Apollon.WPF.ViewModels
}
}
private int _rounds;
private int _groups;
public int Groups
{
get
{
return _rounds;
return _groups;
}
set
{
_rounds = value;
_groups = value;
OnPropertyChanged(nameof(Groups));
}
}

View File

@@ -78,8 +78,8 @@ namespace Apollon.WPF.ViewModels
}
}
private string _birthday;
public string Birthday
private DateTime _birthday;
public DateTime Birthday
{
get
{
@@ -119,5 +119,19 @@ namespace Apollon.WPF.ViewModels
OnPropertyChanged(nameof(Qualification));
}
}
private bool _isreadOnly;
public bool IsReadOnly
{
get
{
return _isreadOnly;
}
set
{
_isreadOnly = value;
OnPropertyChanged(nameof(IsReadOnly));
}
}
}
}

View File

@@ -14,14 +14,19 @@ namespace Apollon.WPF.ViewModels
public ICommand NavigateOverviewCommand { get; }
public ICommand NavigateGroupsCommand { get;}
public ICommand NavigateClassesCommand { get;}
public ICommand NavigateNamelistCommand { get;}
public ICommand NavigateArchersCommand { get;}
public NavBarPreparationViewModel(NavigationService<OverviewViewModel> overviewNavigationService, NavigationService<GroupsViewModel> groupNavigationService,
NavigationService<ClassesViewModel> classNavigationService, NavigationService<ArchersViewModel> archersNavigationService)
public NavBarPreparationViewModel(NavigationService<OverviewViewModel> overviewNavigationService,
NavigationService<GroupsViewModel> groupNavigationService,
NavigationService<NameListViewModel> namelistNavigationService,
NavigationService<ClassesViewModel> classNavigationService,
NavigationService<ArchersViewModel> archersNavigationService)
{
NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(overviewNavigationService);
NavigateGroupsCommand = new NavigateCommand<GroupsViewModel>(groupNavigationService);
NavigateClassesCommand = new NavigateCommand<ClassesViewModel>(classNavigationService);
NavigateNamelistCommand = new NavigateCommand<NameListViewModel>(namelistNavigationService);
NavigateArchersCommand = new NavigateCommand<ArchersViewModel>(archersNavigationService);
}
}

View File

@@ -2,11 +2,6 @@
using Apollon.WPF.Commands;
using Apollon.WPF.Services;
using Apollon.WPF.Stores;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Apollon.WPF.ViewModels
@@ -17,11 +12,11 @@ namespace Apollon.WPF.ViewModels
private Tournament SelectedTournament => _selectedTournamentStore.SelectedTournament;
public bool HasSelectedTournament => SelectedTournament != null;
public string Logo => SelectedTournament?.Logo ?? "D:\\Projekte\\Apollon\\Apollon\\Apollon.WPF\\Images\\Archery.png";
public string Logo => SelectedTournament?.Logo ?? @"\images\Archery.png";
public string Organisation => SelectedTournament?.Organisation ?? "keine Organisation";
public string TournamentName => SelectedTournament?.TournamentName ?? "kein Name";
public string Competition => SelectedTournament?.Competition ?? "keine Kategorie";
public string CompetitionImage => SelectedTournament?.CompetitionImage ?? "D:\\Projekte\\Apollon\\Apollon\\Apollon.WPF\\Images\\Archery.png";
public string CompetitionImage => SelectedTournament?.CompetitionImage ?? @"\images\Archery.png";
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";

View File

@@ -16,11 +16,11 @@ namespace Apollon.WPF.ViewModels
private Tournament SelectedTournament => _selectedTournamentsStore.SelectedTournament;
public bool HasSelectedTournament => SelectedTournament != null;
public string Logo => SelectedTournament?.Logo ?? "D:\\Projekte\\Apollon\\Apollon\\Apollon.WPF\\Images\\Archery.png";
public string Logo => SelectedTournament?.Logo ?? @"\images\Archery.png";
public string Organisation => SelectedTournament?.Organisation ?? "keine Organisation";
public string TournamentName => SelectedTournament?.TournamentName ?? "kein Name";
public string Competition => SelectedTournament?.Competition ?? "keine Kategorie";
public string CompetitionImage => SelectedTournament?.CompetitionImage ?? "D:\\Projekte\\Apollon\\Apollon\\Apollon.WPF\\Images\\Archery.png";
public string CompetitionImage => SelectedTournament?.CompetitionImage ?? @"\images\Archery.png";
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";

View File

@@ -83,7 +83,8 @@
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Namenliste"
Template="{StaticResource Item_Template}">
Template="{StaticResource Item_Template}"
Command="{Binding NavigateNamelistCommand}">
<MenuItem.Icon>
<iconPacks:PackIconMaterial Kind="BadgeAccount"
Height="20"

View File

@@ -81,7 +81,7 @@
</StackPanel>
<Image Grid.Column="2"
Grid.Row="2"
Source="{Binding Logo}"
Source="{Binding Logo, TargetNullValue={x:Null}}"
Width="50"
Height="50">
<Image.Style>

View File

@@ -9,16 +9,20 @@
<DataGrid FontSize="14"
HorizontalAlignment="Center"
CanUserAddRows="True"
AutoGenerateColumns="True">
AutoGenerateColumns="True"
IsReadOnly="{Binding IsReadOnly}">
<DataTemplate>
</DataTemplate>
<DataGrid.Columns>
<DataGridTextColumn Width="120" Header="Vorname" Binding="{Binding FirstName}"/>
<DataGridTextColumn Width="120" Header="Nachname" Binding="{Binding LastName}" />
<DataGridTextColumn Width="120" Header="Passnummer" Binding="{Binding PassNumber}"/>
<DataGridTextColumn Width="150" Header="Verein" Binding="{Binding Society}" />
<DataGridTextColumn Width="120" Header="Vereinsnummer" Binding="{Binding SocietyNumber}"/>
<DataGridTextColumn Width="100" Header="Geburtsdatum" Binding="{Binding Birthday}" />
<DataGridTextColumn Header="Bundesland" Binding="{Binding Country}"/>
<DataGridTextColumn Header="Qualifikation" Binding="{Binding Qualification}"/>
<DataGridTextColumn Width="120" Header="Vorname" Binding="{Binding FirstName}" IsReadOnly="False"/>
<DataGridTextColumn Width="120" Header="Nachname" Binding="{Binding LastName}" IsReadOnly="False"/>
<DataGridTextColumn Width="120" Header="Passnummer" Binding="{Binding PassNumber}" IsReadOnly="False"/>
<DataGridTextColumn Width="150" Header="Verein" Binding="{Binding Society}" IsReadOnly="False" />
<DataGridTextColumn Width="120" Header="Vereinsnummer" Binding="{Binding SocietyNumber}" IsReadOnly="False"/>
<DataGridTextColumn Width="100" Header="Geburtsdatum" Binding="{Binding Birthday}" IsReadOnly="False"/>
<DataGridTextColumn Header="Bundesland" Binding="{Binding Country}" IsReadOnly="False"/>
<DataGridTextColumn Header="Qualifikation" Binding="{Binding Qualification}" IsReadOnly="False"/>
</DataGrid.Columns>
</DataGrid>