laatzen/Common/Ui/Common.GUI/ViewModels/Eregister/EregisterFeatureItemVM.cs
2025-01-24 12:10:40 +01:00

86 lines
2.7 KiB
C#

namespace Common.GUI.ViewModels.Eregister
{
using Common.GUI.ViewModels.Base;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Reflection;
public class EregisterFeatureItemVM : VM<EregisterFeatureItemVM>
{
public string Header { get; set; }
public ObservableCollection<EregisterFeatureItemVM> ItemsSource { get; }
= new ObservableCollection<EregisterFeatureItemVM>();
}
public class EregisterFeatureParameterItemVM : EregisterFeatureItemVM
{
private readonly PropertyInfo propertyInfo;
public EregisterFeatureParameterItemVM(PropertyInfo propertyInfo, string header)
{
this.Header = header;
this.propertyInfo = propertyInfo;
}
private object value;
public object Value
{
get => this.value;
set => this.SetValue(() => this.value = value);
}
}
public class EregisterFeatureBooleanValueVM : EregisterFeatureParameterItemVM
{
public EregisterFeatureBooleanValueVM(PropertyInfo propertyInfo, string header) : base(propertyInfo, header)
{
}
}
public class EregisterFeatureByteValueVM : EregisterFeatureParameterItemVM
{
public EregisterFeatureByteValueVM(PropertyInfo propertyInfo, string header) : base(propertyInfo, header)
{
}
}
public class EregisterFeatureInt32ValueVM : EregisterFeatureParameterItemVM
{
public EregisterFeatureInt32ValueVM(PropertyInfo propertyInfo, string header) : base(propertyInfo, header)
{
}
}
public class EregisterFeatureUInt16ValueVM : EregisterFeatureParameterItemVM
{
public EregisterFeatureUInt16ValueVM(PropertyInfo propertyInfo, string header) : base(propertyInfo, header)
{
}
}
public class EregisterFeatureUInt32ValueVM : EregisterFeatureParameterItemVM
{
public EregisterFeatureUInt32ValueVM(PropertyInfo propertyInfo, string header) : base(propertyInfo, header)
{
}
}
public class EregisterFeatureStringValueVM : EregisterFeatureParameterItemVM
{
public EregisterFeatureStringValueVM(PropertyInfo propertyInfo, string header) : base(propertyInfo, header)
{
}
}
public class EregisterFeatureOptionValueVM : EregisterFeatureParameterItemVM
{
public EregisterFeatureOptionValueVM(PropertyInfo propertyInfo, string header)
: base(propertyInfo, header)
=> this.Options = Enum.GetNames(propertyInfo.PropertyType);
public ICollection<string> Options { get; set; }
}
}