v2rayN/v2rayN/v2rayN.Desktop/Views/ThemeSettingView.axaml.cs

27 lines
1,009 B
C#
Raw Normal View History

using v2rayN.Desktop.ViewModels;
namespace v2rayN.Desktop.Views;
/// <summary>
/// ThemeSettingView.xaml
/// </summary>
public partial class ThemeSettingView : ReactiveUserControl<ThemeSettingViewModel>
{
public ThemeSettingView()
{
InitializeComponent();
ViewModel = new ThemeSettingViewModel();
2025-07-20 06:16:19 +00:00
cmbCurrentTheme.ItemsSource = Utils.GetEnumNames<ETheme>();
cmbCurrentFontSize.ItemsSource = Enumerable.Range(Global.MinFontSize, Global.MinFontSizeCount).ToList();
2025-07-20 06:16:19 +00:00
cmbCurrentLanguage.ItemsSource = Global.Languages;
this.WhenActivated(disposables =>
{
this.Bind(ViewModel, vm => vm.CurrentTheme, v => v.cmbCurrentTheme.SelectedValue).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.CurrentFontSize, v => v.cmbCurrentFontSize.SelectedValue).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.CurrentLanguage, v => v.cmbCurrentLanguage.SelectedValue).DisposeWith(disposables);
});
}
2025-01-30 09:10:05 +00:00
}