summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/FileImageSourceConverter.cs
blob: 25a0e22e6cc9d5deaff6890601439c3880065378 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)));
		}
	}
}