diff --git a/UotanToolbox/Features/Home/HomeViewModel.cs b/UotanToolbox/Features/Home/HomeViewModel.cs index ffd83cda..86c98f82 100644 --- a/UotanToolbox/Features/Home/HomeViewModel.cs +++ b/UotanToolbox/Features/Home/HomeViewModel.cs @@ -75,8 +75,6 @@ await Dispatcher.UIThread.InvokeAsync(async () => Process.GetCurrentProcess().Kill(); }); } - Global.BinVersion = await StringHelper.GetBinVersion(); - } public async Task GetDevicesList() diff --git a/UotanToolbox/Features/Settings/SettingsView.axaml b/UotanToolbox/Features/Settings/SettingsView.axaml index 06acd325..d86fff41 100644 --- a/UotanToolbox/Features/Settings/SettingsView.axaml +++ b/UotanToolbox/Features/Settings/SettingsView.axaml @@ -9,7 +9,7 @@ xmlns:settings="clr-namespace:UotanToolbox.Features.Settings" xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI" xmlns:assets="clr-namespace:UotanToolbox.Assets;assembly=UotanToolbox" - d:DesignHeight="1950" + d:DesignHeight="2950" d:DesignWidth="1024" x:DataType="settings:SettingsViewModel" mc:Ignorable="d"> @@ -268,7 +268,7 @@ QCNTool (from Github repo https://github.com/MindowsToolBox/QCNTool) QMSL_MSVC10R.dll (from QPST) Suki UI (modified from Github repo https://github.com/kikipoulet/SukiUI) - BinVersion: + diff --git a/UotanToolbox/Features/Settings/SettingsViewModel.cs b/UotanToolbox/Features/Settings/SettingsViewModel.cs index 12d2b321..5604b44b 100644 --- a/UotanToolbox/Features/Settings/SettingsViewModel.cs +++ b/UotanToolbox/Features/Settings/SettingsViewModel.cs @@ -1,5 +1,6 @@ using Avalonia.Collections; using Avalonia.Styling; +using Avalonia.Threading; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using Material.Icons; @@ -35,12 +36,14 @@ public partial class SettingsViewModel : MainPageBase [ObservableProperty] private bool _backgroundAnimations; [ObservableProperty] private bool _backgroundTransitions; [ObservableProperty] private string _currentVersion = Global.currentVersion; + [ObservableProperty] private string _binVersion = null; private string _customShader = null; private static string GetTranslation(string key) => FeaturesHelper.GetTranslation(key); public SettingsViewModel() : base(GetTranslation("Sidebar_Settings"), MaterialIconKind.SettingsOutline, -200) { + _ = CheckBinVersion(); AvailableBackgroundStyles = new AvaloniaList(Enum.GetValues()); AvailableColors = _theme.ColorThemes; IsLightTheme = _theme.ActiveBaseTheme == ThemeVariant.Light; @@ -52,6 +55,11 @@ public SettingsViewModel() : base(GetTranslation("Sidebar_Settings"), MaterialIc }; } + public async Task CheckBinVersion() + { + BinVersion = await StringHelper.GetBinVersion(); + } + partial void OnIsLightThemeChanged(bool value) => _theme.ChangeBaseTheme(value ? ThemeVariant.Light : ThemeVariant.Dark);