|
#nullable disable
using System;
using System.Collections.Generic;
using System.Text;
namespace Microsoft.Maui.Controls.Platform
{
public partial class IconConverter : Microsoft.UI.Xaml.Data.IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
if (value is not ImageSource source)
return null;
var context = source.FindMauiContext(true);
return source.ToIconSource(context).CreateIconElement();
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotSupportedException();
}
}
}
|