From bc2b460db25c1bffb35705de1217b8e7506f1e0a Mon Sep 17 00:00:00 2001 From: "DESKTOP-3BO4HSG\\ksat" Date: Wed, 28 Dec 2022 13:37:20 +0800 Subject: [PATCH] tmp --- STranslate/MainWindow.xaml | 2 +- STranslate/MainWindow.xaml.cs | 12 ------------ STranslate/ViewModel/MainVM.cs | 7 +++++-- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/STranslate/MainWindow.xaml b/STranslate/MainWindow.xaml index ec1e986..5bbed25 100644 --- a/STranslate/MainWindow.xaml +++ b/STranslate/MainWindow.xaml @@ -62,7 +62,7 @@ HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,100,0" - Click="Button_Click"/> + Command="{Binding ThemeConvertCmd}"/> true, (_) => { - + Application.Current.Resources.MergedDictionaries[0].Source = + Application.Current.Resources.MergedDictionaries[0].Source + .ToString() == _ThemeDark ? new Uri(_ThemeDefault) : new Uri(_ThemeDark); }); //翻译 @@ -261,7 +263,8 @@ namespace STranslate.ViewModel private TranslationInterface _SelectedTranslationInterface; public TranslationInterface SelectedTranslationInterface { get => _SelectedTranslationInterface; set => UpdateProperty(ref _SelectedTranslationInterface, value); } private static Dictionary LanguageEnumDict { get => Util.Util.GetEnumList(); } - + private static readonly string _ThemeDark = "pack://application:,,,/STranslate;component/Style/Dark.xaml"; + private static readonly string _ThemeDefault = "pack://application:,,,/STranslate;component/Style/Default.xaml"; #endregion Params } } \ No newline at end of file