/// An instance of ImageView can be created using a URL or an image instance.<br />
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public partial class ImageView : View
+ public class ImageView : View
{
static ImageView() { }
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ResourceUrlProperty = BindableProperty.Create(nameof(ImageView.ResourceUrl), typeof(string), typeof(ImageView), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageView = (ImageView)bindable;
+
+ if (newValue is Selector<string> selector)
+ {
+ imageView.ResourceUrlSelector = selector;
+ }
+ else
+ {
+ imageView.resourceUrlSelector?.Reset(imageView);
+ imageView.SetResourceUrl((string)newValue);
+ }
+ },
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+ {
+ var imageView = (ImageView)bindable;
+ string ret = "";
+
+ PropertyMap imageMap = new PropertyMap();
+ Tizen.NUI.Object.GetProperty((HandleRef)imageView.SwigCPtr, ImageView.Property.IMAGE).Get(imageMap);
+ imageMap.Find(ImageVisualProperty.URL)?.Get(out ret);
+ return ret;
+ }));
+
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ImageProperty = BindableProperty.Create(nameof(ImageView.Image), typeof(PropertyMap), typeof(ImageView), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+ {
+ var imageView = (ImageView)bindable;
+ if (newValue != null)
+ {
+ PropertyMap map = (PropertyMap)newValue;
+ if (imageView.IsCreateByXaml)
+ {
+ string url = "", alphaMaskURL = "", auxiliaryImageURL = "";
+ string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
+ PropertyValue urlValue = map.Find(NDalic.ImageVisualUrl);
+ bool ret = false;
+ if (urlValue != null) ret = urlValue.Get(out url);
+ PropertyMap mmap = new PropertyMap();
+ if (ret && url.StartsWith("*Resource*"))
+ {
+ url = url.Replace("*Resource*", resource);
+ mmap.Insert(NDalic.ImageVisualUrl, new PropertyValue(url));
+ }
+
+ ret = false;
+ PropertyValue alphaMaskUrlValue = map.Find(NDalic.ImageVisualAlphaMaskUrl);
+ if (alphaMaskUrlValue != null) ret = alphaMaskUrlValue.Get(out alphaMaskURL);
+ if (ret && alphaMaskURL.StartsWith("*Resource*"))
+ {
+ alphaMaskURL = alphaMaskURL.Replace("*Resource*", resource);
+ mmap.Insert(NDalic.ImageVisualUrl, new PropertyValue(alphaMaskURL));
+ }
+
+ ret = false;
+ PropertyValue auxiliaryImageURLValue = map.Find(NDalic.ImageVisualAuxiliaryImageUrl);
+ if (auxiliaryImageURLValue != null) ret = auxiliaryImageURLValue.Get(out auxiliaryImageURL);
+ if (ret && auxiliaryImageURL.StartsWith("*Resource*"))
+ {
+ auxiliaryImageURL = auxiliaryImageURL.Replace("*Resource*", resource);
+ mmap.Insert(NDalic.ImageVisualAuxiliaryImageUrl, new PropertyValue(auxiliaryImageURL));
+ }
+
+ map.Merge(mmap);
+ }
+ if (imageView._border == null)
+ {
+ Tizen.NUI.Object.SetProperty((HandleRef)imageView.SwigCPtr, ImageView.Property.IMAGE, new Tizen.NUI.PropertyValue(map));
+ }
+ }
+ }),
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+ {
+ var imageView = (ImageView)bindable;
+ if (imageView._border == null)
+ {
+ PropertyMap temp = new PropertyMap();
+ Tizen.NUI.Object.GetProperty((HandleRef)imageView.SwigCPtr, ImageView.Property.IMAGE).Get(temp);
+ return temp;
+ }
+ else
+ {
+ return null;
+ }
+ }));
+
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PreMultipliedAlphaProperty = BindableProperty.Create(nameof(PreMultipliedAlpha), typeof(bool), typeof(ImageView), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+ {
+ var imageView = (ImageView)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty((HandleRef)imageView.SwigCPtr, ImageView.Property.PreMultipliedAlpha, new Tizen.NUI.PropertyValue((bool)newValue));
+ }
+ }),
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+ {
+ var imageView = (ImageView)bindable;
+ bool temp = false;
+ Tizen.NUI.Object.GetProperty((HandleRef)imageView.SwigCPtr, ImageView.Property.PreMultipliedAlpha).Get(out temp);
+ return temp;
+ }));
+
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty PixelAreaProperty = BindableProperty.Create(nameof(PixelArea), typeof(RelativeVector4), typeof(ImageView), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
+ {
+ var imageView = (ImageView)bindable;
+ if (newValue != null)
+ {
+ Tizen.NUI.Object.SetProperty((HandleRef)imageView.SwigCPtr, ImageView.Property.PixelArea, new Tizen.NUI.PropertyValue((RelativeVector4)newValue));
+ }
+ }),
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+ {
+ var imageView = (ImageView)bindable;
+ Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
+ Tizen.NUI.Object.GetProperty((HandleRef)imageView.SwigCPtr, ImageView.Property.PixelArea).Get(temp);
+ RelativeVector4 relativeTemp = new RelativeVector4(temp.X, temp.Y, temp.Z, temp.W);
+ return relativeTemp;
+ }));
+
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BorderProperty = BindableProperty.Create(nameof(Border), typeof(Rectangle), typeof(ImageView), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageView = (ImageView)bindable;
+ imageView.borderSelector?.Reset(imageView);
+
+ if (newValue is Selector<Rectangle> selector)
+ {
+ if (selector.HasAll()) imageView.SetBorder(selector.All);
+ else imageView.borderSelector = new TriggerableSelector<Rectangle>(imageView, selector, imageView.SetBorder, true);
+ }
+ else
+ {
+ imageView.SetBorder((Rectangle)newValue);
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageView = (ImageView)bindable;
+ return imageView._border;
+ });
+
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BorderOnlyProperty = BindableProperty.Create(nameof(BorderOnly), typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageView = (ImageView)bindable;
+ if (newValue != null)
+ {
+ imageView.UpdateImage(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)newValue));
+ }
+ },
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+ {
+ var imageView = (ImageView)bindable;
+ bool ret = false;
+ PropertyMap imageMap = new PropertyMap();
+ Tizen.NUI.Object.GetProperty((HandleRef)imageView.SwigCPtr, ImageView.Property.IMAGE).Get(imageMap);
+ imageMap.Find(ImageVisualProperty.BorderOnly)?.Get(out ret);
+ return ret;
+ }));
+
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SynchronosLoadingProperty = BindableProperty.Create(nameof(SynchronousLoading), typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageView = (ImageView)bindable;
+ if (newValue != null)
+ {
+ imageView._synchronousLoading = (bool)newValue;
+ imageView.UpdateImage(NpatchImageVisualProperty.SynchronousLoading, new PropertyValue((bool)newValue));
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageView = (ImageView)bindable;
+ return imageView._synchronousLoading;
+ });
+
+ /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty SynchronousLoadingProperty = BindableProperty.Create(nameof(SynchronousLoading), typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageView = (ImageView)bindable;
+ if (newValue != null)
+ {
+ imageView._synchronousLoading = (bool)newValue;
+ imageView.UpdateImage(NpatchImageVisualProperty.SynchronousLoading, new PropertyValue((bool)newValue));
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageView = (ImageView)bindable;
+ return imageView._synchronousLoading;
+ });
+
+ /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty OrientationCorrectionProperty = BindableProperty.Create(nameof(OrientationCorrection), typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageView = (ImageView)bindable;
+ if (newValue != null)
+ {
+ imageView.UpdateImage(ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)newValue));
+ }
+ },
+ defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
+ {
+ var imageView = (ImageView)bindable;
+
+ bool ret = false;
+ PropertyMap imageMap = new PropertyMap();
+ Tizen.NUI.Object.GetProperty((HandleRef)imageView.SwigCPtr, ImageView.Property.IMAGE).Get(imageMap);
+ imageMap?.Find(ImageVisualProperty.OrientationCorrection)?.Get(out ret);
+
+ return ret;
+ }));
+
private EventHandler<ResourceReadyEventArgs> _resourceReadyEventHandler;
private ResourceReadyEventCallbackType _resourceReadyEventCallback;
private EventHandler<ResourceLoadedEventArgs> _resourceLoadedEventHandler;
private _resourceLoadedCallbackType _resourceLoadedCallback;
- // Collection of image-sensitive properties.
- private bool _imagePropertyUpdatedFlag = false;
- private bool _imagePropertyUpdateProcessAttachedFlag = false;
- private PropertyMap _imagePropertyMap;
private Rectangle _border;
private string _resourceUrl = "";
+ private bool _synchronousLoading = false;
+ private string _alphaMaskUrl = null;
private int _desired_width = -1;
private int _desired_height = -1;
+ private VisualFittingModeType _fittingMode = VisualFittingModeType.Fill;
private TriggerableSelector<string> resourceUrlSelector;
private TriggerableSelector<Rectangle> borderSelector;
{
get
{
- return GetValue(ImageMapProperty) as PropertyMap;
- }
- set
- {
- SetValue(ImageMapProperty, value);
- NotifyPropertyChanged();
- }
- }
- private PropertyMap InternalImageMap
- {
- get
- {
if (_border == null)
{
- // Sync as current properties.
- UpdateImage();
-
- return _imagePropertyMap == null ? new PropertyMap() : new PropertyMap(_imagePropertyMap);
+ PropertyMap returnValue = new PropertyMap();
+ PropertyValue image = GetProperty(ImageView.Property.IMAGE);
+ image?.Get(returnValue);
+ image?.Dispose();
+ return returnValue;
}
else
{
{
PropertyValue setValue = new Tizen.NUI.PropertyValue(value);
SetProperty(ImageView.Property.IMAGE, setValue);
- // Image properties are changed hardly. We should ignore lazy UpdateImage
- _imagePropertyUpdatedFlag = false;
- _imagePropertyMap?.Dispose();
- _imagePropertyMap = null;
- if(value != null)
- {
- _imagePropertyMap = new PropertyMap(value);
- }
NotifyPropertyChanged();
setValue?.Dispose();
}
{
get
{
- return GetValue(AlphaMaskURLProperty) as string;
- }
- set
- {
- SetValue(AlphaMaskURLProperty, value);
- NotifyPropertyChanged();
- }
- }
- private string InternalAlphaMaskURL
- {
- get
- {
string ret = "";
-
- PropertyValue maskUrl = _imagePropertyMap?.Find(ImageVisualProperty.AlphaMaskURL);
+ PropertyMap imageMap = new PropertyMap();
+ PropertyValue image = Tizen.NUI.Object.GetProperty(SwigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue maskUrl = imageMap?.Find(ImageVisualProperty.AlphaMaskURL);
maskUrl?.Get(out ret);
+ _alphaMaskUrl = ret;
+
+ imageMap?.Dispose();
+ image?.Dispose();
maskUrl?.Dispose();
return ret;
}
set
{
- PropertyValue setValue = new PropertyValue(value ?? "");
+ if (value == null)
+ {
+ value = "";
+ }
+
+ _alphaMaskUrl = value;
+
+ PropertyValue setValue = new PropertyValue(value);
UpdateImage(ImageVisualProperty.AlphaMaskURL, setValue);
setValue?.Dispose();
}
{
get
{
- return (bool)GetValue(CropToMaskProperty);
- }
- set
- {
- SetValue(CropToMaskProperty, value);
- NotifyPropertyChanged();
- }
- }
- private bool InternalCropToMask
- {
- get
- {
bool ret = false;
+ PropertyMap imageMap = new PropertyMap();
+ PropertyValue image = Tizen.NUI.Object.GetProperty(SwigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue cropUrl = imageMap?.Find(ImageVisualProperty.CropToMask);
+ cropUrl?.Get(out ret);
- PropertyValue cropToMask = _imagePropertyMap?.Find(ImageVisualProperty.CropToMask);
- cropToMask?.Get(out ret);
- cropToMask?.Dispose();
+ imageMap?.Dispose();
+ image?.Dispose();
+ cropUrl?.Dispose();
return ret;
}
{
PropertyValue setValue = new PropertyValue(value);
UpdateImage(ImageVisualProperty.CropToMask, setValue);
- setValue?.Dispose();
+ setValue.Dispose();
}
}
{
get
{
- return (FittingModeType)GetValue(FittingModeProperty);
- }
- set
- {
- SetValue(FittingModeProperty, value);
- NotifyPropertyChanged();
- }
- }
-
- private FittingModeType InternalFittingMode
- {
- get
- {
- int ret = (int)VisualFittingModeType.Fill;
- PropertyValue fittingMode = _imagePropertyMap?.Find(Visual.Property.VisualFittingMode);
+ int ret = (int)_fittingMode;
+ PropertyMap imageMap = new PropertyMap();
+ PropertyValue image = Tizen.NUI.Object.GetProperty(SwigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue fittingMode = imageMap?.Find(Visual.Property.VisualFittingMode);
fittingMode?.Get(out ret);
+ _fittingMode = (VisualFittingModeType)ret;
+
+ imageMap?.Dispose();
+ image?.Dispose();
fittingMode?.Dispose();
return ConvertVisualFittingModetoFittingMode((VisualFittingModeType)ret);
{
VisualFittingModeType ret = ConvertFittingModetoVisualFittingMode(value);
PropertyValue setValue = new PropertyValue((int)ret);
- UpdateImage(Visual.Property.VisualFittingMode, setValue);
+ if(_fittingMode != ret)
+ {
+ _fittingMode = ret;
+ UpdateImage(Visual.Property.VisualFittingMode, setValue);
+ }
setValue?.Dispose();
}
}
{
get
{
- return (int)GetValue(DesiredWidthProperty);
- }
- set
- {
- SetValue(DesiredWidthProperty, value);
- NotifyPropertyChanged();
- }
- }
- private int InternalDesiredWidth
- {
- get
- {
- // Sync as current properties only if both _desired_width and _desired_height are setuped.
- if(_desired_width != -1 && _desired_height != -1)
- {
- UpdateImage();
- }
- PropertyValue desirewidth = _imagePropertyMap?.Find(ImageVisualProperty.DesiredWidth);
- desirewidth?.Get(out _desired_width);
- desirewidth?.Dispose();
+ PropertyMap imageMap = new PropertyMap();
+ PropertyValue image = Tizen.NUI.Object.GetProperty(SwigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue desireWidth = imageMap?.Find(ImageVisualProperty.DesiredWidth);
+ desireWidth?.Get(out _desired_width);
+
+ imageMap?.Dispose();
+ image?.Dispose();
+ desireWidth?.Dispose();
+
return _desired_width;
}
set
if (_desired_width != value)
{
_desired_width = value;
- PropertyValue setValue = new PropertyValue(value);
- UpdateImage(ImageVisualProperty.DesiredWidth, setValue);
- setValue?.Dispose();
+ UpdateImage(0, null);
}
}
}
{
get
{
- return (int)GetValue(DesiredHeightProperty);
- }
- set
- {
- SetValue(DesiredHeightProperty, value);
- NotifyPropertyChanged();
- }
- }
- private int InternalDesiredHeight
- {
- get
- {
- // Sync as current properties only if both _desired_width and _desired_height are setuped.
- if(_desired_width != -1 && _desired_height != -1)
- {
- UpdateImage();
- }
- PropertyValue desireheight = _imagePropertyMap?.Find(ImageVisualProperty.DesiredHeight);
+ PropertyMap imageMap = new PropertyMap();
+ PropertyValue image = Tizen.NUI.Object.GetProperty(SwigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue desireheight = imageMap?.Find(ImageVisualProperty.DesiredHeight);
desireheight?.Get(out _desired_height);
+
+ imageMap?.Dispose();
+ image?.Dispose();
desireheight?.Dispose();
return _desired_height;
if (_desired_height != value)
{
_desired_height = value;
- PropertyValue setValue = new PropertyValue(value);
- UpdateImage(ImageVisualProperty.DesiredHeight, setValue);
- setValue?.Dispose();
+ UpdateImage(0, null);
}
}
}
{
get
{
- return (ReleasePolicyType)GetValue(ReleasePolicyProperty);
- }
- set
- {
- SetValue(ReleasePolicyProperty, value);
- NotifyPropertyChanged();
- }
- }
- private ReleasePolicyType InternalReleasePolicy
- {
- get
- {
int ret = (int)ReleasePolicyType.Detached;
-
- PropertyValue releasePoli = _imagePropertyMap?.Find(ImageVisualProperty.ReleasePolicy);
+ PropertyMap imageMap = new PropertyMap();
+ PropertyValue image = Tizen.NUI.Object.GetProperty(SwigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue releasePoli = imageMap?.Find(ImageVisualProperty.ReleasePolicy);
releasePoli?.Get(out ret);
+
+ imageMap?.Dispose();
+ image?.Dispose();
releasePoli?.Dispose();
return (ReleasePolicyType)ret;
{
get
{
- return (WrapModeType)GetValue(WrapModeUProperty);
- }
- set
- {
- SetValue(WrapModeUProperty, value);
- NotifyPropertyChanged();
- }
- }
- private WrapModeType InternalWrapModeU
- {
- get
- {
int ret = (int)WrapModeType.Default;
+ PropertyMap imageMap = new PropertyMap();
+ PropertyValue image = Tizen.NUI.Object.GetProperty(SwigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue warpModeU = imageMap?.Find(ImageVisualProperty.WrapModeU);
+ warpModeU?.Get(out ret);
- PropertyValue wrapModeU = _imagePropertyMap?.Find(ImageVisualProperty.WrapModeU);
- wrapModeU?.Get(out ret);
- wrapModeU?.Dispose();
+ imageMap?.Dispose();
+ image?.Dispose();
+ warpModeU?.Dispose();
return (WrapModeType)ret;
}
{
get
{
- return (WrapModeType)GetValue(WrapModeVProperty);
- }
- set
- {
- SetValue(WrapModeVProperty, value);
- NotifyPropertyChanged();
- }
- }
- private WrapModeType InternalWrapModeV
- {
- get
- {
int ret = (int)WrapModeType.Default;
-
- PropertyValue wrapModeV = _imagePropertyMap?.Find(ImageVisualProperty.WrapModeV);
+ PropertyMap imageMap = new PropertyMap();
+ PropertyValue image = Tizen.NUI.Object.GetProperty(SwigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ PropertyValue wrapModeV = imageMap?.Find(ImageVisualProperty.WrapModeV);
wrapModeV?.Get(out ret);
+
+ imageMap?.Dispose();
+ image?.Dispose();
wrapModeV?.Dispose();
return (WrapModeType)ret;
/// If the ImageView's HeightSpecification is 50 and AdjustViewSize is true, then the ImageView requests size (50, 50) instead of (100, 50).
/// </remarks>
/// <since_tizen> 9 </since_tizen>
- public bool AdjustViewSize
- {
- get
- {
- return (bool)GetValue(AdjustViewSizeProperty);
- }
- set
- {
- SetValue(AdjustViewSizeProperty, value);
- NotifyPropertyChanged();
- }
- }
- private bool adjustViewSize = false;
+ public bool AdjustViewSize { get; set; } = false;
internal Selector<string> ResourceUrlSelector
{
_border = null;
borderSelector?.Reset(this);
resourceUrlSelector?.Reset(this);
- _imagePropertyUpdatedFlag = false;
- if (_imagePropertyUpdateProcessAttachedFlag)
- {
- ProcessorController.Instance.ProcessorOnceEvent -= UpdateImage;
- _imagePropertyUpdateProcessAttachedFlag = false;
- }
- _imagePropertyMap?.Dispose();
- _imagePropertyMap = null;
}
base.Dispose(type);
string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
value = value.Replace("*Resource*", resource);
}
- if(_resourceUrl != value)
- {
- _resourceUrl = value;
- UpdateImage(ImageVisualProperty.URL, new PropertyValue(value));
- }
+ _resourceUrl = value;
+ UpdateImage(ImageVisualProperty.URL, new PropertyValue(value));
}
private void SetBorder(Rectangle value)
{
return;
}
- if(_border != value)
- {
- _border = new Rectangle(value);
- UpdateImage(NpatchImageVisualProperty.Border, new PropertyValue(_border));
- }
+ _border = new Rectangle(value);
+ UpdateImage(NpatchImageVisualProperty.Border, new PropertyValue(_border));
}
- /// <summary>
- /// Lazy call to UpdateImage.
- /// Collect Properties need to be update, and set properties that starts the Processing.
- /// </summary>
- private void UpdateImage(int key, PropertyValue value)
+ private void UpdateImageMap(PropertyMap fromMap)
{
- // If we set ResourceUrl as empty, Unregist visual.
- if (key == ImageVisualProperty.URL && string.IsNullOrEmpty(_resourceUrl))
- {
- // If previous resourceUrl was already empty, we don't need to do anything. just ignore.
- // Unregist and dettach Process only if previous resourceUrl was not empty
- string currentResourceUrl = "";
- PropertyValue currentResourceUrlValue = _imagePropertyMap?.Find(ImageVisualProperty.URL);
- if((currentResourceUrlValue?.Get(out currentResourceUrl) ?? false) && !string.IsNullOrEmpty(currentResourceUrl))
- {
- PropertyValue resourceUrl = new PropertyValue(_resourceUrl);
- PropertyMap imageMap = new PropertyMap();
- imageMap.Insert(ImageVisualProperty.URL, resourceUrl);
- PropertyValue setValue = new PropertyValue(imageMap);
- SetProperty(ImageView.Property.IMAGE, setValue);
-
- // Image visual is not exist anymore. We should ignore lazy UpdateImage
- _imagePropertyUpdatedFlag = false;
- if(_imagePropertyUpdateProcessAttachedFlag)
- {
- ProcessorController.Instance.ProcessorOnceEvent -= UpdateImage;
- _imagePropertyUpdateProcessAttachedFlag = false;
- }
- // Update resourceUrl as null
- _imagePropertyMap[ImageVisualProperty.URL] = resourceUrl;
-
- resourceUrl?.Dispose();
- setValue?.Dispose();
- imageMap?.Dispose();
- }
- return;
- }
-
- // Update image property map value as inputed value.
- if (key != 0)
- {
- if (_imagePropertyMap == null)
- {
- _imagePropertyMap = new PropertyMap();
- }
- _imagePropertyUpdatedFlag = true;
- _imagePropertyMap[key] = value;
+ PropertyMap imageMap = new PropertyMap();
- // Lazy update only if _resourceUrl is not empty and ProcessAttachedFlag is false.
- if (!string.IsNullOrEmpty(_resourceUrl) && !_imagePropertyUpdateProcessAttachedFlag)
- {
- _imagePropertyUpdateProcessAttachedFlag = true;
- ProcessorController.Instance.ProcessorOnceEvent += UpdateImage;
- // Call process hardly.
- ProcessorController.Instance.Awake();
- }
- }
- }
+ PropertyValue image = Tizen.NUI.Object.GetProperty(SwigCPtr, ImageView.Property.IMAGE);
+ image?.Get(imageMap);
+ imageMap?.Merge(fromMap);
+ PropertyValue setValue = new PropertyValue(imageMap);
+ SetProperty(ImageView.Property.IMAGE, setValue);
- /// <summary>
- /// Callback function to Lazy UpdateImage.
- /// Or, We can call UpdateImage() function directly if we need.
- /// </summary>
- private void UpdateImage(object source, EventArgs e)
- {
- UpdateImage();
- _imagePropertyUpdateProcessAttachedFlag = false;
+ imageMap?.Dispose();
+ image?.Dispose();
+ setValue?.Dispose();
}
- private void UpdateImage()
+ private void UpdateImage(int key, PropertyValue value)
{
- if(!_imagePropertyUpdatedFlag) return;
+ PropertyMap imageMap = new PropertyMap();
- _imagePropertyUpdatedFlag = false;
+ if (_alphaMaskUrl != null)
+ {
+ PropertyValue alphaMaskUrl = new PropertyValue(_alphaMaskUrl);
+ imageMap?.Insert(ImageVisualProperty.AlphaMaskURL, alphaMaskUrl);
+ alphaMaskUrl?.Dispose();
+ }
- if(_imagePropertyMap == null)
+ if (string.IsNullOrEmpty(_resourceUrl))
{
- _imagePropertyMap = new PropertyMap();
+ PropertyValue resourceUrl = new PropertyValue(_resourceUrl);
+ imageMap?.Insert(ImageVisualProperty.URL, resourceUrl);
+ PropertyValue setValue = new PropertyValue(imageMap);
+ SetProperty(ImageView.Property.IMAGE, setValue);
+ resourceUrl?.Dispose();
+ setValue?.Dispose();
+ return;
}
if (_border == null)
{
PropertyValue image = new PropertyValue((int)Visual.Type.Image);
- _imagePropertyMap[Visual.Property.Type] = image;
+ imageMap?.Insert(Visual.Property.Type, image);
image?.Dispose();
}
else
{
PropertyValue nPatch = new PropertyValue((int)Visual.Type.NPatch);
- _imagePropertyMap[Visual.Property.Type] = nPatch;
+ imageMap?.Insert(Visual.Property.Type, nPatch);
nPatch?.Dispose();
PropertyValue border = new PropertyValue(_border);
- _imagePropertyMap[NpatchImageVisualProperty.Border] = border;
+ imageMap?.Insert(NpatchImageVisualProperty.Border, border);
border?.Dispose();
}
+ if(key != Visual.Property.VisualFittingMode && _fittingMode != VisualFittingModeType.Fill)
+ {
+ PropertyValue fittingMode = new PropertyValue((int)_fittingMode);
+ imageMap?.Insert(Visual.Property.VisualFittingMode, fittingMode);
+ fittingMode?.Dispose();
+ }
+
+ PropertyValue synchronousLoading = new PropertyValue(_synchronousLoading);
+ imageMap?.Insert(NpatchImageVisualProperty.SynchronousLoading, synchronousLoading);
+ synchronousLoading?.Dispose();
+
if (backgroundExtraData != null && backgroundExtraData.CornerRadius != null)
{
using (var cornerRadius = new PropertyValue(backgroundExtraData.CornerRadius))
using (var cornerRadiusPolicy = new PropertyValue((int)backgroundExtraData.CornerRadiusPolicy))
{
- _imagePropertyMap[Visual.Property.CornerRadius] = cornerRadius;
- _imagePropertyMap[Visual.Property.CornerRadiusPolicy] = new PropertyValue((int)(backgroundExtraData.CornerRadiusPolicy));
+ imageMap.Insert(Visual.Property.CornerRadius, cornerRadius);
+ imageMap.Insert(Visual.Property.CornerRadiusPolicy, new PropertyValue((int)(backgroundExtraData.CornerRadiusPolicy)));
}
}
using (var borderlineColor = new PropertyValue(backgroundExtraData.BorderlineColor))
using (var borderlineOffset = new PropertyValue(backgroundExtraData.BorderlineOffset))
{
- _imagePropertyMap[Visual.Property.BorderlineWidth] = borderlineWidth;
- _imagePropertyMap[Visual.Property.BorderlineColor] = borderlineColor;
- _imagePropertyMap[Visual.Property.BorderlineOffset] = borderlineOffset;
+ imageMap.Insert(Visual.Property.BorderlineWidth, borderlineWidth);
+ imageMap.Insert(Visual.Property.BorderlineColor, borderlineColor);
+ imageMap.Insert(Visual.Property.BorderlineOffset, borderlineOffset);
}
}
+ if (value != null)
+ {
+ imageMap?.Insert(key, value);
+ }
+
// Do Fitting Buffer when desired dimension is set
if (_desired_width != -1 && _desired_height != -1)
{
}
PropertyValue returnWidth = new PropertyValue(adjustedDesiredWidth);
- _imagePropertyMap[ImageVisualProperty.DesiredWidth] = returnWidth;
+ imageMap?.Insert(ImageVisualProperty.DesiredWidth, returnWidth);
returnWidth?.Dispose();
PropertyValue returnHeight = new PropertyValue(adjustedDesiredHeight);
- _imagePropertyMap[ImageVisualProperty.DesiredHeight] = returnHeight;
+ imageMap?.Insert(ImageVisualProperty.DesiredHeight, returnHeight);
returnHeight?.Dispose();
PropertyValue scaleToFit = new PropertyValue((int)FittingModeType.ScaleToFill);
- _imagePropertyMap[ImageVisualProperty.FittingMode] = scaleToFit;
+ imageMap?.Insert(ImageVisualProperty.FittingMode, scaleToFit);
scaleToFit?.Dispose();
}
else
}
}
- UpdateImageMap();
- }
- private void UpdateImageMap()
- {
- PropertyMap imageMap = new PropertyMap();
-
- PropertyValue image = Tizen.NUI.Object.GetProperty(SwigCPtr, ImageView.Property.IMAGE);
- image?.Get(imageMap);
- imageMap.Merge(_imagePropertyMap);
- PropertyValue setValue = new PropertyValue(imageMap);
- SetProperty(ImageView.Property.IMAGE, setValue);
-
- // Sync local PropertyMap
- // TODO: Do we need to use GetProperty(SwigCPtr, ImageView.Property.IMAGE); here?
- _imagePropertyMap.Dispose();
- _imagePropertyMap = new PropertyMap(imageMap);
+ UpdateImageMap(imageMap);
imageMap?.Dispose();
- image?.Dispose();
- setValue?.Dispose();
+ imageMap = null;
}
+
private void OnResourceLoaded(IntPtr view)
{
ResourceLoadedEventArgs e = new ResourceLoadedEventArgs();
+++ /dev/null
-/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-using System.ComponentModel;
-using System.Runtime.InteropServices;
-using Tizen.NUI.Binding;
-
-namespace Tizen.NUI.BaseComponents
-{
- public partial class ImageView
- {
- /// Intenal used, will never be opened.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty ResourceUrlProperty = BindableProperty.Create(nameof(ImageView.ResourceUrl), typeof(string), typeof(ImageView), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var imageView = (ImageView)bindable;
-
- if (newValue is Selector<string> selector)
- {
- imageView.ResourceUrlSelector = selector;
- }
- else
- {
- imageView.resourceUrlSelector?.Reset(imageView);
- imageView.SetResourceUrl((string)newValue);
- }
- },
- defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
- {
- var imageView = (ImageView)bindable;
- string ret = "";
-
- imageView._imagePropertyMap?.Find(ImageVisualProperty.URL)?.Get(out ret);
-
- return ret;
- }));
-
- /// Intenal used, will never be opened.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty ImageProperty = BindableProperty.Create(nameof(ImageView.Image), typeof(PropertyMap), typeof(ImageView), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
- {
- var imageView = (ImageView)bindable;
- if (newValue != null)
- {
- PropertyMap map = (PropertyMap)newValue;
- if (imageView.IsCreateByXaml)
- {
- string url = "", alphaMaskURL = "", auxiliaryImageURL = "";
- string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
- PropertyValue urlValue = map.Find(NDalic.ImageVisualUrl);
- bool ret = false;
- if (urlValue != null) ret = urlValue.Get(out url);
- PropertyMap mmap = new PropertyMap();
- if (ret && url.StartsWith("*Resource*"))
- {
- url = url.Replace("*Resource*", resource);
- mmap.Insert(NDalic.ImageVisualUrl, new PropertyValue(url));
- }
-
- ret = false;
- PropertyValue alphaMaskUrlValue = map.Find(NDalic.ImageVisualAlphaMaskUrl);
- if (alphaMaskUrlValue != null) ret = alphaMaskUrlValue.Get(out alphaMaskURL);
- if (ret && alphaMaskURL.StartsWith("*Resource*"))
- {
- alphaMaskURL = alphaMaskURL.Replace("*Resource*", resource);
- mmap.Insert(NDalic.ImageVisualUrl, new PropertyValue(alphaMaskURL));
- }
-
- ret = false;
- PropertyValue auxiliaryImageURLValue = map.Find(NDalic.ImageVisualAuxiliaryImageUrl);
- if (auxiliaryImageURLValue != null) ret = auxiliaryImageURLValue.Get(out auxiliaryImageURL);
- if (ret && auxiliaryImageURL.StartsWith("*Resource*"))
- {
- auxiliaryImageURL = auxiliaryImageURL.Replace("*Resource*", resource);
- mmap.Insert(NDalic.ImageVisualAuxiliaryImageUrl, new PropertyValue(auxiliaryImageURL));
- }
-
- map.Merge(mmap);
- }
- if (imageView._border == null)
- {
- // Image properties are changed hardly. We should ignore lazy UpdateImage
- imageView._imagePropertyUpdatedFlag = false;
- imageView._imagePropertyMap?.Dispose();
- imageView._imagePropertyMap = null;
- if(map != null)
- {
- imageView._imagePropertyMap = new PropertyMap(map);
- }
- Tizen.NUI.Object.SetProperty((HandleRef)imageView.SwigCPtr, ImageView.Property.IMAGE, new Tizen.NUI.PropertyValue(map));
- }
- }
- }),
- defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
- {
- var imageView = (ImageView)bindable;
- if (imageView._border == null)
- {
- PropertyMap temp = new PropertyMap();
-
- // Sync as current properties.
- imageView.UpdateImage();
- if(imageView._imagePropertyMap != null)
- {
- temp.Merge(imageView._imagePropertyMap);
- }
-
- return temp;
- }
- else
- {
- return null;
- }
- }));
-
- /// Intenal used, will never be opened.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty PreMultipliedAlphaProperty = BindableProperty.Create(nameof(PreMultipliedAlpha), typeof(bool), typeof(ImageView), false, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
- {
- var imageView = (ImageView)bindable;
- if (newValue != null)
- {
- Tizen.NUI.Object.SetProperty((HandleRef)imageView.SwigCPtr, ImageView.Property.PreMultipliedAlpha, new Tizen.NUI.PropertyValue((bool)newValue));
- }
- }),
- defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
- {
- var imageView = (ImageView)bindable;
- bool temp = false;
- Tizen.NUI.Object.GetProperty((HandleRef)imageView.SwigCPtr, ImageView.Property.PreMultipliedAlpha).Get(out temp);
- return temp;
- }));
-
- /// Intenal used, will never be opened.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty PixelAreaProperty = BindableProperty.Create(nameof(PixelArea), typeof(RelativeVector4), typeof(ImageView), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) =>
- {
- var imageView = (ImageView)bindable;
- if (newValue != null)
- {
- Tizen.NUI.Object.SetProperty((HandleRef)imageView.SwigCPtr, ImageView.Property.PixelArea, new Tizen.NUI.PropertyValue((RelativeVector4)newValue));
- }
- }),
- defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
- {
- var imageView = (ImageView)bindable;
- Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
- Tizen.NUI.Object.GetProperty((HandleRef)imageView.SwigCPtr, ImageView.Property.PixelArea).Get(temp);
- RelativeVector4 relativeTemp = new RelativeVector4(temp.X, temp.Y, temp.Z, temp.W);
- return relativeTemp;
- }));
-
- /// Intenal used, will never be opened.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty BorderProperty = BindableProperty.Create(nameof(Border), typeof(Rectangle), typeof(ImageView), null, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var imageView = (ImageView)bindable;
- imageView.borderSelector?.Reset(imageView);
-
- if (newValue is Selector<Rectangle> selector)
- {
- if (selector.HasAll()) imageView.SetBorder(selector.All);
- else imageView.borderSelector = new TriggerableSelector<Rectangle>(imageView, selector, imageView.SetBorder, true);
- }
- else
- {
- imageView.SetBorder((Rectangle)newValue);
- }
- },
- defaultValueCreator: (bindable) =>
- {
- var imageView = (ImageView)bindable;
- return imageView._border;
- });
-
- /// Intenal used, will never be opened.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty BorderOnlyProperty = BindableProperty.Create(nameof(BorderOnly), typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var imageView = (ImageView)bindable;
- if (newValue != null)
- {
- if(oldValue != null)
- {
- bool oldBool = (bool)oldValue;
- bool newBool = (bool)newValue;
- if(oldBool == newBool)
- {
- return;
- }
- }
- imageView.UpdateImage(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)newValue));
- }
- },
- defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
- {
- var imageView = (ImageView)bindable;
- bool ret = false;
-
- imageView._imagePropertyMap?.Find(NpatchImageVisualProperty.BorderOnly)?.Get(out ret);
-
- return ret;
- }));
-
- /// Intenal used, will never be opened.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty SynchronosLoadingProperty = BindableProperty.Create(nameof(SynchronousLoading), typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var imageView = (ImageView)bindable;
- if (newValue != null)
- {
- if(oldValue != null)
- {
- bool oldBool = (bool)oldValue;
- bool newBool = (bool)newValue;
- if(oldBool == newBool)
- {
- return;
- }
- }
- imageView.UpdateImage(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)newValue));
- }
- },
- defaultValueCreator: (bindable) =>
- {
- var imageView = (ImageView)bindable;
- bool ret = false;
-
- imageView._imagePropertyMap?.Find(ImageVisualProperty.SynchronousLoading)?.Get(out ret);
-
- return ret;
- });
-
- /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty SynchronousLoadingProperty = BindableProperty.Create(nameof(SynchronousLoading), typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var imageView = (ImageView)bindable;
- if (newValue != null)
- {
- if(oldValue != null)
- {
- bool oldBool = (bool)oldValue;
- bool newBool = (bool)newValue;
- if(oldBool == newBool)
- {
- return;
- }
- }
- imageView.UpdateImage(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)newValue));
- }
- },
- defaultValueCreator: (bindable) =>
- {
- var imageView = (ImageView)bindable;
- bool ret = false;
-
- imageView._imagePropertyMap?.Find(ImageVisualProperty.SynchronousLoading)?.Get(out ret);
-
- return ret;
- });
-
- /// Intenal used, will never be opened.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty OrientationCorrectionProperty = BindableProperty.Create(nameof(OrientationCorrection), typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var imageView = (ImageView)bindable;
- if (newValue != null)
- {
- if(oldValue != null)
- {
- bool oldBool = (bool)oldValue;
- bool newBool = (bool)newValue;
- if(oldBool == newBool)
- {
- return;
- }
- }
- imageView.UpdateImage(ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)newValue));
- }
- },
- defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
- {
- var imageView = (ImageView)bindable;
-
- bool ret = false;
-
- imageView._imagePropertyMap?.Find(ImageVisualProperty.OrientationCorrection)?.Get(out ret);
-
- return ret;
- }));
-
- /// <summary>
- /// ImageMapProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty ImageMapProperty = BindableProperty.Create(nameof(ImageMap), typeof(Tizen.NUI.PropertyMap), typeof(ImageView), null, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- if (newValue != null)
- {
- instance.InternalImageMap = (Tizen.NUI.PropertyMap)newValue;
- }
- },
- defaultValueCreator: (bindable) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- return instance.InternalImageMap;
- });
-
- /// <summary>
- /// AlphaMaskURLProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty AlphaMaskURLProperty = BindableProperty.Create(nameof(AlphaMaskURL), typeof(string), typeof(ImageView), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- if (newValue != null)
- {
- instance.InternalAlphaMaskURL = (string)newValue;
- }
- },
- defaultValueCreator: (bindable) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- return instance.InternalAlphaMaskURL;
- });
-
- /// <summary>
- /// CropToMaskProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty CropToMaskProperty = BindableProperty.Create(nameof(CropToMask), typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- if (newValue != null)
- {
- instance.InternalCropToMask = (bool)newValue;
- }
- },
- defaultValueCreator: (bindable) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- return instance.InternalCropToMask;
- });
-
- /// <summary>
- /// FittingModeProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty FittingModeProperty = BindableProperty.Create(nameof(FittingMode), typeof(FittingModeType), typeof(ImageView), default(FittingModeType), propertyChanged: (bindable, oldValue, newValue) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- if (newValue != null)
- {
- instance.InternalFittingMode = (Tizen.NUI.FittingModeType)newValue;
- }
- },
- defaultValueCreator: (bindable) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- return instance.InternalFittingMode;
- });
-
- /// <summary>
- /// DesiredWidthProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty DesiredWidthProperty = BindableProperty.Create(nameof(DesiredWidth), typeof(int), typeof(ImageView), 0, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- if (newValue != null)
- {
- instance.InternalDesiredWidth = (int)newValue;
- }
- },
- defaultValueCreator: (bindable) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- return instance.InternalDesiredWidth;
- });
-
- /// <summary>
- /// DesiredHeightProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty DesiredHeightProperty = BindableProperty.Create(nameof(DesiredHeight), typeof(int), typeof(ImageView), 0, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- if (newValue != null)
- {
- instance.InternalDesiredHeight = (int)newValue;
- }
- },
- defaultValueCreator: (bindable) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- return instance.InternalDesiredHeight;
- });
-
- /// <summary>
- /// ReleasePolicyProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty ReleasePolicyProperty = BindableProperty.Create(nameof(ReleasePolicy), typeof(ReleasePolicyType), typeof(ImageView), default(ReleasePolicyType), propertyChanged: (bindable, oldValue, newValue) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- if (newValue != null)
- {
- instance.InternalReleasePolicy = (Tizen.NUI.ReleasePolicyType)newValue;
- }
- },
- defaultValueCreator: (bindable) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- return instance.InternalReleasePolicy;
- });
-
- /// <summary>
- /// WrapModeUProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty WrapModeUProperty = BindableProperty.Create(nameof(WrapModeU), typeof(Tizen.NUI.WrapModeType), typeof(ImageView), default(WrapModeType), propertyChanged: (bindable, oldValue, newValue) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- if (newValue != null)
- {
- instance.InternalWrapModeU = (Tizen.NUI.WrapModeType)newValue;
- }
- },
- defaultValueCreator: (bindable) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- return instance.InternalWrapModeU;
- });
-
- /// <summary>
- /// WrapModeVProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty WrapModeVProperty = BindableProperty.Create(nameof(WrapModeV), typeof(Tizen.NUI.WrapModeType), typeof(ImageView), default(WrapModeType), propertyChanged: (bindable, oldValue, newValue) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- if (newValue != null)
- {
- instance.InternalWrapModeV = (Tizen.NUI.WrapModeType)newValue;
- }
- },
- defaultValueCreator: (bindable) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- return instance.InternalWrapModeV;
- });
-
- /// <summary>
- /// AdjustViewSizeProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty AdjustViewSizeProperty = BindableProperty.Create(nameof(AdjustViewSize), typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- if (newValue != null)
- {
- instance.adjustViewSize = (bool)newValue;
- }
- },
- defaultValueCreator: (bindable) =>
- {
- var instance = (Tizen.NUI.BaseComponents.ImageView)bindable;
- return instance.adjustViewSize;
- });
- }
-}