Revert "impliment NavigateService"

This reverts commit 439850b5b7.
This commit is contained in:
Natlinux
2022-11-27 13:18:15 +01:00
parent 439850b5b7
commit a2c926f915
7 changed files with 19 additions and 57 deletions

View File

@@ -1,5 +1,4 @@
using Apollon.WPF.Services;
using Apollon.WPF.Stores;
using Apollon.WPF.Stores;
using Apollon.WPF.ViewModels;
using System;
using System.Collections.Generic;
@@ -12,16 +11,18 @@ namespace Apollon.WPF.Commands
public class NavigateCommand<TViewModel> : CommandBase
where TViewModel : ViewModelBase
{
private readonly NavigationService<TViewModel> _navigationService;
private readonly NavigationStore _navigationStore;
private readonly Func<TViewModel> _createViewModel;
public NavigateCommand(NavigationService<TViewModel> navigationService)
public NavigateCommand(NavigationStore navigationStore, Func<TViewModel> createViewModel)
{
_navigationService = navigationService;
_navigationStore = navigationStore;
_createViewModel = createViewModel;
}
public override void Execute(object parameter)
{
_navigationService.Navigate();
{
_navigationStore.CurrentViewModel = _createViewModel();
}
}
}