23 lines
673 B
C#
23 lines
673 B
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using UtopiaCanteenSystem.Services;
|
|
|
|
namespace UtopiaCanteenSystem.ViewModels;
|
|
|
|
/// <summary>
|
|
/// Main window ViewModel: exposes current view model from navigation for ContentControl binding.
|
|
/// </summary>
|
|
public partial class MainViewModel : ObservableObject
|
|
{
|
|
[ObservableProperty]
|
|
private object? _currentViewModel;
|
|
|
|
public INavigationService Navigation { get; }
|
|
|
|
public MainViewModel(INavigationService navigation)
|
|
{
|
|
Navigation = navigation;
|
|
Navigation.CurrentViewModelChanged += (_, _) => CurrentViewModel = Navigation.CurrentViewModel;
|
|
Navigation.NavigateToAdminLogin();
|
|
}
|
|
}
|