maui-linux/Xamarin.Forms.Core/FileImageSourceConverter.cs

15 строки
386 B
C#

using System;
namespace Xamarin.Forms
{
public sealed class FileImageSourceConverter : TypeConverter
{
public override object ConvertFromInvariantString(string value)
{
if (value != null)
return (FileImageSource)ImageSource.FromFile(value);
throw new InvalidOperationException(string.Format("Cannot convert \"{0}\" into {1}", value, typeof(FileImageSource)));
}
}
}