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;
37 imageView._url = (string)newValue;
39 if (imageView._url != null)
41 if (imageView.IsCreateByXaml && imageView._url.Contains("*Resource*"))
43 string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
44 imageView._url = imageView._url.Replace("*Resource*", resource);
47 imageView.UpdateImage();
49 defaultValueCreator:(bindable) =>
51 var imageView = (ImageView)bindable;
52 if(imageView._url != null)
54 Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.IMAGE).Get(out imageView._url);
56 return imageView._url;
58 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
59 [EditorBrowsable(EditorBrowsableState.Never)]
60 public static readonly BindableProperty ImageProperty = BindableProperty.Create("Image", typeof(PropertyMap), typeof(ImageView), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
62 var imageView = (ImageView)bindable;
65 PropertyMap map = (PropertyMap)newValue;
66 if (imageView.IsCreateByXaml)
68 string url = "", alphaMaskURL="", auxiliaryImageURL = "";
69 string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
70 PropertyValue urlValue = map.Find(NDalic.IMAGE_VISUAL_URL);
72 if (urlValue != null) ret = urlValue.Get(out url);
73 PropertyMap mmap = new PropertyMap();
74 if (ret && url.Contains("*Resource*"))
76 url = url.Replace("*Resource*", resource);
77 mmap.Insert(NDalic.IMAGE_VISUAL_URL, new PropertyValue(url));
81 PropertyValue alphaMaskUrlValue = map.Find(NDalic.IMAGE_VISUAL_ALPHA_MASK_URL);
82 if (alphaMaskUrlValue != null) ret = alphaMaskUrlValue.Get(out alphaMaskURL);
83 if (ret && alphaMaskURL.Contains("*Resource*"))
85 alphaMaskURL = alphaMaskURL.Replace("*Resource*", resource);
86 mmap.Insert(NDalic.IMAGE_VISUAL_URL, new PropertyValue(alphaMaskURL));
90 PropertyValue auxiliaryImageURLValue = map.Find(NDalic.IMAGE_VISUAL_AUXILIARY_IMAGE_URL);
91 if (auxiliaryImageURLValue != null) ret = auxiliaryImageURLValue.Get(out auxiliaryImageURL);
92 if (ret && auxiliaryImageURL.Contains("*Resource*"))
94 auxiliaryImageURL = auxiliaryImageURL.Replace("*Resource*", resource);
95 mmap.Insert(NDalic.IMAGE_VISUAL_AUXILIARY_IMAGE_URL, new PropertyValue(auxiliaryImageURL));
100 if (imageView._border == null)
102 Tizen.NUI.Object.SetProperty(imageView.swigCPtr, ImageView.Property.IMAGE, new Tizen.NUI.PropertyValue(map));
106 defaultValueCreator:(bindable) =>
108 var imageView = (ImageView)bindable;
109 if (imageView._border == null)
111 PropertyMap temp = new PropertyMap();
112 Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.IMAGE).Get(temp);
120 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
121 [EditorBrowsable(EditorBrowsableState.Never)]
122 public static readonly BindableProperty PreMultipliedAlphaProperty = BindableProperty.Create("PreMultipliedAlpha", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
124 var imageView = (ImageView)bindable;
125 if (newValue != null)
127 Tizen.NUI.Object.SetProperty(imageView.swigCPtr, ImageView.Property.PRE_MULTIPLIED_ALPHA, new Tizen.NUI.PropertyValue((bool)newValue));
130 defaultValueCreator:(bindable) =>
132 var imageView = (ImageView)bindable;
134 Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.PRE_MULTIPLIED_ALPHA).Get(out temp);
137 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
138 [EditorBrowsable(EditorBrowsableState.Never)]
139 public static readonly BindableProperty PixelAreaProperty = BindableProperty.Create("PixelArea", typeof(RelativeVector4), typeof(ImageView), new RelativeVector4(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) =>
141 var imageView = (ImageView)bindable;
142 if (newValue != null)
144 Tizen.NUI.Object.SetProperty(imageView.swigCPtr, ImageView.Property.PIXEL_AREA, new Tizen.NUI.PropertyValue((RelativeVector4)newValue));
147 defaultValueCreator:(bindable) =>
149 var imageView = (ImageView)bindable;
150 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
151 Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.PIXEL_AREA).Get(temp);
152 RelativeVector4 relativeTemp = new RelativeVector4(temp.X, temp.Y, temp.Z, temp.W);
155 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
156 [EditorBrowsable(EditorBrowsableState.Never)]
157 public static readonly BindableProperty BorderProperty = BindableProperty.Create("Border", typeof(Rectangle), typeof(ImageView), new Rectangle(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) =>
159 var imageView = (ImageView)bindable;
160 if (newValue != null)
162 imageView._border = (Rectangle)newValue;
163 imageView.UpdateImage();
166 defaultValueCreator:(bindable) =>
168 var imageView = (ImageView)bindable;
169 return imageView._border;
171 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
172 [EditorBrowsable(EditorBrowsableState.Never)]
173 public static readonly BindableProperty BorderOnlyProperty = BindableProperty.Create("BorderOnly", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
175 var imageView = (ImageView)bindable;
176 if (newValue != null)
178 imageView._borderOnly = (bool)newValue;
179 imageView.UpdateImage();
182 defaultValueCreator:(bindable) =>
184 var imageView = (ImageView)bindable;
185 return imageView._borderOnly ?? false;
187 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
188 [EditorBrowsable(EditorBrowsableState.Never)]
189 public static readonly BindableProperty SynchronosLoadingProperty = BindableProperty.Create("SynchronosLoading", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
191 var imageView = (ImageView)bindable;
192 if (newValue != null)
194 imageView._synchronousLoading = (bool)newValue;
195 imageView.UpdateImage();
198 defaultValueCreator:(bindable) =>
200 var imageView = (ImageView)bindable;
201 return imageView._synchronousLoading ?? false;
203 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
204 [EditorBrowsable(EditorBrowsableState.Never)]
205 public static readonly BindableProperty OrientationCorrectionProperty = BindableProperty.Create("OrientationCorrection", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
207 var imageView = (ImageView)bindable;
208 if (newValue != null)
210 imageView._orientationCorrection = (bool)newValue;
211 imageView.UpdateImage();
214 defaultValueCreator:(bindable) =>
216 var imageView = (ImageView)bindable;
217 return imageView._orientationCorrection ?? false;
220 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
222 internal ImageView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ImageView_SWIGUpcast(cPtr), cMemoryOwn)
224 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
227 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImageView obj)
229 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
234 /// Event arguments of resource ready.
236 /// <since_tizen> 3 </since_tizen>
237 public class ResourceReadyEventArgs : EventArgs
242 /// The view whose resource is ready.
244 /// <since_tizen> 3 </since_tizen>
258 private EventHandler<ResourceReadyEventArgs> _resourceReadyEventHandler;
259 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
260 private delegate void ResourceReadyEventCallbackType(IntPtr data);
261 private ResourceReadyEventCallbackType _resourceReadyEventCallback;
264 /// An event for ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
265 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
266 /// Most resources are only loaded when the control is placed on the stage.<br />
268 /// <since_tizen> 3 </since_tizen>
269 public event EventHandler<ResourceReadyEventArgs> ResourceReady
273 if (_resourceReadyEventHandler == null)
275 _resourceReadyEventCallback = OnResourceReady;
276 ResourceReadySignal(this).Connect(_resourceReadyEventCallback);
279 _resourceReadyEventHandler += value;
284 _resourceReadyEventHandler -= value;
286 if (_resourceReadyEventHandler == null && ResourceReadySignal(this).Empty() == false)
288 ResourceReadySignal(this).Disconnect(_resourceReadyEventCallback);
293 // Callback for View ResourceReady signal
294 private void OnResourceReady(IntPtr data)
296 ResourceReadyEventArgs e = new ResourceReadyEventArgs();
299 e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View;
302 if (_resourceReadyEventHandler != null)
304 _resourceReadyEventHandler(this, e);
309 /// you can override it to clean-up your own resources.
311 /// <param name="type">DisposeTypes</param>
312 /// <since_tizen> 3 </since_tizen>
313 protected override void Dispose(DisposeTypes type)
320 if (type == DisposeTypes.Explicit)
323 //Release your own managed resources here.
324 //You should release all of your own disposable objects here.
327 _nPatchMap?.Dispose();
331 //Release your own unmanaged resources here.
332 //You should not access any managed member here except static instance.
333 //because the execution order of Finalizes is non-deterministic.
335 if (swigCPtr.Handle != global::System.IntPtr.Zero)
340 NDalicPINVOKE.delete_ImageView(swigCPtr);
342 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
348 internal new class Property
350 internal static readonly int RESOURCE_URL = NDalicPINVOKE.ImageView_Property_RESOURCE_URL_get();
351 internal static readonly int IMAGE = NDalicPINVOKE.ImageView_Property_IMAGE_get();
352 internal static readonly int PRE_MULTIPLIED_ALPHA = NDalicPINVOKE.ImageView_Property_PRE_MULTIPLIED_ALPHA_get();
353 internal static readonly int PIXEL_AREA = NDalicPINVOKE.ImageView_Property_PIXEL_AREA_get();
354 internal static readonly int ACTION_RELOAD = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_RELOAD_get();
355 internal static readonly int ACTION_PLAY = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_PLAY_get();
356 internal static readonly int ACTION_PAUSE = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_PAUSE_get();
357 internal static readonly int ACTION_STOP = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_STOP_get();
361 /// Creates an initialized ImageView.
363 /// <since_tizen> 3 </since_tizen>
364 public ImageView() : this(NDalicPINVOKE.ImageView_New__SWIG_0(), true)
366 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
370 /// Creates an initialized ImageView from a URL to an image resource.<br />
371 /// If the string is empty, ImageView will not display anything.<br />
373 /// <param name="url">The URL of the image resource to display.</param>
374 /// <since_tizen> 3 </since_tizen>
375 public ImageView(string url) : this(NDalicPINVOKE.ImageView_New__SWIG_2(url), true)
378 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
381 internal ImageView(string url, Uint16Pair size) : this(NDalicPINVOKE.ImageView_New__SWIG_3(url, Uint16Pair.getCPtr(size)), true)
384 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
389 /// Downcasts a handle to imageView handle.
391 /// Please do not use! this will be deprecated!
392 /// Instead please use as keyword.
393 /// <since_tizen> 3 </since_tizen>
394 [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " +
396 "BaseHandle handle = new ImageView(imagePath); " +
397 "ImageView image = handle as ImageView")]
398 [EditorBrowsable(EditorBrowsableState.Never)]
399 public static ImageView DownCast(BaseHandle handle)
401 ImageView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as ImageView;
402 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
407 /// Sets this ImageView from the given URL.<br />
408 /// If the URL is empty, ImageView will not display anything.<br />
410 /// <param name="url">The URL to the image resource to display.</param>
411 /// <since_tizen> 3 </since_tizen>
412 public void SetImage(string url)
415 NDalicPINVOKE.ImageView_SetImage__SWIG_1(swigCPtr, url);
416 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
418 internal void SetImage(string url, Uint16Pair size)
421 NDalicPINVOKE.ImageView_SetImage__SWIG_2(swigCPtr, url, Uint16Pair.getCPtr(size));
422 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
425 internal ViewResourceReadySignal ResourceReadySignal(View view)
427 ViewResourceReadySignal ret = new ViewResourceReadySignal(NDalicPINVOKE.ResourceReadySignal(View.getCPtr(view)), false);
428 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
433 /// Queries if all resources required by a control are loaded and ready.<br />
434 /// Most resources are only loaded when the control is placed on the stage.<br />
435 /// True if the resources are loaded and ready, false otherwise.<br />
437 /// <since_tizen> 3 </since_tizen>
438 public new bool IsResourceReady()
440 bool ret = NDalicPINVOKE.IsResourceReady(swigCPtr);
441 if (NDalicPINVOKE.SWIGPendingException.Pending)
442 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
447 /// Forcefully reloads the image. All the visuals using this image will reload to the latest image.
449 /// <since_tizen> 5 </since_tizen>
452 this.DoAction(ImageView.Property.IMAGE, Property.ACTION_RELOAD, new PropertyValue(0));
456 /// Plays the animated GIF. This is also the default playback mode.
458 /// <since_tizen> 5 </since_tizen>
461 this.DoAction(ImageView.Property.IMAGE, Property.ACTION_PLAY, new PropertyValue(0));
465 /// Pauses the animated GIF.
467 /// <since_tizen> 5 </since_tizen>
470 this.DoAction(ImageView.Property.IMAGE, Property.ACTION_PAUSE, new PropertyValue(0));
474 /// Stops the animated GIF.
476 /// <since_tizen> 5 </since_tizen>
479 this.DoAction(ImageView.Property.IMAGE, Property.ACTION_STOP, new PropertyValue(0));
483 /// ImageView ResourceUrl, type string.
485 /// <since_tizen> 3 </since_tizen>
486 public string ResourceUrl
490 return (string)GetValue(ResourceUrlProperty);
494 SetValue(ResourceUrlProperty, value);
495 NotifyPropertyChanged();
500 /// This will be deprecated, please use Image instead. <br />
501 /// ImageView ImageMap, type PropertyMap: string if it is a URL, map otherwise.
503 /// <since_tizen> 3 </since_tizen>
504 [Obsolete("Please do not use! This will be deprecated! Please use Image property instead!")]
505 [EditorBrowsable(EditorBrowsableState.Never)]
506 public PropertyMap ImageMap
512 PropertyMap temp = new PropertyMap();
513 GetProperty(ImageView.Property.IMAGE).Get(temp);
525 if (_url != null) { value.Add("url", new PropertyValue(_url)); }
526 SetProperty(ImageView.Property.IMAGE, new Tizen.NUI.PropertyValue(value));
527 NotifyPropertyChanged();
533 /// ImageView Image, type PropertyMap
535 /// <since_tizen> 4 </since_tizen>
536 public PropertyMap Image
542 return (PropertyMap)GetValue(ImageProperty);
553 SetValue(ImageProperty, value);
554 NotifyPropertyChanged();
560 /// ImageView PreMultipliedAlpha, type Boolean.<br />
561 /// Image must be initialized.<br />
563 /// <since_tizen> 3 </since_tizen>
564 public bool PreMultipliedAlpha
568 return (bool)GetValue(PreMultipliedAlphaProperty);
572 SetValue(PreMultipliedAlphaProperty, value);
573 NotifyPropertyChanged();
578 /// ImageView PixelArea, type Vector4 (Animatable property).<br />
579 /// Pixel area is a relative value with the whole image area as [0.0, 0.0, 1.0, 1.0].<br />
581 /// <since_tizen> 3 </since_tizen>
582 public RelativeVector4 PixelArea
586 return (RelativeVector4)GetValue(PixelAreaProperty);
590 SetValue(PixelAreaProperty, value);
591 NotifyPropertyChanged();
596 /// The border of the image in the order: left, right, bottom, top.<br />
597 /// If set, ImageMap will be ignored.<br />
598 /// For N-Patch images only.<br />
601 /// <since_tizen> 3 </since_tizen>
602 public Rectangle Border
606 return (Rectangle)GetValue(BorderProperty);
610 SetValue(BorderProperty, value);
611 NotifyPropertyChanged();
616 /// Gets or sets whether to draw the borders only (if true).<br />
617 /// If not specified, the default is false.<br />
618 /// For N-Patch images only.<br />
621 /// <since_tizen> 3 </since_tizen>
622 public bool BorderOnly
626 return (bool)GetValue(BorderOnlyProperty);
630 SetValue(BorderOnlyProperty, value);
631 NotifyPropertyChanged();
636 /// Gets or sets whether to synchronos loading the resourceurl of image.<br />
638 /// <since_tizen> 3 </since_tizen>
639 public bool SynchronosLoading
643 return (bool)GetValue(SynchronosLoadingProperty);
647 SetValue(SynchronosLoadingProperty, value);
648 NotifyPropertyChanged();
653 /// Gets or sets whether to automatically correct the orientation of an image.<br />
655 /// <since_tizen> 5 </since_tizen>
656 public bool OrientationCorrection
660 return (bool)GetValue(OrientationCorrectionProperty);
664 SetValue(OrientationCorrectionProperty, value);
665 NotifyPropertyChanged();
671 /// Gets the loading state of the visual resource.
673 /// <since_tizen> 5 </since_tizen>
674 public ImageView.LoadingStatusType LoadingStatus
678 return (ImageView.LoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(swigCPtr, (int)Property.IMAGE);
683 /// Enumeration for LoadingStatus of image.
685 /// <since_tizen> 5 </since_tizen>
686 public enum LoadingStatusType
689 /// Loading preparing status.
691 /// <since_tizen> 5 </since_tizen>
694 /// Loading ready status.
696 /// <since_tizen> 5 </since_tizen>
699 /// Loading failed status.
701 /// <since_tizen> 5 </since_tizen>
706 private void UpdateImage()
711 { // for nine-patch image
712 _nPatchMap = new PropertyMap();
713 _nPatchMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
714 _nPatchMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url));
715 _nPatchMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border));
716 if (_borderOnly != null) { _nPatchMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
717 if (_synchronousLoading != null) { _nPatchMap.Add(NpatchImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
718 if (_orientationCorrection != null) { _nPatchMap.Add(ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection)); }
719 SetProperty(ImageView.Property.IMAGE, new PropertyValue(_nPatchMap));
721 else if (_synchronousLoading != null || _orientationCorrection != null)
722 { // for normal image, with synchronous loading property
723 PropertyMap imageMap = new PropertyMap();
724 imageMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
725 imageMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
726 if (_synchronousLoading != null) { imageMap.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
727 if (_orientationCorrection != null) { imageMap.Add(ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection)); }
728 SetProperty(ImageView.Property.IMAGE, new PropertyValue(imageMap));
731 { // just for normal image
732 SetProperty(ImageView.Property.IMAGE, new PropertyValue(_url));
737 SetProperty(ImageView.Property.IMAGE, new PropertyValue(""));
741 private Rectangle _border = null;
742 private PropertyMap _nPatchMap = null;
743 private bool? _synchronousLoading = null;
744 private bool? _borderOnly = null;
745 private string _url = null;
746 private bool? _orientationCorrection = null;
749 internal class ResourceLoadedEventArgs : EventArgs
751 private ResourceLoadingStatusType status = ResourceLoadingStatusType.Invalid;
752 public ResourceLoadingStatusType Status
765 private EventHandler<ResourceLoadedEventArgs> _resourceLoadedEventHandler;
766 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
767 private delegate void _resourceLoadedCallbackType(IntPtr view);
768 private _resourceLoadedCallbackType _resourceLoadedCallback;
770 internal event EventHandler<ResourceLoadedEventArgs> ResourceLoaded
774 if (_resourceLoadedEventHandler == null)
776 _resourceLoadedCallback = OnResourceLoaded;
777 this.ResourceReadySignal(this).Connect(_resourceLoadedCallback);
780 _resourceLoadedEventHandler += value;
784 _resourceLoadedEventHandler -= value;
786 if (_resourceLoadedEventHandler == null && this.ResourceReadySignal(this).Empty() == false)
788 this.ResourceReadySignal(this).Disconnect(_resourceLoadedCallback);
793 private void OnResourceLoaded(IntPtr view)
795 ResourceLoadedEventArgs e = new ResourceLoadedEventArgs();
796 e.Status = (ResourceLoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(this.swigCPtr, Property.IMAGE);
798 if (_resourceLoadedEventHandler != null)
800 _resourceLoadedEventHandler(this, e);
804 internal ResourceLoadingStatusType GetResourceStatus()
806 return (ResourceLoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(this.swigCPtr, Property.IMAGE);