port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
using System;
using System.Reactive.Disposables;
using System.Windows;
using System.Windows.Controls;
using Intromat.ViewModels.Editors;
using ReactiveUI;
namespace Intromat.Views.Editors
{
[TemplatePart(Name = nameof(_comboBoxValue), Type = typeof(ComboBox))]
public class EnumEditorView : EditorViewBase<EnumEditorViewModel>
{
private ComboBox _comboBoxValue = null!;
public EnumEditorView()
{
DefaultStyleKey = typeof(EnumEditorView);
this.WhenActivated(d =>
{
foreach (var name in Enum.GetNames(ViewModel!.EnumType))
_comboBoxValue.Items.Add(name);
this.OneWayBind(ViewModel, vm => vm.Value, v => v._comboBoxValue.SelectedIndex).DisposeWith(d);
});
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
_comboBoxValue = (ComboBox)GetTemplateChild(nameof(_comboBoxValue))!;
}
}
}