using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using XFEExtension.NetCore.WinUIHelper.Interface.Services;
using XFEExtension.NetCore.WinUIHelper.Utilities;
namespace XFEWarframe.Admin.ViewModels;
public partial class AppShellPageViewModel : ObservableObject
{
public INavigationViewService NavigationViewService { get; } = ServiceManager.GetService<INavigationViewService>();
public IMessageService MessageService { get; } = ServiceManager.GetService<IMessageService>();
public ILoadingService LoadingService { get; } = ServiceManager.GetService<ILoadingService>();
[ObservableProperty] public partial bool CanGoBack { get; set; }
public AppShellPageViewModel() => NavigationViewService.NavigationService.Navigated +=
(_, _) => CanGoBack = NavigationViewService.NavigationService.CanGoBack;
[RelayCommand] private void GoBack() => NavigationViewService.NavigationService.GoBack();
}
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using XFEExtension.NetCore.WinUIHelper.Interface.Services;
using XFEExtension.NetCore.WinUIHelper.Utilities;
namespace XFEWarframe.Admin.ViewModels;
public partial class AppShellPageViewModel : ObservableObject
{
public INavigationViewService NavigationViewService { get; } = ServiceManager.GetService<INavigationViewService>();
public IMessageService MessageService { get; } = ServiceManager.GetService<IMessageService>();
public ILoadingService LoadingService { get; } = ServiceManager.GetService<ILoadingService>();
[ObservableProperty] public partial bool CanGoBack { get; set; }
public AppShellPageViewModel() => NavigationViewService.NavigationService.Navigated +=
(_, _) => CanGoBack = NavigationViewService.NavigationService.CanGoBack;
[RelayCommand] private void GoBack() => NavigationViewService.NavigationService.GoBack();
}