Sicherung

This commit is contained in:
Maier Stephan SI
2023-04-17 07:07:49 +02:00
parent f3f89b94f5
commit 1c68b8f401
1307 changed files with 7918 additions and 82491 deletions

View File

@@ -0,0 +1,59 @@
using System;
using System.Globalization;
using System.Windows.Controls;
using System.Windows.Data;
namespace DJ.Helper.ListViewLayoutManager
{
public abstract class ConverterGridViewColumn : GridViewColumn, IValueConverter
{
public Type BindingType => _BindingType;
private readonly Type _BindingType;
// ##############################################################################################################################
// Constructor
// ##############################################################################################################################
#region Constructor
protected ConverterGridViewColumn(Type bindingType)
{
if (bindingType == null)
{
throw new ArgumentNullException(nameof(bindingType));
}
this._BindingType = bindingType;
Binding binding = new Binding {Mode = BindingMode.OneWay, Converter = this};
DisplayMemberBinding = binding;
}
#endregion
// ##############################################################################################################################
// IValueConverter
// ##############################################################################################################################
#region IValueConverter
object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (!_BindingType.IsInstanceOfType(value))
{
throw new InvalidOperationException();
}
return ConvertValue(value);
}
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
protected abstract object ConvertValue(object value);
#endregion
}
}