string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
url = url.Replace("*Resource*", resource);
}
+ imageView._resourceUrl = url;
imageView.UpdateImage(ImageVisualProperty.URL, new PropertyValue(url));
},
defaultValueCreator: (bindable) =>
[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty BorderProperty = BindableProperty.Create("Border", typeof(Rectangle), typeof(ImageView), null, propertyChanged: (bindable, oldValue, newValue) =>
{
- var imageView = (ImageView)bindable;
- imageView._border = (Rectangle)newValue;
- imageView.UpdateImage(NpatchImageVisualProperty.Border, new PropertyValue(imageView._border));
+ if(newValue != null)
+ {
+ var imageView = (ImageView)bindable;
+ imageView._border = (Rectangle)newValue;
+ imageView.UpdateImage(NpatchImageVisualProperty.Border, new PropertyValue(imageView._border));
+ }
},
defaultValueCreator: (bindable) =>
{
private _resourceLoadedCallbackType _resourceLoadedCallback;
private Rectangle _border;
+ private string _resourceUrl = "";
/// <summary>
/// Creates an initialized ImageView.
SetProperty(ImageView.Property.IMAGE, new PropertyValue(imageMap));
}
-
+
private void UpdateImage(int key, PropertyValue value)
{
PropertyMap temp = new PropertyMap();
+ if (_resourceUrl == "")
+ {
+ temp.Insert(ImageVisualProperty.URL, new PropertyValue(_resourceUrl));
+ SetProperty(ImageView.Property.IMAGE, new PropertyValue(temp));
+ return;
+ }
+
if (_border == null)
{
temp.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
- temp.Insert(NpatchImageVisualProperty.BorderOnly, new PropertyValue(false));
- temp.Insert(NpatchImageVisualProperty.Border, new PropertyValue(new Rectangle(0, 0, 0, 0)));
}
else
{
temp.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
+ temp.Insert(NpatchImageVisualProperty.Border, new PropertyValue(_border));
}
-
+
if (value != null)
{
temp.Insert(key, value);
temp = null;
}
+
private void OnResourceLoaded(IntPtr view)
{
ResourceLoadedEventArgs e = new ResourceLoadedEventArgs();