Push Changes from Techcrafters Repo

This commit is contained in:
2026-03-05 14:37:43 +01:00
parent d2665d17fa
commit 9636ff0457
215 changed files with 5052 additions and 14150 deletions

View File

@@ -3,23 +3,22 @@ using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
namespace HMIToolkit
namespace HMIToolkit;
public class BoolToBrushConverter : IValueConverter
{
public class BoolToBrushConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (targetType != typeof(Brush))
throw new InvalidOperationException("The target must be a brush");
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (targetType != typeof(Brush))
throw new InvalidOperationException("The target must be a brush");
bool temp = bool.Parse(value.ToString()!);
bool temp = bool.Parse(value.ToString()!);
return (temp ? Brushes.DarkGreen : Brushes.DarkRed);
}
return (temp ? Brushes.DarkGreen : Brushes.DarkRed);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return DependencyProperty.UnsetValue;
}
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return DependencyProperty.UnsetValue;
}
}