This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
using System;
using System.Windows.Data;
using System.Windows.Media;
namespace DTS.Common.Converters
{
public class ColorToSolidColorBrushConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
// For a more sophisticated converter, check also the targetType and react accordingly..
if (value is Color color)
{
return new SolidColorBrush(color);
}
return null;
// You can support here more source types if you wish
// For the example I throw an exception
//var type = value.GetType();
//throw new InvalidOperationException("Unsupported type [" + type.Name + "]");
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
// If necessary, here you can convert back. Check if which brush it is (if its one),
// get its Color-value and return it.
throw new NotImplementedException();
}
}
}