Files
Apollon/Apollon.WPF/Stores/ModalNavigationStore.cs
2022-08-14 03:55:20 +02:00

37 lines
662 B
C#

using Apollon.WPF.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Apollon.WPF.Stores
{
public class ModalNavigationStore
{
private ViewModelBase _currentViewModel
;
public ViewModelBase CurrentViewModel
{
get
{
return _currentViewModel;
}
set
{
_currentViewModel = value;
CurrentViewModelChanged?.Invoke();
}
}
public bool IsOpen => CurrentViewModel != null;
public event Action CurrentViewModelChanged;
internal void Close()
{
CurrentViewModel = null;
}
}
}