/// <summary> /// When overriden in a derived class, converts XAML extension syntax into instances of various <see cref="N:Xamarin.Forms" /> types. /// </summary> public override object ConvertFromInvariantString(string file) { if (file != null) { return((FileVideoSource)VideoSource.FromFile(file)); } throw new InvalidOperationException($"Cannot convert file into {typeof(FileVideoSource)}"); }
public override object ConvertFromInvariantString(string value) { if (value == null) { return(null); } Uri result; if (!Uri.TryCreate(value, UriKind.Absolute, out result) || result.Scheme == "file") { return(VideoSource.FromFile(value)); } return(VideoSource.FromUri(result)); }