From 63e24deccc73f592b2bf2b36490d9c2b10df8e7a Mon Sep 17 00:00:00 2001 From: Natlinux81 <97396587+Natlinux81@users.noreply.github.com> Date: Sun, 21 Aug 2022 17:40:36 +0200 Subject: [PATCH] open WarningDelete Modal --- .../Commands/OpenWarningDeleteCommand.cs | 26 ++++++++++ Apollon.WPF/MainWindow.xaml | 3 ++ .../OverviewListingItemViewModel.cs | 6 ++- .../ViewModels/WarningDeleteViewModel.cs | 16 ++++++ .../Views/Components/OverViewListing.xaml | 2 +- Apollon.WPF/Views/WarningDeleteView.xaml | 49 +++++++++++++++++++ Apollon.WPF/Views/WarningDeleteView.xaml.cs | 28 +++++++++++ 7 files changed, 127 insertions(+), 3 deletions(-) create mode 100644 Apollon.WPF/Commands/OpenWarningDeleteCommand.cs create mode 100644 Apollon.WPF/ViewModels/WarningDeleteViewModel.cs create mode 100644 Apollon.WPF/Views/WarningDeleteView.xaml create mode 100644 Apollon.WPF/Views/WarningDeleteView.xaml.cs diff --git a/Apollon.WPF/Commands/OpenWarningDeleteCommand.cs b/Apollon.WPF/Commands/OpenWarningDeleteCommand.cs new file mode 100644 index 0000000..3dfda05 --- /dev/null +++ b/Apollon.WPF/Commands/OpenWarningDeleteCommand.cs @@ -0,0 +1,26 @@ +using Apollon.WPF.Stores; +using Apollon.WPF.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Apollon.WPF.Commands +{ + public class OpenWarningDeleteCommand : CommandBase + { + private readonly ModalNavigationStore _modalNavigationStore; + + public OpenWarningDeleteCommand(ModalNavigationStore modalNavigationStore) + { + _modalNavigationStore = modalNavigationStore; + } + + public override void Execute(object parameter) + { + WarningDeleteViewModel warningDeleteViewModel = new WarningDeleteViewModel(_modalNavigationStore); + _modalNavigationStore.CurrentViewModel = warningDeleteViewModel; + } + } +} diff --git a/Apollon.WPF/MainWindow.xaml b/Apollon.WPF/MainWindow.xaml index 3eb2f42..e0fdb7e 100644 --- a/Apollon.WPF/MainWindow.xaml +++ b/Apollon.WPF/MainWindow.xaml @@ -23,6 +23,9 @@ + + + diff --git a/Apollon.WPF/ViewModels/OverviewListingItemViewModel.cs b/Apollon.WPF/ViewModels/OverviewListingItemViewModel.cs index d96f6e0..9780ad4 100644 --- a/Apollon.WPF/ViewModels/OverviewListingItemViewModel.cs +++ b/Apollon.WPF/ViewModels/OverviewListingItemViewModel.cs @@ -18,14 +18,16 @@ namespace Apollon.WPF.ViewModels public string Location => Tournament.Location; public ICommand EditCommand { get; } - public ICommand DeleteCommand { get; } + //public ICommand DeleteCommand { get; } + public ICommand WarningDeleteCommand { get; } public OverviewListingItemViewModel(Tournament tournament, TournamentsStore tournamentStore, ModalNavigationStore modalNavigationStore) { Tournament = tournament; EditCommand = new OpenEditTournamentCommand(this, tournamentStore, modalNavigationStore); - DeleteCommand = new DeleteTournamentCommand(this, tournamentStore); + //DeleteCommand = new DeleteTournamentCommand(this, tournamentStore); + WarningDeleteCommand = new OpenWarningDeleteCommand(modalNavigationStore); } public void Update(Tournament tournament) diff --git a/Apollon.WPF/ViewModels/WarningDeleteViewModel.cs b/Apollon.WPF/ViewModels/WarningDeleteViewModel.cs new file mode 100644 index 0000000..76c6715 --- /dev/null +++ b/Apollon.WPF/ViewModels/WarningDeleteViewModel.cs @@ -0,0 +1,16 @@ +using Apollon.WPF.Stores; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Apollon.WPF.ViewModels +{ + public class WarningDeleteViewModel : ViewModelBase + { + public WarningDeleteViewModel(ModalNavigationStore modalNavigationStore) + { + } + } +} diff --git a/Apollon.WPF/Views/Components/OverViewListing.xaml b/Apollon.WPF/Views/Components/OverViewListing.xaml index c83eb4f..f75aea2 100644 --- a/Apollon.WPF/Views/Components/OverViewListing.xaml +++ b/Apollon.WPF/Views/Components/OverViewListing.xaml @@ -58,7 +58,7 @@ BorderThickness="0" Cursor="Hand" ToolTip="Löschen" - Command="{Binding DeleteCommand}"> + Command="{Binding WarningDeleteCommand}"> + + + + + + + + + + + +