Navigation Service and Cleanup UI
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Apollon.WPF.Stores;
|
||||
using Apollon.WPF.Services;
|
||||
using Apollon.WPF.Stores;
|
||||
using Apollon.WPF.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -11,18 +12,16 @@ namespace Apollon.WPF.Commands
|
||||
public class NavigateCommand<TViewModel> : CommandBase
|
||||
where TViewModel : ViewModelBase
|
||||
{
|
||||
private readonly NavigationStore _navigationStore;
|
||||
private readonly Func<TViewModel> _createViewModel;
|
||||
private readonly NavigationService<TViewModel> _navigationService;
|
||||
|
||||
public NavigateCommand(NavigationStore navigationStore, Func<TViewModel> createViewModel)
|
||||
public NavigateCommand(NavigationService<TViewModel> navigationService)
|
||||
{
|
||||
_navigationStore = navigationStore;
|
||||
_createViewModel = createViewModel;
|
||||
_navigationService = navigationService;
|
||||
}
|
||||
|
||||
public override void Execute(object parameter)
|
||||
{
|
||||
_navigationStore.CurrentViewModel = _createViewModel();
|
||||
{
|
||||
_navigationService.Navigate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user