using System;
using Windows.UI.Xaml.Data;
namespace OwlCore.WinUI.Converters
{
///
/// A converter that provides a workaround for DataTriggerBehavior not working with enums.
///
///
/// From StackOverflow: "Apparently it doesn’t account for enum types and falls back to some logic which recreates the xaml string for the enum. Parses it as ContentControl and passes back its content. Unfortunately during this step it loses the enum type information and subsequent type casting is not valid."
///
public sealed class DataTriggerBehaviorEnumConverter : IValueConverter
{
///
public object Convert(object value, Type targetType, object parameter, string language)
{
return value.ToString();
}
///
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}