ChaoXingAutoClass
【WinUI】基于 XFEstudio 的 XFEWinUIApplication 模板重建的 WinUI 3 课程工作台。二维码和账号密码登录、课程 GridView、章节、播放进度、学习笔记及日志均使用原生 WinUI 控件。网页播放器运行在独立后台进程中,界面不显示课程网站。
关注
0
Fork
0
Star
0
using CommunityToolkit.Mvvm.ComponentModel;
using Microsoft.UI.Xaml.Navigation;
using XFEExtension.NetCore.WinUIHelper.Interface.Services;
using XFEExtension.NetCore.WinUIHelper.Utilities;
namespace ChaoXingAutoClass.ViewModels
{
public partial class AppShellPageViewModel : ViewModelBase
{
[ObservableProperty] public partial bool CanGoBack { get; set; }
[ObservableProperty] public partial string UserName { get; set; } = "学习账号";
public IDialogService DialogService { get; set; } = ServiceManager.GetService<IDialogService>();
public INavigationViewService NavigationViewService { get; set; } = ServiceManager.GetService<INavigationViewService>();
public IMessageService MessageService { get; set; } = ServiceManager.GetService<IMessageService>();
public ILoadingService LoadingService { get; set; } = ServiceManager.GetService<ILoadingService>();
public AppShellPageViewModel()
{
NavigationViewService.NavigationService.Navigated += NavigationService_Navigated;
}
private void NavigationService_Navigated(object? sender, NavigationEventArgs e) => CanGoBack = NavigationViewService.NavigationService.CanGoBack;
}
}
using CommunityToolkit.Mvvm.ComponentModel;
using Microsoft.UI.Xaml.Navigation;
using XFEExtension.NetCore.WinUIHelper.Interface.Services;
using XFEExtension.NetCore.WinUIHelper.Utilities;
namespace ChaoXingAutoClass.ViewModels
{
public partial class AppShellPageViewModel : ViewModelBase
{
[ObservableProperty] public partial bool CanGoBack { get; set; }
[ObservableProperty] public partial string UserName { get; set; } = "学习账号";
public IDialogService DialogService { get; set; } = ServiceManager.GetService<IDialogService>();
public INavigationViewService NavigationViewService { get; set; } = ServiceManager.GetService<INavigationViewService>();
public IMessageService MessageService { get; set; } = ServiceManager.GetService<IMessageService>();
public ILoadingService LoadingService { get; set; } = ServiceManager.GetService<ILoadingService>();
public AppShellPageViewModel()
{
NavigationViewService.NavigationService.Navigated += NavigationService_Navigated;
}
private void NavigationService_Navigated(object? sender, NavigationEventArgs e) => CanGoBack = NavigationViewService.NavigationService.CanGoBack;
}
}