Push Changes from other Github

This commit is contained in:
2026-03-09 10:52:42 +01:00
parent c7306e8217
commit ff9add4081
48 changed files with 1857 additions and 1443 deletions

View File

@@ -0,0 +1,36 @@
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
namespace HMIToolkit;
public class BoolToVisibilityConverter<T> : IValueConverter
{
public BoolToVisibilityConverter(T trueValue, T falseValue)
{
True = trueValue;
False = falseValue;
}
public T True { get; set; }
public T False { get; set; }
public virtual object? Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value is bool && ((bool)value) ? True : False;
}
public virtual object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return DependencyProperty.UnsetValue;
}
}
public sealed class BoolToVisibilityConverter : BoolToVisibilityConverter<Visibility>
{
public BoolToVisibilityConverter() :
base(Visibility.Visible, Visibility.Hidden)
{ }
}