XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEWarframe

【WinUI】基于Warframe游戏本体的公开服务器以及安装器

公开
关注 0 Fork 0 Star 0
UTF-8
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();
}