using CommunityToolkit.Mvvm.ComponentModel; using Microsoft.UI.Xaml.Navigation; using XFEExtension.NetCore.WinUIHelper.Interface.Services; using XFEExtension.NetCore.WinUIHelper.Utilities; namespace XFEExtension.NetCore.WinUIHelper.TestApp.ViewModels { public partial class AppShellPageViewModel : ObservableObject { [ObservableProperty] bool canGoBack; public IDialogService DialogService { get; set; } = ServiceManager.GetService(); public INavigationViewService NavigationViewService { get; set; } = ServiceManager.GetService(); public IMessageService MessageService { get; set; } = ServiceManager.GetService(); public ILoadingService LoadingService { get; set; } = ServiceManager.GetService(); public AppShellPageViewModel() { NavigationViewService.NavigationService.Navigated += NavigationService_Navigated; } private void NavigationService_Navigated(object? sender, NavigationEventArgs e) => CanGoBack = NavigationViewService.NavigationService.CanGoBack; } }