2 * Copyright(c) 2018 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Runtime.InteropServices;
19 using System.ComponentModel;
20 using Tizen.NUI.Binding;
22 namespace Tizen.NUI.BaseComponents
26 /// ImageView is a class for displaying an image resource.<br />
27 /// An instance of ImageView can be created using a URL or an image instance.<br />
29 /// <since_tizen> 3 </since_tizen>
30 public class ImageView : View
32 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
33 [EditorBrowsable(EditorBrowsableState.Never)]
34 public static readonly BindableProperty ResourceUrlProperty = BindableProperty.Create(nameof(ImageView.ResourceUrl), typeof(string), typeof(ImageView), string.Empty, propertyChanged: (bindable, oldValue, newValue) =>
36 var imageView = (ImageView)bindable;
39 string url = (string)newValue;
40 if (imageView.IsCreateByXaml && url.Contains("*Resource*"))
42 string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
43 url = url.Replace("*Resource*", resource);
46 imageView.UpdateImage();
49 defaultValueCreator: (bindable) =>
51 var imageView = (ImageView)bindable;
52 if(imageView._imageType == ImageType.Normal)
54 Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.IMAGE).Get(out imageView._url);
56 return imageView._url;
59 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
60 [EditorBrowsable(EditorBrowsableState.Never)]
61 public static readonly BindableProperty ImageProperty = BindableProperty.Create(nameof(ImageView.Image), typeof(PropertyMap), typeof(ImageView), null, propertyChanged: (bindable, oldValue, newValue) =>
63 var imageView = (ImageView)bindable;
66 PropertyMap map = (PropertyMap)newValue;
67 if (imageView.IsCreateByXaml)
69 string url = "", alphaMaskURL = "", auxiliaryImageURL = "";
70 string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
71 PropertyValue urlValue = map.Find(NDalic.IMAGE_VISUAL_URL);
73 if (urlValue != null) ret = urlValue.Get(out url);
74 PropertyMap mmap = new PropertyMap();
75 if (ret && url.Contains("*Resource*"))
77 url = url.Replace("*Resource*", resource);
78 mmap.Insert(NDalic.IMAGE_VISUAL_URL, new PropertyValue(url));
82 PropertyValue alphaMaskUrlValue = map.Find(NDalic.IMAGE_VISUAL_ALPHA_MASK_URL);
83 if (alphaMaskUrlValue != null) ret = alphaMaskUrlValue.Get(out alphaMaskURL);
84 if (ret && alphaMaskURL.Contains("*Resource*"))
86 alphaMaskURL = alphaMaskURL.Replace("*Resource*", resource);
87 mmap.Insert(NDalic.IMAGE_VISUAL_URL, new PropertyValue(alphaMaskURL));
91 PropertyValue auxiliaryImageURLValue = map.Find(NDalic.IMAGE_VISUAL_AUXILIARY_IMAGE_URL);
92 if (auxiliaryImageURLValue != null) ret = auxiliaryImageURLValue.Get(out auxiliaryImageURL);
93 if (ret && auxiliaryImageURL.Contains("*Resource*"))
95 auxiliaryImageURL = auxiliaryImageURL.Replace("*Resource*", resource);
96 mmap.Insert(NDalic.IMAGE_VISUAL_AUXILIARY_IMAGE_URL, new PropertyValue(auxiliaryImageURL));
101 if (imageView._border == null)
103 imageView._image = map;
104 imageView.UpdateImage();
108 defaultValueCreator: (bindable) =>
110 var imageView = (ImageView)bindable;
111 if (imageView._border == null)
113 PropertyMap temp = new PropertyMap();
114 Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.IMAGE).Get(temp);
123 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
124 [EditorBrowsable(EditorBrowsableState.Never)]
125 public static readonly BindableProperty PreMultipliedAlphaProperty = BindableProperty.Create("PreMultipliedAlpha", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
127 var imageView = (ImageView)bindable;
128 if (newValue != null)
130 Tizen.NUI.Object.SetProperty(imageView.swigCPtr, ImageView.Property.PRE_MULTIPLIED_ALPHA, new Tizen.NUI.PropertyValue((bool)newValue));
133 defaultValueCreator: (bindable) =>
135 var imageView = (ImageView)bindable;
137 Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.PRE_MULTIPLIED_ALPHA).Get(out temp);
141 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
142 [EditorBrowsable(EditorBrowsableState.Never)]
143 public static readonly BindableProperty PixelAreaProperty = BindableProperty.Create("PixelArea", typeof(RelativeVector4), typeof(ImageView), null, propertyChanged: (bindable, oldValue, newValue) =>
145 var imageView = (ImageView)bindable;
146 if (newValue != null)
148 Tizen.NUI.Object.SetProperty(imageView.swigCPtr, ImageView.Property.PIXEL_AREA, new Tizen.NUI.PropertyValue((RelativeVector4)newValue));
151 defaultValueCreator: (bindable) =>
153 var imageView = (ImageView)bindable;
154 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
155 Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.PIXEL_AREA).Get(temp);
156 RelativeVector4 relativeTemp = new RelativeVector4(temp.X, temp.Y, temp.Z, temp.W);
160 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
161 [EditorBrowsable(EditorBrowsableState.Never)]
162 public static readonly BindableProperty BorderProperty = BindableProperty.Create("Border", typeof(Rectangle), typeof(ImageView), null, propertyChanged: (bindable, oldValue, newValue) =>
164 var imageView = (ImageView)bindable;
165 if (newValue != null)
167 imageView._border = (Rectangle)newValue;
168 imageView.UpdateImage();
171 defaultValueCreator: (bindable) =>
173 var imageView = (ImageView)bindable;
174 return imageView._border;
177 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
178 [EditorBrowsable(EditorBrowsableState.Never)]
179 public static readonly BindableProperty BorderOnlyProperty = BindableProperty.Create("BorderOnly", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
181 var imageView = (ImageView)bindable;
182 if (newValue != null)
184 imageView._borderOnly = (bool)newValue;
185 imageView.UpdateImage();
188 defaultValueCreator: (bindable) =>
190 var imageView = (ImageView)bindable;
191 return imageView._borderOnly ?? false;
194 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
195 [EditorBrowsable(EditorBrowsableState.Never)]
196 public static readonly BindableProperty SynchronosLoadingProperty = BindableProperty.Create("SynchronosLoading", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
198 var imageView = (ImageView)bindable;
199 if (newValue != null)
201 imageView._synchronousLoading = (bool)newValue;
202 imageView.UpdateImage();
205 defaultValueCreator: (bindable) =>
207 var imageView = (ImageView)bindable;
208 return imageView._synchronousLoading ?? false;
211 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
212 [EditorBrowsable(EditorBrowsableState.Never)]
213 public static readonly BindableProperty OrientationCorrectionProperty = BindableProperty.Create("OrientationCorrection", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
215 var imageView = (ImageView)bindable;
216 if (newValue != null)
218 imageView._orientationCorrection = (bool)newValue;
219 imageView.UpdateImage();
222 defaultValueCreator: (bindable) =>
224 var imageView = (ImageView)bindable;
225 return imageView._orientationCorrection ?? false;
228 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
229 private EventHandler<ResourceReadyEventArgs> _resourceReadyEventHandler;
230 private ResourceReadyEventCallbackType _resourceReadyEventCallback;
231 private EventHandler<ResourceLoadedEventArgs> _resourceLoadedEventHandler;
232 private _resourceLoadedCallbackType _resourceLoadedCallback;
234 private Rectangle _border;
235 private PropertyMap _nPatchMap;
236 private bool? _synchronousLoading;
237 private bool? _borderOnly;
239 private bool? _orientationCorrection;
240 private PropertyMap _image;
241 private ImageType _imageType;
244 /// Creates an initialized ImageView.
246 /// <since_tizen> 3 </since_tizen>
247 public ImageView() : this(Interop.ImageView.ImageView_New__SWIG_0(), true)
249 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 /// Creates an initialized ImageView from a URL to an image resource.<br />
254 /// If the string is empty, ImageView will not display anything.<br />
256 /// <param name="url">The URL of the image resource to display.</param>
257 /// <since_tizen> 3 </since_tizen>
258 public ImageView(string url) : this(Interop.ImageView.ImageView_New__SWIG_2(url), true)
261 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
264 internal ImageView(string url, Uint16Pair size) : this(Interop.ImageView.ImageView_New__SWIG_3(url, Uint16Pair.getCPtr(size)), true)
267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270 internal ImageView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.ImageView.ImageView_SWIGUpcast(cPtr), cMemoryOwn)
272 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
275 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
276 private delegate void ResourceReadyEventCallbackType(IntPtr data);
277 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
278 private delegate void _resourceLoadedCallbackType(IntPtr view);
281 /// An event for ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
282 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
283 /// Most resources are only loaded when the control is placed on the stage.<br />
285 /// <since_tizen> 3 </since_tizen>
286 public event EventHandler<ResourceReadyEventArgs> ResourceReady
290 if (_resourceReadyEventHandler == null)
292 _resourceReadyEventCallback = OnResourceReady;
293 ResourceReadySignal(this).Connect(_resourceReadyEventCallback);
296 _resourceReadyEventHandler += value;
301 _resourceReadyEventHandler -= value;
303 if (_resourceReadyEventHandler == null && ResourceReadySignal(this).Empty() == false)
305 ResourceReadySignal(this).Disconnect(_resourceReadyEventCallback);
310 internal event EventHandler<ResourceLoadedEventArgs> ResourceLoaded
314 if (_resourceLoadedEventHandler == null)
316 _resourceLoadedCallback = OnResourceLoaded;
317 this.ResourceReadySignal(this).Connect(_resourceLoadedCallback);
320 _resourceLoadedEventHandler += value;
324 _resourceLoadedEventHandler -= value;
326 if (_resourceLoadedEventHandler == null && this.ResourceReadySignal(this).Empty() == false)
328 this.ResourceReadySignal(this).Disconnect(_resourceLoadedCallback);
334 /// Enumeration for LoadingStatus of image.
336 /// <since_tizen> 5 </since_tizen>
337 public enum LoadingStatusType
340 /// Loading preparing status.
342 /// <since_tizen> 5 </since_tizen>
345 /// Loading ready status.
347 /// <since_tizen> 5 </since_tizen>
350 /// Loading failed status.
352 /// <since_tizen> 5 </since_tizen>
357 /// ImageView ResourceUrl, type string.
358 /// This is one of mandatory property. Even if not set or null set, it sets empty string ("") internally.
359 /// When it is set as null, it gives empty string ("") to be read.
361 /// <since_tizen> 3 </since_tizen>
362 public string ResourceUrl
366 return (string)GetValue(ResourceUrlProperty);
370 _url = (value == null ? "" : value);
371 SetValue(ResourceUrlProperty, _url);
372 NotifyPropertyChanged();
377 /// This will be deprecated, please use Image instead. <br />
378 /// ImageView ImageMap, type PropertyMap: string if it is a URL, map otherwise.
380 /// <since_tizen> 3 </since_tizen>
381 [Obsolete("Please do not use! This will be deprecated! Please use Image property instead!")]
382 [EditorBrowsable(EditorBrowsableState.Never)]
383 public PropertyMap ImageMap
389 PropertyMap temp = new PropertyMap();
390 GetProperty(ImageView.Property.IMAGE).Get(temp);
402 if (_url != null) { value.Add("url", new PropertyValue(_url)); }
403 SetProperty(ImageView.Property.IMAGE, new Tizen.NUI.PropertyValue(value));
404 NotifyPropertyChanged();
410 /// ImageView Image, type PropertyMap
412 /// <since_tizen> 4 </since_tizen>
413 public PropertyMap Image
419 return (PropertyMap)GetValue(ImageProperty);
430 SetValue(ImageProperty, value);
431 NotifyPropertyChanged();
437 /// ImageView PreMultipliedAlpha, type Boolean.<br />
438 /// Image must be initialized.<br />
440 /// <since_tizen> 3 </since_tizen>
441 public bool PreMultipliedAlpha
445 return (bool)GetValue(PreMultipliedAlphaProperty);
449 SetValue(PreMultipliedAlphaProperty, value);
450 NotifyPropertyChanged();
455 /// ImageView PixelArea, type Vector4 (Animatable property).<br />
456 /// Pixel area is a relative value with the whole image area as [0.0, 0.0, 1.0, 1.0].<br />
458 /// <since_tizen> 3 </since_tizen>
459 public RelativeVector4 PixelArea
463 return (RelativeVector4)GetValue(PixelAreaProperty);
467 SetValue(PixelAreaProperty, value);
468 NotifyPropertyChanged();
473 /// The border of the image in the order: left, right, bottom, top.<br />
474 /// If set, ImageMap will be ignored.<br />
475 /// For N-Patch images only.<br />
478 /// <since_tizen> 3 </since_tizen>
479 public Rectangle Border
483 return (Rectangle)GetValue(BorderProperty);
487 SetValue(BorderProperty, value);
488 NotifyPropertyChanged();
493 /// Gets or sets whether to draw the borders only (if true).<br />
494 /// If not specified, the default is false.<br />
495 /// For N-Patch images only.<br />
498 /// <since_tizen> 3 </since_tizen>
499 public bool BorderOnly
503 return (bool)GetValue(BorderOnlyProperty);
507 SetValue(BorderOnlyProperty, value);
508 NotifyPropertyChanged();
513 /// Gets or sets whether to synchronos loading the resourceurl of image.<br />
515 /// <since_tizen> 3 </since_tizen>
516 public bool SynchronosLoading
520 return (bool)GetValue(SynchronosLoadingProperty);
524 SetValue(SynchronosLoadingProperty, value);
525 NotifyPropertyChanged();
530 /// Gets or sets whether to automatically correct the orientation of an image.<br />
532 /// <since_tizen> 5 </since_tizen>
533 public bool OrientationCorrection
537 return (bool)GetValue(OrientationCorrectionProperty);
541 SetValue(OrientationCorrectionProperty, value);
542 NotifyPropertyChanged();
547 /// Gets the loading state of the visual resource.
549 /// <since_tizen> 5 </since_tizen>
550 public ImageView.LoadingStatusType LoadingStatus
554 return (ImageView.LoadingStatusType)Interop.View.View_GetVisualResourceStatus(swigCPtr, (int)Property.IMAGE);
559 /// Downcasts a handle to imageView handle.
561 /// Please do not use! this will be deprecated!
562 /// Instead please use as keyword.
563 /// <since_tizen> 3 </since_tizen>
564 [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " +
566 "BaseHandle handle = new ImageView(imagePath); " +
567 "ImageView image = handle as ImageView")]
568 [EditorBrowsable(EditorBrowsableState.Never)]
569 public static ImageView DownCast(BaseHandle handle)
571 ImageView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as ImageView;
572 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
577 /// Sets this ImageView from the given URL.<br />
578 /// If the URL is empty, ImageView will not display anything.<br />
580 /// <param name="url">The URL to the image resource to display.</param>
581 /// <since_tizen> 3 </since_tizen>
582 public void SetImage(string url)
585 Interop.ImageView.ImageView_SetImage__SWIG_1(swigCPtr, url);
586 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
590 /// Queries if all resources required by a control are loaded and ready.<br />
591 /// Most resources are only loaded when the control is placed on the stage.<br />
592 /// True if the resources are loaded and ready, false otherwise.<br />
594 /// <since_tizen> 3 </since_tizen>
595 public new bool IsResourceReady()
597 bool ret = Interop.View.IsResourceReady(swigCPtr);
598 if (NDalicPINVOKE.SWIGPendingException.Pending)
599 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
604 /// Forcefully reloads the image. All the visuals using this image will reload to the latest image.
606 /// <since_tizen> 5 </since_tizen>
609 this.DoAction(ImageView.Property.IMAGE, Property.ACTION_RELOAD, new PropertyValue(0));
613 /// Plays the animated GIF. This is also the default playback mode.
615 /// <since_tizen> 5 </since_tizen>
618 this.DoAction(ImageView.Property.IMAGE, Property.ACTION_PLAY, new PropertyValue(0));
622 /// Pauses the animated GIF.
624 /// <since_tizen> 5 </since_tizen>
627 this.DoAction(ImageView.Property.IMAGE, Property.ACTION_PAUSE, new PropertyValue(0));
631 /// Stops the animated GIF.
633 /// <since_tizen> 5 </since_tizen>
636 this.DoAction(ImageView.Property.IMAGE, Property.ACTION_STOP, new PropertyValue(0));
639 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImageView obj)
641 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
644 internal void SetImage(string url, Uint16Pair size)
647 Interop.ImageView.ImageView_SetImage__SWIG_2(swigCPtr, url, Uint16Pair.getCPtr(size));
648 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
651 internal ViewResourceReadySignal ResourceReadySignal(View view)
653 ViewResourceReadySignal ret = new ViewResourceReadySignal(Interop.View.ResourceReadySignal(View.getCPtr(view)), false);
654 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
658 internal ResourceLoadingStatusType GetResourceStatus()
660 return (ResourceLoadingStatusType)Interop.View.View_GetVisualResourceStatus(this.swigCPtr, Property.IMAGE);
664 /// you can override it to clean-up your own resources.
666 /// <param name="type">DisposeTypes</param>
667 /// <since_tizen> 3 </since_tizen>
668 protected override void Dispose(DisposeTypes type)
675 if (type == DisposeTypes.Explicit)
678 //Release your own managed resources here.
679 //You should release all of your own disposable objects here.
682 _nPatchMap?.Dispose();
688 //Release your own unmanaged resources here.
689 //You should not access any managed member here except static instance.
690 //because the execution order of Finalizes is non-deterministic.
692 if (swigCPtr.Handle != global::System.IntPtr.Zero)
697 Interop.ImageView.delete_ImageView(swigCPtr);
699 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
705 // Callback for View ResourceReady signal
706 private void OnResourceReady(IntPtr data)
708 ResourceReadyEventArgs e = new ResourceReadyEventArgs();
711 e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View;
714 if (_resourceReadyEventHandler != null)
716 _resourceReadyEventHandler(this, e);
720 private void UpdateImage()
722 if (_url != null && _url != "")
725 { // for nine-patch image
726 _nPatchMap = new PropertyMap();
727 _nPatchMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
728 _nPatchMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url));
729 _nPatchMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border));
730 if (_borderOnly != null) { _nPatchMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
731 if (_synchronousLoading != null) { _nPatchMap.Add(NpatchImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
732 if (_orientationCorrection != null) { _nPatchMap.Add(ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection)); }
733 SetProperty(ImageView.Property.IMAGE, new PropertyValue(_nPatchMap));
734 _imageType = ImageType.Npatch;
736 else if (_synchronousLoading != null || _orientationCorrection != null)
737 { // for normal image, with synchronous loading property
738 PropertyMap imageMap = new PropertyMap();
739 imageMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
740 imageMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
741 if (_synchronousLoading != null) { imageMap.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
742 if (_orientationCorrection != null) { imageMap.Add(ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection)); }
743 SetProperty(ImageView.Property.IMAGE, new PropertyValue(imageMap));
745 _imageType = ImageType.Specific;
748 { // just for normal image
749 SetProperty(ImageView.Property.IMAGE, new PropertyValue(_url));
750 _imageType = ImageType.Normal;
755 //Image property is set and used
756 PropertyMap map = new PropertyMap();
757 map.Insert(ImageVisualProperty.URL, new PropertyValue(""));
758 if (_synchronousLoading != null)
760 map.Insert(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading));
762 if (_orientationCorrection != null)
764 map.Insert(ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection));
770 SetProperty(ImageView.Property.IMAGE, new PropertyValue(map));
771 _imageType = ImageType.Normal;
775 private void OnResourceLoaded(IntPtr view)
777 ResourceLoadedEventArgs e = new ResourceLoadedEventArgs();
778 e.Status = (ResourceLoadingStatusType)Interop.View.View_GetVisualResourceStatus(this.swigCPtr, Property.IMAGE);
780 if (_resourceLoadedEventHandler != null)
782 _resourceLoadedEventHandler(this, e);
787 /// Event arguments of resource ready.
789 /// <since_tizen> 3 </since_tizen>
790 public class ResourceReadyEventArgs : EventArgs
795 /// The view whose resource is ready.
797 /// <since_tizen> 3 </since_tizen>
811 internal class ResourceLoadedEventArgs : EventArgs
813 private ResourceLoadingStatusType status = ResourceLoadingStatusType.Invalid;
814 public ResourceLoadingStatusType Status
827 internal new class Property
829 internal static readonly int RESOURCE_URL = Interop.ImageView.ImageView_Property_RESOURCE_URL_get();
830 internal static readonly int IMAGE = Interop.ImageView.ImageView_Property_IMAGE_get();
831 internal static readonly int PRE_MULTIPLIED_ALPHA = Interop.ImageView.ImageView_Property_PRE_MULTIPLIED_ALPHA_get();
832 internal static readonly int PIXEL_AREA = Interop.ImageView.ImageView_Property_PIXEL_AREA_get();
833 internal static readonly int ACTION_RELOAD = Interop.ImageView.ImageView_IMAGE_VISUAL_ACTION_RELOAD_get();
834 internal static readonly int ACTION_PLAY = Interop.ImageView.ImageView_IMAGE_VISUAL_ACTION_PLAY_get();
835 internal static readonly int ACTION_PAUSE = Interop.ImageView.ImageView_IMAGE_VISUAL_ACTION_PAUSE_get();
836 internal static readonly int ACTION_STOP = Interop.ImageView.ImageView_IMAGE_VISUAL_ACTION_STOP_get();
839 private enum ImageType
842 /// For Normal Image.
847 /// For normal image, with synchronous loading and orientation correction property
852 /// For nine-patch image