using HaloPixelToolBox.Backend.ViewModels;
using Microsoft.UI.Xaml.Navigation;
using XFEExtension.NetCore.WinUIHelper.Utilities.Helper;
namespace HaloPixelToolBox.Backend.Views;
/// <summary>
/// 锟斤拷锟斤拷页锟斤拷
/// </summary>
public sealed partial class SettingPage : Page
{
public static SettingPage? Current { get; set; }
public SettingPageViewModel ViewModel { get; set; } = new();
public SettingPage()
{
Current = this;
this.InitializeComponent();
ViewModel.DialogService.RegisterDialog(cleanCacheContentDialog);
ViewModel.SettingService.AddComboBox(appThemeComboBox, ProfileHelper.GetEnumProfileSaveFunc<ElementTheme>(), ProfileHelper.GetEnumProfileLoadFuncForComboBox());
ViewModel.SettingService.Initialize();
ViewModel.SettingService.RegisterEvents();
}
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
ViewModel.Dispose();
base.OnNavigatedFrom(e);
}
}
using HaloPixelToolBox.Backend.ViewModels;
using Microsoft.UI.Xaml.Navigation;
using XFEExtension.NetCore.WinUIHelper.Utilities.Helper;
namespace HaloPixelToolBox.Backend.Views;
/// <summary>
/// 锟斤拷锟斤拷页锟斤拷
/// </summary>
public sealed partial class SettingPage : Page
{
public static SettingPage? Current { get; set; }
public SettingPageViewModel ViewModel { get; set; } = new();
public SettingPage()
{
Current = this;
this.InitializeComponent();
ViewModel.DialogService.RegisterDialog(cleanCacheContentDialog);
ViewModel.SettingService.AddComboBox(appThemeComboBox, ProfileHelper.GetEnumProfileSaveFunc<ElementTheme>(), ProfileHelper.GetEnumProfileLoadFuncForComboBox());
ViewModel.SettingService.Initialize();
ViewModel.SettingService.RegisterEvents();
}
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
ViewModel.Dispose();
base.OnNavigatedFrom(e);
}
}