stand 06.11.2022

This commit is contained in:
Natlinux
2022-11-06 21:21:20 +01:00
parent 38a5d57b25
commit a18158806c
12 changed files with 85 additions and 26 deletions

View File

@@ -50,7 +50,7 @@ namespace Apollon.WPF.Commands
await _tournamentStore.Add(tournament); await _tournamentStore.Add(tournament);
_modalNavigationStore.Close(); _modalNavigationStore.Close();
_navigationStore.CurrentViewModel = new NavBarViewModel(_navigationStore, _selectedTournamentsStore, _modalNavigationStore, _tournamentStore); _navigationStore.CurrentViewModel = new TournamentDetailsViewModel(_navigationStore, _selectedTournamentsStore, _modalNavigationStore, _tournamentStore);
} }
catch (Exception) catch (Exception)

View File

@@ -49,8 +49,11 @@
<DataTemplate DataType="{x:Type vms:OverviewViewModel}"> <DataTemplate DataType="{x:Type vms:OverviewViewModel}">
<views:OverviewView/> <views:OverviewView/>
</DataTemplate> </DataTemplate>
<DataTemplate DataType="{x:Type vms:NavBarViewModel}"> <DataTemplate DataType="{x:Type vms:TournamentDetailsViewModel}">
<views:NavBarView/> <views:TournamentDetailsView/>
</DataTemplate>
<DataTemplate DataType="{x:Type vms:RootdatesViewModel}">
<views:RootdatesView/>
</DataTemplate> </DataTemplate>
</ContentControl.Resources> </ContentControl.Resources>
</ContentControl> </ContentControl>

View File

@@ -33,7 +33,7 @@ namespace Apollon.WPF.ViewModels
_selectedTournamentStore.SelectedTournamentChanged += SelectedTournamentStore_SelectedTournamentChanged; _selectedTournamentStore.SelectedTournamentChanged += SelectedTournamentStore_SelectedTournamentChanged;
NavigateNavBarCommand = new NavigateCommand<NavBarViewModel>(navigationStore, () => new NavBarViewModel(navigationStore, selectedTournamentStore, modalNavigationStore, tournamentsStore)); NavigateNavBarCommand = new NavigateCommand<TournamentDetailsViewModel>(navigationStore, () => new TournamentDetailsViewModel(navigationStore, selectedTournamentStore, modalNavigationStore, tournamentsStore));
} }
protected override void Dispose() protected override void Dispose()

View File

@@ -48,6 +48,7 @@ namespace Apollon.WPF.ViewModels
public ICommand AddTournamentCommand { get; } public ICommand AddTournamentCommand { get; }
public ICommand LoadTournamentsCommand { get; } public ICommand LoadTournamentsCommand { get; }
public ICommand NavigateNameListCommand { get; }
public OverviewViewModel(TournamentsStore tournamentStore, SelectedTournamentsStore selectedTournamentStore, public OverviewViewModel(TournamentsStore tournamentStore, SelectedTournamentsStore selectedTournamentStore,
ModalNavigationStore modalNavigationStore, NavigationStore navigationStore) ModalNavigationStore modalNavigationStore, NavigationStore navigationStore)
@@ -57,6 +58,8 @@ namespace Apollon.WPF.ViewModels
LoadTournamentsCommand = new LoadTournamentsCommand(this, tournamentStore); LoadTournamentsCommand = new LoadTournamentsCommand(this, tournamentStore);
AddTournamentCommand = new OpenAddTournamentCommand(tournamentStore, modalNavigationStore, navigationStore, selectedTournamentStore); AddTournamentCommand = new OpenAddTournamentCommand(tournamentStore, modalNavigationStore, navigationStore, selectedTournamentStore);
NavigateNameListCommand = new NavigateCommand<RootdatesViewModel>(navigationStore, () => new RootdatesViewModel());
} }
public static OverviewViewModel LoadViewModel(SelectedTournamentsStore selectedTournamentStore, public static OverviewViewModel LoadViewModel(SelectedTournamentsStore selectedTournamentStore,

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Apollon.WPF.ViewModels
{
public class RootdatesViewModel : ViewModelBase
{
}
}

View File

@@ -10,7 +10,7 @@ using System.Windows.Input;
namespace Apollon.WPF.ViewModels namespace Apollon.WPF.ViewModels
{ {
public class NavBarViewModel : ViewModelBase public class TournamentDetailsViewModel : ViewModelBase
{ {
@@ -28,7 +28,7 @@ namespace Apollon.WPF.ViewModels
public int Rounds => SelectedTournament?.Rounds ?? 0; public int Rounds => SelectedTournament?.Rounds ?? 0;
public ICommand NavigateOverviewCommand { get; } public ICommand NavigateOverviewCommand { get; }
public NavBarViewModel(NavigationStore navigationStore, SelectedTournamentsStore selectedTournamentsStore, ModalNavigationStore modalNavigationStore, TournamentsStore tournamentsStore) public TournamentDetailsViewModel(NavigationStore navigationStore, SelectedTournamentsStore selectedTournamentsStore, ModalNavigationStore modalNavigationStore, TournamentsStore tournamentsStore)
{ {
NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(navigationStore, () => OverviewViewModel.LoadViewModel( selectedTournamentsStore, modalNavigationStore, tournamentsStore, navigationStore)); NavigateOverviewCommand = new NavigateCommand<OverviewViewModel>(navigationStore, () => OverviewViewModel.LoadViewModel( selectedTournamentsStore, modalNavigationStore, tournamentsStore, navigationStore));

View File

@@ -62,6 +62,15 @@
Margin="40" Margin="40"
Cursor="Hand" Cursor="Hand"
Command="{Binding AddTournamentCommand}"/> Command="{Binding AddTournamentCommand}"/>
<Button Style="{StaticResource ModernButton}"
Content="Namenliste pflegen"
FontSize="16"
Height="40"
Width="210"
Margin="40"
Cursor="Hand"
Command="{Binding NavigateNameListCommand}"/>
</StackPanel> </StackPanel>
<Grid Grid.Column="1" <Grid Grid.Column="1"

View File

@@ -0,0 +1,15 @@
<UserControl x:Class="Apollon.WPF.Views.RootdatesView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Apollon.WPF.Views"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<TextBlock Text="Stammdaten"
FontSize="30"
TextAlignment="Center"
VerticalAlignment="Center"/>
</Grid>
</UserControl>

View File

@@ -16,11 +16,11 @@ using System.Windows.Shapes;
namespace Apollon.WPF.Views namespace Apollon.WPF.Views
{ {
/// <summary> /// <summary>
/// Interaction logic for NavBarView.xaml /// Interaction logic for NameListView.xaml
/// </summary> /// </summary>
public partial class NavBarView : UserControl public partial class RootdatesView : UserControl
{ {
public NavBarView() public RootdatesView()
{ {
InitializeComponent(); InitializeComponent();
} }

View File

@@ -1,14 +1,14 @@
<UserControl x:Class="Apollon.WPF.Views.NavBarView" <UserControl x:Class="Apollon.WPF.Views.TournamentDetailsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Apollon.WPF.Views"
xmlns:components="clr-namespace:Apollon.WPF.Views.Components" xmlns:components="clr-namespace:Apollon.WPF.Views.Components"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:local="clr-namespace:Apollon.WPF.Views"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<Grid Margin="45"> <Grid Margin="50">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="100"/> <RowDefinition Height="100"/>
<RowDefinition/> <RowDefinition/>
@@ -32,16 +32,5 @@
</Button> </Button>
<components:TournamentDetails Grid.Column="1"/> <components:TournamentDetails Grid.Column="1"/>
<StackPanel Grid.Row="1">
<Button Height="45"
Background="Transparent"/>
<Button Height="45"
Background="Transparent"/>
<Button Height="45"
Background="Transparent"/>
<Button Height="45"
Background="Transparent"/>
</StackPanel>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Apollon.WPF.Views
{
/// <summary>
/// Interaction logic for TournamentDetailsView.xaml
/// </summary>
public partial class TournamentDetailsView : UserControl
{
public TournamentDetailsView()
{
InitializeComponent();
}
}
}