Files
DMS/ViewModels/MainViewModel.cs

23 lines
609 B
C#
Raw Normal View History

2025-05-29 08:58:58 +08:00
using CommunityToolkit.Mvvm.ComponentModel;
2025-06-10 20:55:39 +08:00
using PMSWPF.Services;
2025-05-29 08:58:58 +08:00
namespace PMSWPF.ViewModels;
2025-06-10 20:55:39 +08:00
public partial class MainViewModel : ViewModelBase
{
private readonly NavgatorServices _navgatorServices;
2025-06-10 20:55:39 +08:00
[ObservableProperty] private ViewModelBase currentViewModel;
2025-05-29 08:58:58 +08:00
public MainViewModel(NavgatorServices navgatorServices)
{
_navgatorServices = navgatorServices;
_navgatorServices.OnViewModelChanged += () => { CurrentViewModel = _navgatorServices.CurrentViewModel; };
CurrentViewModel = new HomeViewModel();
}
2025-05-29 08:58:58 +08:00
public override void OnLoaded()
{
2025-05-29 08:58:58 +08:00
}
}