using System.Windows.Data;
using WPFluent.Controls;
namespace WPFluent.Converters;
///
/// Converts an to an .
///
internal class IconSourceElementConverter : IValueConverter
{
///
/// Converts a value to an .
///
/// The value to convert.
/// The type of the binding target property.
/// The converter parameter.
/// The culture to use in the converter.
/// The converted .
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{
if (value is IconSourceElement iconSourceElement)
{
return iconSourceElement.CreateIconElement();
}
return value;
}
///
/// Converts an back to an IconSourceElement.
///
/// The value to convert.
/// The type of the binding target property.
/// The converter parameter.
/// The culture to use in the converter.
/// The converted IconSourceElement.
public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{ throw new NotImplementedException(); }
}