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,35 @@
using System.Reactive.Disposables;
using System.Windows;
using System.Windows.Controls;
using Intromat.Interfaces;
using Intromat.ViewModels.Editors;
using ReactiveUI;
namespace Intromat.Views.Editors
{
[TemplatePart(Name = nameof(_checkBoxValue), Type = typeof(CheckBox))]
[TemplatePart(Name = nameof(_textBlockValue), Type = typeof(TextBlock))]
public class BooleanValueEditorView : EditorViewBase<BooleanValueEditorViewModel>
{
private CheckBox _checkBoxValue = null!;
private TextBlock _textBlockValue = null!;
public BooleanValueEditorView()
{
DefaultStyleKey = typeof(BooleanValueEditorView);
this.WhenActivated(d =>
{
this.OneWayBind(ViewModel, vm => vm.Value, v => v._textBlockValue.Text, b => b.ToString()).DisposeWith(d);
this.Bind(ViewModel, vm => vm.Value, v => v._checkBoxValue.IsChecked).DisposeWith(d);
});
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
_checkBoxValue = (CheckBox)GetTemplateChild(nameof(_checkBoxValue))!;
_textBlockValue = (TextBlock)GetTemplateChild(nameof(_textBlockValue))!;
}
}
}