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("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 Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.IMAGE).Get(out imageView._url);
53 return imageView._url;
55 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
56 [EditorBrowsable(EditorBrowsableState.Never)]
57 public static readonly BindableProperty ImageProperty = BindableProperty.Create("Image", typeof(PropertyMap), typeof(ImageView), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) =>
59 var imageView = (ImageView)bindable;
62 PropertyMap map = (PropertyMap)newValue;
63 if (imageView.IsCreateByXaml)
65 string url = "", alphaMaskURL="", auxiliaryImageURL = "";
66 string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
67 PropertyValue urlValue = map.Find(NDalic.IMAGE_VISUAL_URL);
69 if (urlValue != null) ret = urlValue.Get(out url);
70 PropertyMap mmap = new PropertyMap();
71 if (ret && url.Contains("*Resource*"))
73 url = url.Replace("*Resource*", resource);
74 mmap.Insert(NDalic.IMAGE_VISUAL_URL, new PropertyValue(url));
78 PropertyValue alphaMaskUrlValue = map.Find(NDalic.IMAGE_VISUAL_ALPHA_MASK_URL);
79 if (alphaMaskUrlValue != null) ret = alphaMaskUrlValue.Get(out alphaMaskURL);
80 if (ret && alphaMaskURL.Contains("*Resource*"))
82 alphaMaskURL = alphaMaskURL.Replace("*Resource*", resource);
83 mmap.Insert(NDalic.IMAGE_VISUAL_URL, new PropertyValue(alphaMaskURL));
87 PropertyValue auxiliaryImageURLValue = map.Find(NDalic.IMAGE_VISUAL_AUXILIARY_IMAGE_URL);
88 if (auxiliaryImageURLValue != null) ret = auxiliaryImageURLValue.Get(out auxiliaryImageURL);
89 if (ret && auxiliaryImageURL.Contains("*Resource*"))
91 auxiliaryImageURL = auxiliaryImageURL.Replace("*Resource*", resource);
92 mmap.Insert(NDalic.IMAGE_VISUAL_AUXILIARY_IMAGE_URL, new PropertyValue(auxiliaryImageURL));
97 if (imageView._border == null)
99 Tizen.NUI.Object.SetProperty(imageView.swigCPtr, ImageView.Property.IMAGE, new Tizen.NUI.PropertyValue(map));
103 defaultValueCreator:(bindable) =>
105 var imageView = (ImageView)bindable;
106 if (imageView._border == null)
108 PropertyMap temp = new PropertyMap();
109 Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.IMAGE).Get(temp);
117 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
118 [EditorBrowsable(EditorBrowsableState.Never)]
119 public static readonly BindableProperty PreMultipliedAlphaProperty = BindableProperty.Create("PreMultipliedAlpha", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
121 var imageView = (ImageView)bindable;
122 if (newValue != null)
124 Tizen.NUI.Object.SetProperty(imageView.swigCPtr, ImageView.Property.PRE_MULTIPLIED_ALPHA, new Tizen.NUI.PropertyValue((bool)newValue));
127 defaultValueCreator:(bindable) =>
129 var imageView = (ImageView)bindable;
131 Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.PRE_MULTIPLIED_ALPHA).Get(out temp);
134 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
135 [EditorBrowsable(EditorBrowsableState.Never)]
136 public static readonly BindableProperty PixelAreaProperty = BindableProperty.Create("PixelArea", typeof(RelativeVector4), typeof(ImageView), new RelativeVector4(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) =>
138 var imageView = (ImageView)bindable;
139 if (newValue != null)
141 Tizen.NUI.Object.SetProperty(imageView.swigCPtr, ImageView.Property.PIXEL_AREA, new Tizen.NUI.PropertyValue((RelativeVector4)newValue));
144 defaultValueCreator:(bindable) =>
146 var imageView = (ImageView)bindable;
147 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
148 Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.PIXEL_AREA).Get(temp);
149 RelativeVector4 relativeTemp = new RelativeVector4(temp.X, temp.Y, temp.Z, temp.W);
152 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
153 [EditorBrowsable(EditorBrowsableState.Never)]
154 public static readonly BindableProperty BorderProperty = BindableProperty.Create("Border", typeof(Rectangle), typeof(ImageView), new Rectangle(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) =>
156 var imageView = (ImageView)bindable;
157 if (newValue != null)
159 imageView._border = (Rectangle)newValue;
160 imageView.UpdateImage();
163 defaultValueCreator:(bindable) =>
165 var imageView = (ImageView)bindable;
166 return imageView._border;
168 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
169 [EditorBrowsable(EditorBrowsableState.Never)]
170 public static readonly BindableProperty BorderOnlyProperty = BindableProperty.Create("BorderOnly", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
172 var imageView = (ImageView)bindable;
173 if (newValue != null)
175 imageView._borderOnly = (bool)newValue;
176 imageView.UpdateImage();
179 defaultValueCreator:(bindable) =>
181 var imageView = (ImageView)bindable;
182 return imageView._borderOnly ?? false;
184 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
185 [EditorBrowsable(EditorBrowsableState.Never)]
186 public static readonly BindableProperty SynchronosLoadingProperty = BindableProperty.Create("SynchronosLoading", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
188 var imageView = (ImageView)bindable;
189 if (newValue != null)
191 imageView._synchronousLoading = (bool)newValue;
192 imageView.UpdateImage();
195 defaultValueCreator:(bindable) =>
197 var imageView = (ImageView)bindable;
198 return imageView._synchronousLoading ?? false;
200 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
201 [EditorBrowsable(EditorBrowsableState.Never)]
202 public static readonly BindableProperty OrientationCorrectionProperty = BindableProperty.Create("OrientationCorrection", typeof(bool), typeof(ImageView), false, propertyChanged: (bindable, oldValue, newValue) =>
204 var imageView = (ImageView)bindable;
205 if (newValue != null)
207 imageView._orientationCorrection = (bool)newValue;
208 imageView.UpdateImage();
211 defaultValueCreator:(bindable) =>
213 var imageView = (ImageView)bindable;
214 return imageView._orientationCorrection ?? false;
217 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
219 internal ImageView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ImageView_SWIGUpcast(cPtr), cMemoryOwn)
221 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
224 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImageView obj)
226 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
231 /// Event arguments of resource ready.
233 /// <since_tizen> 3 </since_tizen>
234 public class ResourceReadyEventArgs : EventArgs
239 /// The view whose resource is ready.
241 /// <since_tizen> 3 </since_tizen>
255 private EventHandler<ResourceReadyEventArgs> _resourceReadyEventHandler;
256 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
257 private delegate void ResourceReadyEventCallbackType(IntPtr data);
258 private ResourceReadyEventCallbackType _resourceReadyEventCallback;
261 /// An event for ResourceReady signal which can be used to subscribe or unsubscribe the event handler.<br />
262 /// This signal is emitted after all resources required by a control are loaded and ready.<br />
263 /// Most resources are only loaded when the control is placed on the stage.<br />
265 /// <since_tizen> 3 </since_tizen>
266 public event EventHandler<ResourceReadyEventArgs> ResourceReady
270 if (_resourceReadyEventHandler == null)
272 _resourceReadyEventCallback = OnResourceReady;
273 ResourceReadySignal(this).Connect(_resourceReadyEventCallback);
276 _resourceReadyEventHandler += value;
281 _resourceReadyEventHandler -= value;
283 if (_resourceReadyEventHandler == null && ResourceReadySignal(this).Empty() == false)
285 ResourceReadySignal(this).Disconnect(_resourceReadyEventCallback);
290 // Callback for View ResourceReady signal
291 private void OnResourceReady(IntPtr data)
293 ResourceReadyEventArgs e = new ResourceReadyEventArgs();
296 e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View;
299 if (_resourceReadyEventHandler != null)
301 _resourceReadyEventHandler(this, e);
306 /// you can override it to clean-up your own resources.
308 /// <param name="type">DisposeTypes</param>
309 /// <since_tizen> 3 </since_tizen>
310 protected override void Dispose(DisposeTypes type)
317 if (type == DisposeTypes.Explicit)
320 //Release your own managed resources here.
321 //You should release all of your own disposable objects here.
324 _nPatchMap?.Dispose();
328 //Release your own unmanaged resources here.
329 //You should not access any managed member here except static instance.
330 //because the execution order of Finalizes is non-deterministic.
332 if (swigCPtr.Handle != global::System.IntPtr.Zero)
337 NDalicPINVOKE.delete_ImageView(swigCPtr);
339 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
345 internal new class Property
347 internal static readonly int RESOURCE_URL = NDalicPINVOKE.ImageView_Property_RESOURCE_URL_get();
348 internal static readonly int IMAGE = NDalicPINVOKE.ImageView_Property_IMAGE_get();
349 internal static readonly int PRE_MULTIPLIED_ALPHA = NDalicPINVOKE.ImageView_Property_PRE_MULTIPLIED_ALPHA_get();
350 internal static readonly int PIXEL_AREA = NDalicPINVOKE.ImageView_Property_PIXEL_AREA_get();
351 internal static readonly int ACTION_RELOAD = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_RELOAD_get();
352 internal static readonly int ACTION_PLAY = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_PLAY_get();
353 internal static readonly int ACTION_PAUSE = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_PAUSE_get();
354 internal static readonly int ACTION_STOP = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_STOP_get();
358 /// Creates an initialized ImageView.
360 /// <since_tizen> 3 </since_tizen>
361 public ImageView() : this(NDalicPINVOKE.ImageView_New__SWIG_0(), true)
363 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
367 /// Creates an initialized ImageView from a URL to an image resource.<br />
368 /// If the string is empty, ImageView will not display anything.<br />
370 /// <param name="url">The URL of the image resource to display.</param>
371 /// <since_tizen> 3 </since_tizen>
372 public ImageView(string url) : this(NDalicPINVOKE.ImageView_New__SWIG_2(url), true)
375 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
378 internal ImageView(string url, Uint16Pair size) : this(NDalicPINVOKE.ImageView_New__SWIG_3(url, Uint16Pair.getCPtr(size)), true)
381 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
386 /// Downcasts a handle to imageView handle.
388 /// Please do not use! this will be deprecated!
389 /// Instead please use as keyword.
390 /// <since_tizen> 3 </since_tizen>
391 [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " +
393 "BaseHandle handle = new ImageView(imagePath); " +
394 "ImageView image = handle as ImageView")]
395 [EditorBrowsable(EditorBrowsableState.Never)]
396 public static ImageView DownCast(BaseHandle handle)
398 ImageView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as ImageView;
399 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
404 /// Sets this ImageView from the given URL.<br />
405 /// If the URL is empty, ImageView will not display anything.<br />
407 /// <param name="url">The URL to the image resource to display.</param>
408 /// <since_tizen> 3 </since_tizen>
409 public void SetImage(string url)
412 NDalicPINVOKE.ImageView_SetImage__SWIG_1(swigCPtr, url);
413 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
415 internal void SetImage(string url, Uint16Pair size)
418 NDalicPINVOKE.ImageView_SetImage__SWIG_2(swigCPtr, url, Uint16Pair.getCPtr(size));
419 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
422 internal ViewResourceReadySignal ResourceReadySignal(View view)
424 ViewResourceReadySignal ret = new ViewResourceReadySignal(NDalicPINVOKE.ResourceReadySignal(View.getCPtr(view)), false);
425 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
430 /// Queries if all resources required by a control are loaded and ready.<br />
431 /// Most resources are only loaded when the control is placed on the stage.<br />
432 /// True if the resources are loaded and ready, false otherwise.<br />
434 /// <since_tizen> 3 </since_tizen>
435 public new bool IsResourceReady()
437 bool ret = NDalicPINVOKE.IsResourceReady(swigCPtr);
438 if (NDalicPINVOKE.SWIGPendingException.Pending)
439 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
444 /// Forcefully reloads the image. All the visuals using this image will reload to the latest image.
446 /// <since_tizen> 5 </since_tizen>
449 this.DoAction(ImageView.Property.IMAGE, Property.ACTION_RELOAD, new PropertyValue(0));
453 /// Plays the animated GIF. This is also the default playback mode.
455 /// <since_tizen> 5 </since_tizen>
458 this.DoAction(ImageView.Property.IMAGE, Property.ACTION_PLAY, new PropertyValue(0));
462 /// Pauses the animated GIF.
464 /// <since_tizen> 5 </since_tizen>
467 this.DoAction(ImageView.Property.IMAGE, Property.ACTION_PAUSE, new PropertyValue(0));
471 /// Stops the animated GIF.
473 /// <since_tizen> 5 </since_tizen>
476 this.DoAction(ImageView.Property.IMAGE, Property.ACTION_STOP, new PropertyValue(0));
480 /// ImageView ResourceUrl, type string.
482 /// <since_tizen> 3 </since_tizen>
483 public string ResourceUrl
487 return (string)GetValue(ResourceUrlProperty);
491 SetValue(ResourceUrlProperty, value);
492 NotifyPropertyChanged();
497 /// This will be deprecated, please use Image instead. <br />
498 /// ImageView ImageMap, type PropertyMap: string if it is a URL, map otherwise.
500 /// <since_tizen> 3 </since_tizen>
501 [Obsolete("Please do not use! This will be deprecated! Please use Image property instead!")]
502 [EditorBrowsable(EditorBrowsableState.Never)]
503 public PropertyMap ImageMap
509 PropertyMap temp = new PropertyMap();
510 GetProperty(ImageView.Property.IMAGE).Get(temp);
522 if (_url != null) { value.Add("url", new PropertyValue(_url)); }
523 SetProperty(ImageView.Property.IMAGE, new Tizen.NUI.PropertyValue(value));
524 NotifyPropertyChanged();
530 /// ImageView Image, type PropertyMap
532 /// <since_tizen> 4 </since_tizen>
533 public PropertyMap Image
539 return (PropertyMap)GetValue(ImageProperty);
550 SetValue(ImageProperty, value);
551 NotifyPropertyChanged();
557 /// ImageView PreMultipliedAlpha, type Boolean.<br />
558 /// Image must be initialized.<br />
560 /// <since_tizen> 3 </since_tizen>
561 public bool PreMultipliedAlpha
565 return (bool)GetValue(PreMultipliedAlphaProperty);
569 SetValue(PreMultipliedAlphaProperty, value);
570 NotifyPropertyChanged();
575 /// ImageView PixelArea, type Vector4 (Animatable property).<br />
576 /// Pixel area is a relative value with the whole image area as [0.0, 0.0, 1.0, 1.0].<br />
578 /// <since_tizen> 3 </since_tizen>
579 public RelativeVector4 PixelArea
583 return (RelativeVector4)GetValue(PixelAreaProperty);
587 SetValue(PixelAreaProperty, value);
588 NotifyPropertyChanged();
593 /// The border of the image in the order: left, right, bottom, top.<br />
594 /// If set, ImageMap will be ignored.<br />
595 /// For N-Patch images only.<br />
598 /// <since_tizen> 3 </since_tizen>
599 public Rectangle Border
603 return (Rectangle)GetValue(BorderProperty);
607 SetValue(BorderProperty, value);
608 NotifyPropertyChanged();
613 /// Gets or sets whether to draw the borders only (if true).<br />
614 /// If not specified, the default is false.<br />
615 /// For N-Patch images only.<br />
618 /// <since_tizen> 3 </since_tizen>
619 public bool BorderOnly
623 return (bool)GetValue(BorderOnlyProperty);
627 SetValue(BorderOnlyProperty, value);
628 NotifyPropertyChanged();
633 /// Gets or sets whether to synchronos loading the resourceurl of image.<br />
635 /// <since_tizen> 3 </since_tizen>
636 public bool SynchronosLoading
640 return (bool)GetValue(SynchronosLoadingProperty);
644 SetValue(SynchronosLoadingProperty, value);
645 NotifyPropertyChanged();
650 /// Gets or sets whether to automatically correct the orientation of an image.<br />
652 /// <since_tizen> 5 </since_tizen>
653 public bool OrientationCorrection
657 return (bool)GetValue(OrientationCorrectionProperty);
661 SetValue(OrientationCorrectionProperty, value);
662 NotifyPropertyChanged();
668 /// Gets the loading state of the visual resource.
670 /// <since_tizen> 5 </since_tizen>
671 public ImageView.LoadingStatusType LoadingStatus
675 return (ImageView.LoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(swigCPtr, (int)Property.IMAGE);
680 /// Enumeration for LoadingStatus of image.
682 /// <since_tizen> 5 </since_tizen>
683 public enum LoadingStatusType
686 /// Loading preparing status.
688 /// <since_tizen> 5 </since_tizen>
691 /// Loading ready status.
693 /// <since_tizen> 5 </since_tizen>
696 /// Loading failed status.
698 /// <since_tizen> 5 </since_tizen>
703 private void UpdateImage()
708 { // for nine-patch image
709 _nPatchMap = new PropertyMap();
710 _nPatchMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
711 _nPatchMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url));
712 _nPatchMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border));
713 if (_borderOnly != null) { _nPatchMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
714 if (_synchronousLoading != null) { _nPatchMap.Add(NpatchImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
715 if (_orientationCorrection != null) { _nPatchMap.Add(ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection)); }
716 SetProperty(ImageView.Property.IMAGE, new PropertyValue(_nPatchMap));
718 else if (_synchronousLoading != null || _orientationCorrection != null)
719 { // for normal image, with synchronous loading property
720 PropertyMap imageMap = new PropertyMap();
721 imageMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
722 imageMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
723 if (_synchronousLoading != null) { imageMap.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
724 if (_orientationCorrection != null) { imageMap.Add(ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection)); }
725 SetProperty(ImageView.Property.IMAGE, new PropertyValue(imageMap));
728 { // just for normal image
729 SetProperty(ImageView.Property.IMAGE, new PropertyValue(_url));
734 private Rectangle _border = null;
735 private PropertyMap _nPatchMap = null;
736 private bool? _synchronousLoading = null;
737 private bool? _borderOnly = null;
738 private string _url = null;
739 private bool? _orientationCorrection = null;
742 internal class ResourceLoadedEventArgs : EventArgs
744 private ResourceLoadingStatusType status = ResourceLoadingStatusType.Invalid;
745 public ResourceLoadingStatusType Status
758 private EventHandler<ResourceLoadedEventArgs> _resourceLoadedEventHandler;
759 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
760 private delegate void _resourceLoadedCallbackType(IntPtr view);
761 private _resourceLoadedCallbackType _resourceLoadedCallback;
763 internal event EventHandler<ResourceLoadedEventArgs> ResourceLoaded
767 if (_resourceLoadedEventHandler == null)
769 _resourceLoadedCallback = OnResourceLoaded;
770 this.ResourceReadySignal(this).Connect(_resourceLoadedCallback);
773 _resourceLoadedEventHandler += value;
777 _resourceLoadedEventHandler -= value;
779 if (_resourceLoadedEventHandler == null && this.ResourceReadySignal(this).Empty() == false)
781 this.ResourceReadySignal(this).Disconnect(_resourceLoadedCallback);
786 private void OnResourceLoaded(IntPtr view)
788 ResourceLoadedEventArgs e = new ResourceLoadedEventArgs();
789 e.Status = (ResourceLoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(this.swigCPtr, Property.IMAGE);
791 if (_resourceLoadedEventHandler != null)
793 _resourceLoadedEventHandler(this, e);
797 internal ResourceLoadingStatusType GetResourceStatus()
799 return (ResourceLoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(this.swigCPtr, Property.IMAGE);