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,44 @@
using System;
using System.Linq;
using System.Reactive.Disposables;
using System.Windows;
using System.Windows.Controls;
using Intromat.Interfaces;
using Intromat.ViewModels.Editors;
using ReactiveUI;
using SharpDX.Direct3D11;
namespace Intromat.Views.Editors
{
[TemplatePart(Name = nameof(_comboBoxFilter), Type = typeof(ComboBox))]
[TemplatePart(Name = nameof(_comboBoxAddress), Type = typeof(ComboBox))]
public class SamplerEditorView : EditorViewBase<SamplerEditorViewModel>
{
private ComboBox _comboBoxFilter = null!;
private ComboBox _comboBoxAddress = null!;
public SamplerEditorView()
{
DefaultStyleKey = typeof(SamplerEditorView);
this.WhenActivated(d =>
{
var addressNames = Enum.GetValues(typeof(TextureAddressMode)).Cast<TextureAddressMode>().ToArray();
_comboBoxAddress.ItemsSource = addressNames;
var filterNames = Enum.GetValues(typeof(Filter)).Cast<Filter>();
_comboBoxFilter.ItemsSource = filterNames;
this.Bind(ViewModel, vm => vm.Address, v => v._comboBoxAddress.SelectedItem).DisposeWith(d);
this.Bind(ViewModel, vm => vm.Filter, v => v._comboBoxFilter.SelectedItem).DisposeWith(d);
});
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
_comboBoxFilter = (ComboBox)GetTemplateChild(nameof(_comboBoxFilter))!;
_comboBoxAddress = (ComboBox)GetTemplateChild(nameof(_comboBoxAddress))!;
}
}
}