Refactoring durchgeführt
This commit is contained in:
35
DaSaSo.ViewModel/State/Navigation/Navigator.cs
Normal file
35
DaSaSo.ViewModel/State/Navigation/Navigator.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using DaSaSo.ViewModel.Commands;
|
||||
using DaSaSo.ViewModel.Interface;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace DaSaSo.ViewModel.State.Navigation
|
||||
{
|
||||
public class Navigator : INavigator, INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
private BaseViewModel _currentViewModel;
|
||||
public BaseViewModel CurrentViewModel
|
||||
{
|
||||
get => _currentViewModel;
|
||||
set
|
||||
{
|
||||
_currentViewModel = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand UpdateViewModelCommand { get; set; }
|
||||
|
||||
public Navigator(IViewModelAbstractFactory viewModelFactory)
|
||||
{
|
||||
UpdateViewModelCommand = new UpdateCurrentViewModelCommand(this, viewModelFactory);
|
||||
}
|
||||
|
||||
protected void OnPropertyChanged([CallerMemberName]string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user