1 using System.Threading.Tasks;
3 namespace Tizen.NUI.Binding
5 [TypeConverter(typeof(FileImageSourceConverter))]
6 internal sealed class FileImageSource : ImageSource
8 public static readonly BindableProperty FileProperty = BindableProperty.Create("File", typeof(string), typeof(FileImageSource), default(string));
12 get { return (string)GetValue(FileProperty); }
13 set { SetValue(FileProperty, value); }
16 public override Task<bool> Cancel()
18 return Task.FromResult(false);
21 public override string ToString()
23 return $"File: {File}";
26 public static implicit operator FileImageSource(string file)
28 return (FileImageSource)FromFile(file);
31 public static implicit operator string(FileImageSource file)
33 return file != null ? file.File : null;
36 protected override void OnPropertyChanged(string propertyName = null)
38 if (propertyName == FileProperty.PropertyName)
40 base.OnPropertyChanged(propertyName);