maui-linux/Xamarin.Forms.Platform.UAP/ImageSourceIconElementConve...

23 строки
597 B
C#

using System;
using Windows.UI.Xaml.Controls;
namespace Xamarin.Forms.Platform.UWP
{
internal class ImageSourceIconElementConverter : Windows.UI.Xaml.Data.IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
// TODO: investigate whether we can use AsyncValye<T> instead of blocking
if (value is ImageSource source)
return source.ToWindowsIconElement();
return null;
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}