using XFEEDToolBox.ViewModels; namespace XFEEDToolBox.Views; public sealed partial class SettingPage : Page { public ToolboxViewModel ViewModel => App.ViewModel; public string AppVersion => typeof(App).Assembly.GetName().Version?.ToString(3) ?? ""; public static readonly DependencyProperty EditorWidthProperty = DependencyProperty.Register( nameof(EditorWidth), typeof(double), typeof(SettingPage), new PropertyMetadata(420d)); public double EditorWidth { get => (double)GetValue(EditorWidthProperty); set => SetValue(EditorWidthProperty, value); } public SettingPage() { InitializeComponent(); NavigationCacheMode = Microsoft.UI.Xaml.Navigation.NavigationCacheMode.Required; } private async void OnSettingsLoaded(object sender,RoutedEventArgs args) {if(ViewModel.RefreshMarketCacheUsageCommand.CanExecute(null))await ViewModel.RefreshMarketCacheUsageCommand.ExecuteAsync(null);} private void OnPageSizeChanged(object sender, SizeChangedEventArgs args) { EditorWidth = Math.Clamp(args.NewSize.Width - 144, 120, 420); VisualStateManager.GoToState(this, args.NewSize.Width < 760 ? "Compact" : "Wide", false); } }