dev_deconstruction
DESKTOP-3BO4HSG\ksat 2 years ago
parent 4757fd5b68
commit bc2b460db2

@ -62,7 +62,7 @@
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
Margin="0,0,100,0" Margin="0,0,100,0"
Click="Button_Click"/> Command="{Binding ThemeConvertCmd}"/>
<ComboBox Style="{DynamicResource cmbstyle}" <ComboBox Style="{DynamicResource cmbstyle}"
Margin="0,5,10,0" Margin="0,5,10,0"
ItemsSource="{Binding TranslationInterface}" ItemsSource="{Binding TranslationInterface}"

@ -282,17 +282,5 @@ namespace STranslate
private static readonly BitmapImage _Topmost = new BitmapImage(new Uri("pack://application:,,,/STranslate;component/Images/Button_Default/topmost.png")); private static readonly BitmapImage _Topmost = new BitmapImage(new Uri("pack://application:,,,/STranslate;component/Images/Button_Default/topmost.png"));
private static readonly BitmapImage _UnTopmost = new BitmapImage(new Uri("pack://application:,,,/STranslate;component/Images/Button_Default/untopmost.png")); private static readonly BitmapImage _UnTopmost = new BitmapImage(new Uri("pack://application:,,,/STranslate;component/Images/Button_Default/untopmost.png"));
private System.Windows.Forms.NotifyIcon notifyIcon = new System.Windows.Forms.NotifyIcon(); private System.Windows.Forms.NotifyIcon notifyIcon = new System.Windows.Forms.NotifyIcon();
private void Button_Click(object sender, RoutedEventArgs e)
{
if (Application.Current.Resources.MergedDictionaries[0].Source.ToString() == "pack://application:,,,/STranslate;component/Style/Dark.xaml")
{
Application.Current.Resources.MergedDictionaries[0].Source = new Uri("pack://application:,,,/STranslate;component/Style/Default.xaml");
}
else
{
Application.Current.Resources.MergedDictionaries[0].Source = new Uri("pack://application:,,,/STranslate;component/Style/Dark.xaml");
}
}
} }
} }

@ -50,7 +50,9 @@ namespace STranslate.ViewModel
}); });
ThemeConvertCmd = new RelayCommand((_) => true, (_) => ThemeConvertCmd = new RelayCommand((_) => 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; private TranslationInterface _SelectedTranslationInterface;
public TranslationInterface SelectedTranslationInterface { get => _SelectedTranslationInterface; set => UpdateProperty(ref _SelectedTranslationInterface, value); } public TranslationInterface SelectedTranslationInterface { get => _SelectedTranslationInterface; set => UpdateProperty(ref _SelectedTranslationInterface, value); }
private static Dictionary<string, LanguageEnum> LanguageEnumDict { get => Util.Util.GetEnumList<LanguageEnum>(); } private static Dictionary<string, LanguageEnum> LanguageEnumDict { get => Util.Util.GetEnumList<LanguageEnum>(); }
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 #endregion Params
} }
} }
Loading…
Cancel
Save