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