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