mirror of
https://github.com/2dust/v2rayN.git
synced 2026-09-22 22:38:10 +03:00
30 lines
1.2 KiB
C#
30 lines
1.2 KiB
C#
using Avalonia.Data;
|
|
using v2rayN.Desktop.ViewModels;
|
|
|
|
namespace v2rayN.Desktop.Views;
|
|
|
|
/// <summary>
|
|
/// ThemeSettingView.xaml
|
|
/// </summary>
|
|
public partial class ThemeSettingView : ReactiveUserControl<ThemeSettingViewModel>
|
|
{
|
|
public ThemeSettingView()
|
|
{
|
|
InitializeComponent();
|
|
ViewModel = new ThemeSettingViewModel();
|
|
|
|
cmbCurrentTheme.ItemsSource = Utils.GetEnumNames<ETheme>();
|
|
cmbCurrentFontSize.ItemsSource = Enumerable.Range(Global.MinFontSize, Global.MinFontSizeCount).ToList();
|
|
cmbCurrentLanguage.ItemsSource = Global.LanguageOptions;
|
|
cmbCurrentLanguage.DisplayMemberBinding = new Binding(nameof(LanguageOption.Display));
|
|
cmbCurrentLanguage.SelectedValueBinding = new Binding(nameof(LanguageOption.Value));
|
|
|
|
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);
|
|
});
|
|
}
|
|
}
|