a6f142a4dae427440b137b66cf870917e9297e7b
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / ViewInternal.cs
1 /*
2  * Copyright(c) 2019 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 using System;
19 using System.ComponentModel;
20 using System.Collections.Generic;
21 using System.IO;
22 using System.Runtime.InteropServices;
23 using Tizen.NUI.Binding;
24 using Tizen.NUI.Xaml;
25
26 namespace Tizen.NUI.BaseComponents
27 {
28     /// <summary>
29     /// View is the base class for all views.
30     /// </summary>
31     /// <since_tizen> 3 </since_tizen>
32     public partial class View
33     {
34         private MergedStyle mergedStyle = null;
35         private ViewSelectorData selectorData;
36         internal string styleName;
37
38         internal MergedStyle _mergedStyle
39         {
40             get
41             {
42                 if (null == mergedStyle)
43                 {
44                     mergedStyle = new MergedStyle(GetType(), this);
45                 }
46
47                 return mergedStyle;
48             }
49         }
50
51         /// <summary>
52         /// The color mode of View.
53         /// This specifies whether the View uses its own color, or inherits its parent color.
54         /// The default is ColorMode.UseOwnMultiplyParentColor.
55         /// </summary>
56         internal ColorMode ColorMode
57         {
58             set
59             {
60                 SetColorMode(value);
61             }
62             get
63             {
64                 return GetColorMode();
65             }
66         }
67
68         internal float WorldPositionX
69         {
70             get
71             {
72                 float temp = 0.0f;
73                 GetProperty(View.Property.WORLD_POSITION_X).Get(out temp);
74                 return temp;
75             }
76         }
77
78         internal float WorldPositionY
79         {
80             get
81             {
82                 float temp = 0.0f;
83                 GetProperty(View.Property.WORLD_POSITION_Y).Get(out temp);
84                 return temp;
85             }
86         }
87
88         internal float WorldPositionZ
89         {
90             get
91             {
92                 float temp = 0.0f;
93                 GetProperty(View.Property.WORLD_POSITION_Z).Get(out temp);
94                 return temp;
95             }
96         }
97
98         internal bool FocusState
99         {
100             get
101             {
102                 return IsKeyboardFocusable();
103             }
104             set
105             {
106                 SetKeyboardFocusable(value);
107             }
108         }
109
110         internal void SetLayout(LayoutItem layout)
111         {
112             Window.Instance.LayoutController.CreateProcessCallback();
113             _layout = layout;
114             _layout?.AttachToOwner(this);
115             _layout?.RequestLayout();
116         }
117
118         /// <summary>
119         /// Stores the calculated width value and its ModeType. Width component.
120         /// </summary>
121         internal MeasureSpecification MeasureSpecificationWidth
122         {
123             set
124             {
125                 _measureSpecificationWidth = value;
126                 _layout?.RequestLayout();
127             }
128             get
129             {
130                 return _measureSpecificationWidth;
131             }
132         }
133
134         /// <summary>
135         /// Stores the calculated width value and its ModeType. Height component.
136         /// </summary>
137         internal MeasureSpecification MeasureSpecificationHeight
138         {
139             set
140             {
141                 _measureSpecificationHeight = value;
142                 _layout?.RequestLayout();
143             }
144             get
145             {
146                 return _measureSpecificationHeight;
147             }
148         }
149
150         internal void AttachTransitionsToChildren(LayoutTransition transition)
151         {
152             // Iterate children, adding the transition unless a transition
153             // for the same condition and property has already been
154             // explicitly added.
155             foreach (View view in Children)
156             {
157                 LayoutTransitionsHelper.AddTransitionForCondition(view.LayoutTransitions, transition.Condition, transition, false);
158             }
159         }
160
161         internal float ParentOriginX
162         {
163             get
164             {
165                 float temp = 0.0f;
166                 GetProperty(View.Property.PARENT_ORIGIN_X).Get(out temp);
167                 return temp;
168             }
169             set
170             {
171                 SetProperty(View.Property.PARENT_ORIGIN_X, new Tizen.NUI.PropertyValue(value));
172                 NotifyPropertyChanged();
173             }
174         }
175
176         internal float ParentOriginY
177         {
178             get
179             {
180                 float temp = 0.0f;
181                 GetProperty(View.Property.PARENT_ORIGIN_Y).Get(out temp);
182                 return temp;
183             }
184             set
185             {
186                 SetProperty(View.Property.PARENT_ORIGIN_Y, new Tizen.NUI.PropertyValue(value));
187                 NotifyPropertyChanged();
188             }
189         }
190
191         internal float ParentOriginZ
192         {
193             get
194             {
195                 float temp = 0.0f;
196                 GetProperty(View.Property.PARENT_ORIGIN_Z).Get(out temp);
197                 return temp;
198             }
199             set
200             {
201                 SetProperty(View.Property.PARENT_ORIGIN_Z, new Tizen.NUI.PropertyValue(value));
202                 NotifyPropertyChanged();
203             }
204         }
205
206         internal float PivotPointX
207         {
208             get
209             {
210                 float temp = 0.0f;
211                 GetProperty(View.Property.ANCHOR_POINT_X).Get(out temp);
212                 return temp;
213             }
214             set
215             {
216                 SetProperty(View.Property.ANCHOR_POINT_X, new Tizen.NUI.PropertyValue(value));
217             }
218         }
219
220         internal float PivotPointY
221         {
222             get
223             {
224                 float temp = 0.0f;
225                 GetProperty(View.Property.ANCHOR_POINT_Y).Get(out temp);
226                 return temp;
227             }
228             set
229             {
230                 SetProperty(View.Property.ANCHOR_POINT_Y, new Tizen.NUI.PropertyValue(value));
231             }
232         }
233
234         internal float PivotPointZ
235         {
236             get
237             {
238                 float temp = 0.0f;
239                 GetProperty(View.Property.ANCHOR_POINT_Z).Get(out temp);
240                 return temp;
241             }
242             set
243             {
244                 SetProperty(View.Property.ANCHOR_POINT_Z, new Tizen.NUI.PropertyValue(value));
245             }
246         }
247
248         internal Matrix WorldMatrix
249         {
250             get
251             {
252                 Matrix temp = new Matrix();
253                 GetProperty(View.Property.WORLD_MATRIX).Get(temp);
254                 return temp;
255             }
256         }
257
258         /// <summary>
259         /// Indicates that this View should listen Touch event to handle its ControlState.
260         /// </summary>
261         private bool enableControlState = false;
262
263         private int LeftFocusableViewId
264         {
265             get
266             {
267                 int temp = 0;
268                 GetProperty(View.Property.LEFT_FOCUSABLE_VIEW_ID).Get(out temp);
269                 return temp;
270             }
271             set
272             {
273                 SetProperty(View.Property.LEFT_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value));
274             }
275         }
276
277         private int RightFocusableViewId
278         {
279             get
280             {
281                 int temp = 0;
282                 GetProperty(View.Property.RIGHT_FOCUSABLE_VIEW_ID).Get(out temp);
283                 return temp;
284             }
285             set
286             {
287                 SetProperty(View.Property.RIGHT_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value));
288             }
289         }
290
291         private int UpFocusableViewId
292         {
293             get
294             {
295                 int temp = 0;
296                 GetProperty(View.Property.UP_FOCUSABLE_VIEW_ID).Get(out temp);
297                 return temp;
298             }
299             set
300             {
301                 SetProperty(View.Property.UP_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value));
302             }
303         }
304
305         private int DownFocusableViewId
306         {
307             get
308             {
309                 int temp = 0;
310                 GetProperty(View.Property.DOWN_FOCUSABLE_VIEW_ID).Get(out temp);
311                 return temp;
312             }
313             set
314             {
315                 SetProperty(View.Property.DOWN_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value));
316             }
317         }
318
319         private ViewSelectorData SelectorData
320         {
321             get
322             {
323                 if (selectorData == null)
324                 {
325                     selectorData = new ViewSelectorData();
326                 }
327                 return selectorData;
328             }
329         }
330
331         internal void Raise()
332         {
333             var parentChildren = GetParent()?.Children;
334
335             if (parentChildren != null)
336             {
337                 int currentIndex = parentChildren.IndexOf(this);
338
339                 // If the view is not already the last item in the list.
340                 if (currentIndex >= 0 && currentIndex < parentChildren.Count - 1)
341                 {
342                     View temp = parentChildren[currentIndex + 1];
343                     parentChildren[currentIndex + 1] = this;
344                     parentChildren[currentIndex] = temp;
345
346                     Interop.NDalic.Raise(swigCPtr);
347                     if (NDalicPINVOKE.SWIGPendingException.Pending)
348                         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
349                 }
350             }
351         }
352
353         internal void Lower()
354         {
355             var parentChildren = GetParent()?.Children;
356
357             if (parentChildren != null)
358             {
359                 int currentIndex = parentChildren.IndexOf(this);
360
361                 // If the view is not already the first item in the list.
362                 if (currentIndex > 0 && currentIndex < parentChildren.Count)
363                 {
364                     View temp = parentChildren[currentIndex - 1];
365                     parentChildren[currentIndex - 1] = this;
366                     parentChildren[currentIndex] = temp;
367
368                     Interop.NDalic.Lower(swigCPtr);
369                     if (NDalicPINVOKE.SWIGPendingException.Pending)
370                         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
371                 }
372             }
373         }
374
375         /// <summary>
376         /// Raises the view to above the target view.
377         /// </summary>
378         /// <remarks>The sibling order of views within the parent will be updated automatically.
379         /// Views on the level above the target view will still be shown above this view.
380         /// Raising this view above views with the same sibling order as each other will raise this view above them.
381         /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion.
382         /// </remarks>
383         /// <param name="target">Will be raised above this view.</param>
384         internal void RaiseAbove(View target)
385         {
386             var parentChildren = GetParent()?.Children;
387
388             if (parentChildren != null)
389             {
390                 int currentIndex = parentChildren.IndexOf(this);
391                 int targetIndex = parentChildren.IndexOf(target);
392
393                 if (currentIndex < 0 || targetIndex < 0 ||
394                     currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
395                 {
396                     NUILog.Error("index should be bigger than 0 and less than children of layer count");
397                     return;
398                 }
399                 // If the currentIndex is less than the target index and the target has the same parent.
400                 if (currentIndex < targetIndex)
401                 {
402                     parentChildren.Remove(this);
403                     parentChildren.Insert(targetIndex, this);
404
405                     Interop.NDalic.RaiseAbove(swigCPtr, View.getCPtr(target));
406                     if (NDalicPINVOKE.SWIGPendingException.Pending)
407                         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
408                 }
409             }
410
411         }
412
413         /// <summary>
414         /// Lowers the view to below the target view.
415         /// </summary>
416         /// <remarks>The sibling order of views within the parent will be updated automatically.
417         /// Lowering this view below views with the same sibling order as each other will lower this view above them.
418         /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion.
419         /// </remarks>
420         /// <param name="target">Will be lowered below this view.</param>
421         internal void LowerBelow(View target)
422         {
423             var parentChildren = GetParent()?.Children;
424
425             if (parentChildren != null)
426             {
427                 int currentIndex = parentChildren.IndexOf(this);
428                 int targetIndex = parentChildren.IndexOf(target);
429                 if (currentIndex < 0 || targetIndex < 0 ||
430                    currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count)
431                 {
432                     NUILog.Error("index should be bigger than 0 and less than children of layer count");
433                     return;
434                 }
435
436                 // If the currentIndex is not already the 0th index and the target has the same parent.
437                 if ((currentIndex != 0) && (targetIndex != -1) &&
438                     (currentIndex > targetIndex))
439                 {
440                     parentChildren.Remove(this);
441                     parentChildren.Insert(targetIndex, this);
442
443                     Interop.NDalic.LowerBelow(swigCPtr, View.getCPtr(target));
444                     if (NDalicPINVOKE.SWIGPendingException.Pending)
445                         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
446                 }
447             }
448
449         }
450
451         internal string GetName()
452         {
453             string ret = Interop.Actor.Actor_GetName(swigCPtr);
454             if (NDalicPINVOKE.SWIGPendingException.Pending)
455                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
456             return ret;
457         }
458
459         internal void SetName(string name)
460         {
461             Interop.Actor.Actor_SetName(swigCPtr, name);
462             if (NDalicPINVOKE.SWIGPendingException.Pending)
463                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
464         }
465
466         internal uint GetId()
467         {
468             uint ret = Interop.Actor.Actor_GetId(swigCPtr);
469             if (NDalicPINVOKE.SWIGPendingException.Pending)
470                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
471             return ret;
472         }
473
474         internal bool IsRoot()
475         {
476             bool ret = Interop.ActorInternal.Actor_IsRoot(swigCPtr);
477             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
478             return ret;
479         }
480
481         internal bool OnWindow()
482         {
483             bool ret = Interop.Actor.Actor_OnStage(swigCPtr);
484             if (NDalicPINVOKE.SWIGPendingException.Pending)
485                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
486             return ret;
487         }
488
489         internal View FindChildById(uint id)
490         {
491             //to fix memory leak issue, match the handle count with native side.
492             IntPtr cPtr = Interop.Actor.Actor_FindChildById(swigCPtr, id);
493             View ret = this.GetInstanceSafely<View>(cPtr);
494             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
495             return ret;
496         }
497
498         internal override View FindCurrentChildById(uint id)
499         {
500             return FindChildById(id);
501         }
502
503         internal void SetParentOrigin(Vector3 origin)
504         {
505             Interop.ActorInternal.Actor_SetParentOrigin(swigCPtr, Vector3.getCPtr(origin));
506             if (NDalicPINVOKE.SWIGPendingException.Pending)
507                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
508         }
509
510         internal Vector3 GetCurrentParentOrigin()
511         {
512             Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentParentOrigin(swigCPtr), true);
513             if (NDalicPINVOKE.SWIGPendingException.Pending)
514                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
515             return ret;
516         }
517
518         internal void SetAnchorPoint(Vector3 anchorPoint)
519         {
520             Interop.Actor.Actor_SetAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint));
521             if (NDalicPINVOKE.SWIGPendingException.Pending)
522                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
523         }
524
525         internal Vector3 GetCurrentAnchorPoint()
526         {
527             Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentAnchorPoint(swigCPtr), true);
528             if (NDalicPINVOKE.SWIGPendingException.Pending)
529                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
530             return ret;
531         }
532
533         internal void SetSize(float width, float height)
534         {
535             Interop.ActorInternal.Actor_SetSize__SWIG_0(swigCPtr, width, height);
536             if (NDalicPINVOKE.SWIGPendingException.Pending)
537                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
538         }
539
540         internal void SetSize(float width, float height, float depth)
541         {
542             Interop.ActorInternal.Actor_SetSize__SWIG_1(swigCPtr, width, height, depth);
543             if (NDalicPINVOKE.SWIGPendingException.Pending)
544                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
545         }
546
547         internal void SetSize(Vector2 size)
548         {
549             Interop.ActorInternal.Actor_SetSize__SWIG_2(swigCPtr, Vector2.getCPtr(size));
550             if (NDalicPINVOKE.SWIGPendingException.Pending)
551                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
552         }
553
554         internal void SetSize(Vector3 size)
555         {
556             Interop.ActorInternal.Actor_SetSize__SWIG_3(swigCPtr, Vector3.getCPtr(size));
557             if (NDalicPINVOKE.SWIGPendingException.Pending)
558                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
559         }
560
561         internal Vector3 GetTargetSize()
562         {
563             Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetTargetSize(swigCPtr), true);
564             if (NDalicPINVOKE.SWIGPendingException.Pending)
565                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
566             return ret;
567         }
568
569         internal Size2D GetCurrentSize()
570         {
571             Size ret = new Size(Interop.Actor.Actor_GetCurrentSize(swigCPtr), true);
572             if (NDalicPINVOKE.SWIGPendingException.Pending)
573                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
574             Size2D size = new Size2D((int)ret.Width, (int)ret.Height);
575             return size;
576         }
577
578         internal Size2D GetCurrentSizeFloat()
579         {
580             Size ret = new Size(Interop.Actor.Actor_GetCurrentSize(swigCPtr), true);
581             if (NDalicPINVOKE.SWIGPendingException.Pending)
582                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
583             return ret;
584         }
585
586         internal Vector3 GetNaturalSize()
587         {
588             Vector3 ret = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true);
589             if (NDalicPINVOKE.SWIGPendingException.Pending)
590                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
591             return ret;
592         }
593
594         internal void SetPosition(float x, float y)
595         {
596             Interop.ActorInternal.Actor_SetPosition__SWIG_0(swigCPtr, x, y);
597             if (NDalicPINVOKE.SWIGPendingException.Pending)
598                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
599         }
600
601         internal void SetPosition(float x, float y, float z)
602         {
603             Interop.ActorInternal.Actor_SetPosition__SWIG_1(swigCPtr, x, y, z);
604             if (NDalicPINVOKE.SWIGPendingException.Pending)
605                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
606         }
607
608         internal void SetPosition(Vector3 position)
609         {
610             Interop.ActorInternal.Actor_SetPosition__SWIG_2(swigCPtr, Vector3.getCPtr(position));
611             if (NDalicPINVOKE.SWIGPendingException.Pending)
612                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
613         }
614
615         internal void SetX(float x)
616         {
617             Interop.ActorInternal.Actor_SetX(swigCPtr, x);
618             if (NDalicPINVOKE.SWIGPendingException.Pending)
619                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
620         }
621
622         internal void SetY(float y)
623         {
624             Interop.ActorInternal.Actor_SetY(swigCPtr, y);
625             if (NDalicPINVOKE.SWIGPendingException.Pending)
626                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
627         }
628
629         internal void SetZ(float z)
630         {
631             Interop.ActorInternal.Actor_SetZ(swigCPtr, z);
632             if (NDalicPINVOKE.SWIGPendingException.Pending)
633                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
634         }
635
636         internal void TranslateBy(Vector3 distance)
637         {
638             Interop.ActorInternal.Actor_TranslateBy(swigCPtr, Vector3.getCPtr(distance));
639             if (NDalicPINVOKE.SWIGPendingException.Pending)
640                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
641         }
642
643         internal Position GetCurrentPosition()
644         {
645             Position ret = new Position(Interop.Actor.Actor_GetCurrentPosition(swigCPtr), true);
646             if (NDalicPINVOKE.SWIGPendingException.Pending)
647                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
648             return ret;
649         }
650
651         internal Vector3 GetCurrentWorldPosition()
652         {
653             Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentWorldPosition(swigCPtr), true);
654             if (NDalicPINVOKE.SWIGPendingException.Pending)
655                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
656             return ret;
657         }
658
659         internal void SetInheritPosition(bool inherit)
660         {
661             Interop.ActorInternal.Actor_SetInheritPosition(swigCPtr, inherit);
662             if (NDalicPINVOKE.SWIGPendingException.Pending)
663                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
664         }
665
666         internal bool IsPositionInherited()
667         {
668             bool ret = Interop.ActorInternal.Actor_IsPositionInherited(swigCPtr);
669             if (NDalicPINVOKE.SWIGPendingException.Pending)
670                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
671             return ret;
672         }
673
674         internal void SetOrientation(Degree angle, Vector3 axis)
675         {
676             Interop.ActorInternal.Actor_SetOrientation__SWIG_0(swigCPtr, Degree.getCPtr(angle), Vector3.getCPtr(axis));
677             if (NDalicPINVOKE.SWIGPendingException.Pending)
678                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
679         }
680
681         internal void SetOrientation(Radian angle, Vector3 axis)
682         {
683             Interop.ActorInternal.Actor_SetOrientation__SWIG_1(swigCPtr, Radian.getCPtr(angle), Vector3.getCPtr(axis));
684             if (NDalicPINVOKE.SWIGPendingException.Pending)
685                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
686         }
687
688         internal void SetOrientation(Rotation orientation)
689         {
690             Interop.ActorInternal.Actor_SetOrientation__SWIG_2(swigCPtr, Rotation.getCPtr(orientation));
691             if (NDalicPINVOKE.SWIGPendingException.Pending)
692                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
693         }
694
695         internal Rotation GetCurrentOrientation()
696         {
697             Rotation ret = new Rotation(Interop.ActorInternal.Actor_GetCurrentOrientation(swigCPtr), true);
698             if (NDalicPINVOKE.SWIGPendingException.Pending)
699                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
700             return ret;
701         }
702
703         internal void SetInheritOrientation(bool inherit)
704         {
705             Interop.ActorInternal.Actor_SetInheritOrientation(swigCPtr, inherit);
706             if (NDalicPINVOKE.SWIGPendingException.Pending)
707                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
708         }
709
710         internal bool IsOrientationInherited()
711         {
712             bool ret = Interop.ActorInternal.Actor_IsOrientationInherited(swigCPtr);
713             if (NDalicPINVOKE.SWIGPendingException.Pending)
714                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
715             return ret;
716         }
717
718         internal Rotation GetCurrentWorldOrientation()
719         {
720             Rotation ret = new Rotation(Interop.ActorInternal.Actor_GetCurrentWorldOrientation(swigCPtr), true);
721             if (NDalicPINVOKE.SWIGPendingException.Pending)
722                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
723             return ret;
724         }
725
726         internal void SetScale(float scale)
727         {
728             Interop.ActorInternal.Actor_SetScale__SWIG_0(swigCPtr, scale);
729             if (NDalicPINVOKE.SWIGPendingException.Pending)
730                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
731         }
732
733         internal void SetScale(float scaleX, float scaleY, float scaleZ)
734         {
735             Interop.ActorInternal.Actor_SetScale__SWIG_1(swigCPtr, scaleX, scaleY, scaleZ);
736             if (NDalicPINVOKE.SWIGPendingException.Pending)
737                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
738         }
739
740         internal void SetScale(Vector3 scale)
741         {
742             Interop.ActorInternal.Actor_SetScale__SWIG_2(swigCPtr, Vector3.getCPtr(scale));
743             if (NDalicPINVOKE.SWIGPendingException.Pending)
744                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
745         }
746
747         internal Vector3 GetCurrentScale()
748         {
749             Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentScale(swigCPtr), true);
750             if (NDalicPINVOKE.SWIGPendingException.Pending)
751                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
752             return ret;
753         }
754
755         internal Vector3 GetCurrentWorldScale()
756         {
757             Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentWorldScale(swigCPtr), true);
758             if (NDalicPINVOKE.SWIGPendingException.Pending)
759                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
760             return ret;
761         }
762
763         internal void SetInheritScale(bool inherit)
764         {
765             Interop.ActorInternal.Actor_SetInheritScale(swigCPtr, inherit);
766             if (NDalicPINVOKE.SWIGPendingException.Pending)
767                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
768         }
769
770         internal bool IsScaleInherited()
771         {
772             bool ret = Interop.ActorInternal.Actor_IsScaleInherited(swigCPtr);
773             if (NDalicPINVOKE.SWIGPendingException.Pending)
774                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
775             return ret;
776         }
777
778         internal Matrix GetCurrentWorldMatrix()
779         {
780             Matrix ret = new Matrix(Interop.ActorInternal.Actor_GetCurrentWorldMatrix(swigCPtr), true);
781             if (NDalicPINVOKE.SWIGPendingException.Pending)
782                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
783             return ret;
784         }
785
786         internal void SetVisible(bool visible)
787         {
788             Interop.Actor.Actor_SetVisible(swigCPtr, visible);
789             if (NDalicPINVOKE.SWIGPendingException.Pending)
790                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
791         }
792
793         internal bool IsVisible()
794         {
795             bool ret = Interop.ActorInternal.Actor_IsVisible(swigCPtr);
796             if (NDalicPINVOKE.SWIGPendingException.Pending)
797                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
798             return ret;
799         }
800
801         internal void SetOpacity(float opacity)
802         {
803             Interop.ActorInternal.Actor_SetOpacity(swigCPtr, opacity);
804             if (NDalicPINVOKE.SWIGPendingException.Pending)
805                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
806         }
807
808         internal float GetCurrentOpacity()
809         {
810             float ret = Interop.ActorInternal.Actor_GetCurrentOpacity(swigCPtr);
811             if (NDalicPINVOKE.SWIGPendingException.Pending)
812                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
813             return ret;
814         }
815
816         internal void SetColor(Vector4 color)
817         {
818             Interop.ActorInternal.Actor_SetColor(swigCPtr, Vector4.getCPtr(color));
819             if (NDalicPINVOKE.SWIGPendingException.Pending)
820                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
821         }
822
823         internal Vector4 GetCurrentColor()
824         {
825             Vector4 ret = new Vector4(Interop.ActorInternal.Actor_GetCurrentColor(swigCPtr), true);
826             if (NDalicPINVOKE.SWIGPendingException.Pending)
827                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
828             return ret;
829         }
830         internal ColorMode GetColorMode()
831         {
832             ColorMode ret = (ColorMode)Interop.ActorInternal.Actor_GetColorMode(swigCPtr);
833             if (NDalicPINVOKE.SWIGPendingException.Pending)
834                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
835             return ret;
836         }
837
838         internal Vector4 GetCurrentWorldColor()
839         {
840             Vector4 ret = new Vector4(Interop.ActorInternal.Actor_GetCurrentWorldColor(swigCPtr), true);
841             if (NDalicPINVOKE.SWIGPendingException.Pending)
842                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
843             return ret;
844         }
845
846         internal void SetDrawMode(DrawModeType drawMode)
847         {
848             Interop.ActorInternal.Actor_SetDrawMode(swigCPtr, (int)drawMode);
849             if (NDalicPINVOKE.SWIGPendingException.Pending)
850                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
851         }
852
853         internal DrawModeType GetDrawMode()
854         {
855             DrawModeType ret = (DrawModeType)Interop.ActorInternal.Actor_GetDrawMode(swigCPtr);
856             if (NDalicPINVOKE.SWIGPendingException.Pending)
857                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
858             return ret;
859         }
860
861         internal void SetKeyboardFocusable(bool focusable)
862         {
863             Interop.ActorInternal.Actor_SetKeyboardFocusable(swigCPtr, focusable);
864             if (NDalicPINVOKE.SWIGPendingException.Pending)
865                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
866         }
867
868         internal bool IsKeyboardFocusable()
869         {
870             bool ret = Interop.ActorInternal.Actor_IsKeyboardFocusable(swigCPtr);
871             if (NDalicPINVOKE.SWIGPendingException.Pending)
872                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
873             return ret;
874         }
875
876         internal void SetKeyboardFocusableChildren(bool focusable)
877         {
878             Interop.ActorInternal.SetKeyboardFocusableChildren(SwigCPtr, focusable);
879             if (NDalicPINVOKE.SWIGPendingException.Pending)
880                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
881         }
882
883         internal bool AreChildrenKeyBoardFocusable()
884         {
885             bool ret = Interop.ActorInternal.AreChildrenKeyBoardFocusable(SwigCPtr);
886             if (NDalicPINVOKE.SWIGPendingException.Pending)
887                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
888             return ret;
889         }
890
891         internal void SetFocusableInTouch(bool enabled)
892         {
893             Interop.ActorInternal.SetFocusableInTouch(SwigCPtr, enabled);
894             if (NDalicPINVOKE.SWIGPendingException.Pending)
895                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
896         }
897
898         internal bool IsFocusableInTouch()
899         {
900             bool ret = Interop.ActorInternal.IsFocusableInTouch(SwigCPtr);
901             if (NDalicPINVOKE.SWIGPendingException.Pending)
902                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
903             return ret;
904         }
905
906         internal void SetResizePolicy(ResizePolicyType policy, DimensionType dimension)
907         {
908             Interop.Actor.Actor_SetResizePolicy(swigCPtr, (int)policy, (int)dimension);
909             if (NDalicPINVOKE.SWIGPendingException.Pending)
910                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
911         }
912
913         internal ResizePolicyType GetResizePolicy(DimensionType dimension)
914         {
915             ResizePolicyType ret = (ResizePolicyType)Interop.Actor.Actor_GetResizePolicy(swigCPtr, (int)dimension);
916             if (NDalicPINVOKE.SWIGPendingException.Pending)
917                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
918             return ret;
919         }
920
921         internal Vector3 GetSizeModeFactor()
922         {
923             Vector3 ret = new Vector3(Interop.Actor.Actor_GetSizeModeFactor(swigCPtr), true);
924             if (NDalicPINVOKE.SWIGPendingException.Pending)
925                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
926             return ret;
927         }
928
929         internal void SetMinimumSize(Vector2 size)
930         {
931             Interop.ActorInternal.Actor_SetMinimumSize(swigCPtr, Vector2.getCPtr(size));
932             if (NDalicPINVOKE.SWIGPendingException.Pending)
933                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
934         }
935
936         internal Vector2 GetMinimumSize()
937         {
938             Vector2 ret = new Vector2(Interop.ActorInternal.Actor_GetMinimumSize(swigCPtr), true);
939             if (NDalicPINVOKE.SWIGPendingException.Pending)
940                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
941             return ret;
942         }
943
944         internal void SetMaximumSize(Vector2 size)
945         {
946             Interop.ActorInternal.Actor_SetMaximumSize(swigCPtr, Vector2.getCPtr(size));
947             if (NDalicPINVOKE.SWIGPendingException.Pending)
948                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
949         }
950
951         internal Vector2 GetMaximumSize()
952         {
953             Vector2 ret = new Vector2(Interop.ActorInternal.Actor_GetMaximumSize(swigCPtr), true);
954             if (NDalicPINVOKE.SWIGPendingException.Pending)
955                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
956             return ret;
957         }
958
959         internal int GetHierarchyDepth()
960         {
961             int ret = Interop.Actor.Actor_GetHierarchyDepth(swigCPtr);
962             if (NDalicPINVOKE.SWIGPendingException.Pending)
963                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
964             return ret;
965         }
966
967         internal uint GetRendererCount()
968         {
969             uint ret = Interop.Actor.Actor_GetRendererCount(swigCPtr);
970             if (NDalicPINVOKE.SWIGPendingException.Pending)
971                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
972             return ret;
973         }
974
975         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj)
976         {
977             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
978         }
979
980         internal bool IsTopLevelView()
981         {
982             if (GetParent() is Layer)
983             {
984                 return true;
985             }
986             return false;
987         }
988
989         internal void SetKeyInputFocus()
990         {
991             Interop.ViewInternal.View_SetKeyInputFocus(swigCPtr);
992             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
993         }
994
995         internal void ClearKeyInputFocus()
996         {
997             Interop.ViewInternal.View_ClearKeyInputFocus(swigCPtr);
998             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
999         }
1000
1001         internal PinchGestureDetector GetPinchGestureDetector()
1002         {
1003             PinchGestureDetector ret = new PinchGestureDetector(Interop.ViewInternal.View_GetPinchGestureDetector(swigCPtr), true);
1004             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1005             return ret;
1006         }
1007
1008         internal PanGestureDetector GetPanGestureDetector()
1009         {
1010             PanGestureDetector ret = new PanGestureDetector(Interop.ViewInternal.View_GetPanGestureDetector(swigCPtr), true);
1011             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1012             return ret;
1013         }
1014
1015         internal TapGestureDetector GetTapGestureDetector()
1016         {
1017             TapGestureDetector ret = new TapGestureDetector(Interop.ViewInternal.View_GetTapGestureDetector(swigCPtr), true);
1018             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1019             return ret;
1020         }
1021
1022         internal LongPressGestureDetector GetLongPressGestureDetector()
1023         {
1024             LongPressGestureDetector ret = new LongPressGestureDetector(Interop.ViewInternal.View_GetLongPressGestureDetector(swigCPtr), true);
1025             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1026             return ret;
1027         }
1028
1029         internal IntPtr GetPtrfromView()
1030         {
1031             return (IntPtr)swigCPtr;
1032         }
1033
1034         internal void RemoveChild(View child)
1035         {
1036             // Do actual child removal
1037             Interop.Actor.Actor_Remove(swigCPtr, View.getCPtr(child));
1038             if (NDalicPINVOKE.SWIGPendingException.Pending)
1039                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1040
1041             Children.Remove(child);
1042             child.InternalParent = null;
1043
1044             if (ChildRemoved != null)
1045             {
1046                 ChildRemovedEventArgs e = new ChildRemovedEventArgs
1047                 {
1048                     Removed = child
1049                 };
1050                 ChildRemoved(this, e);
1051             }
1052         }
1053
1054         /// <summary>
1055         /// Removes the layout from this View.
1056         /// </summary>
1057         internal void ResetLayout()
1058         {
1059             _layout = null;
1060         }
1061
1062         internal ResourceLoadingStatusType GetBackgroundResourceStatus()
1063         {
1064             return (ResourceLoadingStatusType)Interop.View.View_GetVisualResourceStatus(this.swigCPtr, Property.BACKGROUND);
1065         }
1066
1067         internal virtual void UpdateCornerRadius(float value)
1068         {
1069             if (value != 0)
1070             {
1071                 (backgroundExtraData ?? (backgroundExtraData = new BackgroundExtraData())).CornerRadius = value;
1072             }
1073
1074             Tizen.NUI.PropertyMap backgroundMap = new Tizen.NUI.PropertyMap();
1075             Tizen.NUI.Object.GetProperty(swigCPtr, View.Property.BACKGROUND).Get(backgroundMap);
1076
1077             if (!backgroundMap.Empty())
1078             {
1079                 backgroundMap[Visual.Property.CornerRadius] = new PropertyValue(value);
1080                 Tizen.NUI.Object.SetProperty(swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue(backgroundMap));
1081             }
1082
1083             UpdateShadowCornerRadius(value);
1084         }
1085
1086         internal void UpdateStyle()
1087         {
1088             ViewStyle newStyle;
1089             if (styleName == null) newStyle = ThemeManager.GetStyle(GetType());
1090             else newStyle = ThemeManager.GetStyle(styleName);
1091
1092             if (newStyle != null && (viewStyle == null || viewStyle.GetType() == newStyle.GetType())) ApplyStyle(newStyle);
1093         }
1094
1095         /// <summary>
1096         /// you can override it to clean-up your own resources.
1097         /// </summary>
1098         /// <param name="type">DisposeTypes</param>
1099         /// <since_tizen> 3 </since_tizen>
1100         protected override void Dispose(DisposeTypes type)
1101         {
1102             if (disposed)
1103             {
1104                 return;
1105             }
1106
1107             //_mergedStyle = null;
1108
1109             if (type == DisposeTypes.Explicit)
1110             {
1111                 //Called by User
1112                 //Release your own managed resources here.
1113                 //You should release all of your own disposable objects here.
1114                 selectorData?.Reset(this);
1115                 if (themeChangeSensitive)
1116                 {
1117                     ThemeManager.ThemeChangedInternal -= OnThemeChanged;
1118                 }
1119                 if (widthConstraint != null)
1120                 {
1121                     widthConstraint.Remove();
1122                     widthConstraint.Dispose();
1123                 }
1124                 if (heightConstraint != null)
1125                 {
1126                     heightConstraint.Remove();
1127                     heightConstraint.Dispose();
1128                 }
1129             }
1130
1131             //Release your own unmanaged resources here.
1132             //You should not access any managed member here except static instance.
1133             //because the execution order of Finalizes is non-deterministic.
1134             if (this != null)
1135             {
1136                 DisConnectFromSignals();
1137             }
1138
1139             foreach (View view in Children)
1140             {
1141                 view.InternalParent = null;
1142             }
1143
1144             base.Dispose(type);
1145         }
1146
1147         /// This will not be public opened.
1148         [EditorBrowsable(EditorBrowsableState.Never)]
1149         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
1150         {
1151             Interop.View.delete_View(swigCPtr);
1152         }
1153
1154         /// <summary>
1155         /// The touch event handler for ControlState.
1156         /// Please change ControlState value by touch state if needed.
1157         /// </summary>
1158         [EditorBrowsable(EditorBrowsableState.Never)]
1159         protected virtual bool HandleControlStateOnTouch(Touch touch)
1160         {
1161             switch (touch.GetState(0))
1162             {
1163                 case PointStateType.Down:
1164                     ControlState += ControlState.Pressed;
1165                     break;
1166                 case PointStateType.Interrupted:
1167                 case PointStateType.Up:
1168                     if (ControlState.Contains(ControlState.Pressed))
1169                     {
1170                         ControlState -= ControlState.Pressed;
1171                     }
1172                     break;
1173                 default:
1174                     break;
1175             }
1176
1177             return false;
1178         }
1179
1180         private void DisConnectFromSignals()
1181         {
1182             if (HasBody() == false)
1183             {
1184                 NUILog.Debug($"View.DisConnectFromSignals() No native body! No need to Disconnect Signals!");
1185                 return;
1186             }
1187
1188             if (_onRelayoutEventCallback != null)
1189             {
1190                 ViewSignal signal = new ViewSignal(Interop.ActorSignal.Actor_OnRelayoutSignal(GetBaseHandleCPtrHandleRef), false);
1191                 signal?.Disconnect(_onRelayoutEventCallback);
1192                 signal?.Dispose();
1193                 _onRelayoutEventCallback = null;
1194             }
1195
1196             if (_offWindowEventCallback != null)
1197             {
1198                 ViewSignal signal = new ViewSignal(Interop.ActorSignal.Actor_OffSceneSignal(GetBaseHandleCPtrHandleRef), false);
1199                 signal?.Disconnect(_offWindowEventCallback);
1200                 signal?.Dispose();
1201                 _offWindowEventCallback = null;
1202             }
1203
1204             if (_onWindowEventCallback != null)
1205             {
1206                 ViewSignal signal = new ViewSignal(Interop.ActorSignal.Actor_OnSceneSignal(GetBaseHandleCPtrHandleRef), false);
1207                 signal?.Disconnect(_onWindowEventCallback);
1208                 signal?.Dispose();
1209                 _onWindowEventCallback = null;
1210             }
1211
1212             if (_wheelEventCallback != null)
1213             {
1214                 WheelSignal signal = new WheelSignal(Interop.ActorSignal.Actor_WheelEventSignal(GetBaseHandleCPtrHandleRef), false);
1215                 signal?.Disconnect(_wheelEventCallback);
1216                 signal?.Dispose();
1217                 _wheelEventCallback = null;
1218             }
1219
1220             if (WindowWheelEventHandler != null)
1221             {
1222                 NUIApplication.GetDefaultWindow().WheelEvent -= OnWindowWheelEvent;
1223             }
1224
1225             if (_hoverEventCallback != null)
1226             {
1227                 HoverSignal signal = new HoverSignal(Interop.ActorSignal.Actor_HoveredSignal(GetBaseHandleCPtrHandleRef), false);
1228                 signal?.Disconnect(_hoverEventCallback);
1229                 signal?.Dispose();
1230                 _hoverEventCallback = null;
1231             }
1232
1233             if (_interceptTouchDataCallback != null)
1234             {
1235                 TouchDataSignal signal = new TouchDataSignal(Interop.ActorSignal.Actor_InterceptTouchSignal(GetBaseHandleCPtrHandleRef), false);
1236                 signal?.Disconnect(_interceptTouchDataCallback);
1237                 signal?.Dispose();
1238                 _interceptTouchDataCallback = null;
1239             }
1240
1241             if (_touchDataCallback != null)
1242             {
1243                 TouchDataSignal signal = new TouchDataSignal(Interop.ActorSignal.Actor_TouchSignal(GetBaseHandleCPtrHandleRef), false);
1244                 signal?.Disconnect(_touchDataCallback);
1245                 signal?.Dispose();
1246                 _touchDataCallback = null;
1247             }
1248
1249             if (_ResourcesLoadedCallback != null)
1250             {
1251                 ViewSignal signal = new ViewSignal(Interop.View.ResourceReadySignal(GetBaseHandleCPtrHandleRef), false);
1252                 signal?.Disconnect(_ResourcesLoadedCallback);
1253                 signal?.Dispose();
1254                 _ResourcesLoadedCallback = null;
1255             }
1256
1257             if (_keyCallback != null)
1258             {
1259                 ControlKeySignal signal = new ControlKeySignal(Interop.ViewSignal.View_KeyEventSignal(GetBaseHandleCPtrHandleRef), false);
1260                 signal?.Disconnect(_keyCallback);
1261                 signal?.Dispose();
1262                 _keyCallback = null;
1263             }
1264
1265             if (_keyInputFocusLostCallback != null)
1266             {
1267                 KeyInputFocusSignal signal = new KeyInputFocusSignal(Interop.ViewSignal.View_KeyInputFocusLostSignal(GetBaseHandleCPtrHandleRef), false);
1268                 signal?.Disconnect(_keyInputFocusLostCallback);
1269                 signal?.Dispose();
1270                 _keyInputFocusLostCallback = null;
1271             }
1272
1273             if (_keyInputFocusGainedCallback != null)
1274             {
1275                 KeyInputFocusSignal signal = new KeyInputFocusSignal(Interop.ViewSignal.View_KeyInputFocusGainedSignal(GetBaseHandleCPtrHandleRef), false);
1276                 signal?.Disconnect(_keyInputFocusGainedCallback);
1277                 signal?.Dispose();
1278                 _keyInputFocusGainedCallback = null;
1279             }
1280
1281             if (_backgroundResourceLoadedCallback != null)
1282             {
1283                 ViewSignal signal = new ViewSignal(Interop.View.ResourceReadySignal(GetBaseHandleCPtrHandleRef), false);
1284                 signal?.Disconnect(_backgroundResourceLoadedCallback);
1285                 signal?.Dispose();
1286                 _backgroundResourceLoadedCallback = null;
1287             }
1288
1289             if (_onWindowSendEventCallback != null)
1290             {
1291                 ViewSignal signal = new ViewSignal(Interop.ActorSignal.Actor_OnSceneSignal(GetBaseHandleCPtrHandleRef), false);
1292                 signal?.Disconnect(_onWindowSendEventCallback);
1293                 signal?.Dispose();
1294                 _onWindowSendEventCallback = null;
1295             }
1296
1297             if (_visibilityChangedEventCallback != null)
1298             {
1299                 ViewVisibilityChangedSignal signal = new ViewVisibilityChangedSignal(Interop.NDalic.VisibilityChangedSignal(GetBaseHandleCPtrHandleRef), false);
1300                 signal?.Disconnect(_visibilityChangedEventCallback);
1301                 signal?.Dispose();
1302                 _visibilityChangedEventCallback = null;
1303             }
1304
1305             if (_layoutDirectionChangedEventCallback != null)
1306             {
1307                 ViewLayoutDirectionChangedSignal signal = new ViewLayoutDirectionChangedSignal(Interop.Layout.LayoutDirectionChangedSignal(GetBaseHandleCPtrHandleRef), false);
1308                 signal?.Disconnect(_layoutDirectionChangedEventCallback);
1309                 signal?.Dispose();
1310                 _layoutDirectionChangedEventCallback = null;
1311             }
1312         }
1313
1314         private View ConvertIdToView(uint id)
1315         {
1316             View view = GetParent()?.FindCurrentChildById(id);
1317
1318             //If we can't find the parent's children, find in the top layer.
1319             if (!view)
1320             {
1321                 Container parent = GetParent();
1322                 while ((parent is View) && (parent != null))
1323                 {
1324                     parent = parent.GetParent();
1325                     if (parent is Layer)
1326                     {
1327                         view = parent.FindCurrentChildById(id);
1328                         break;
1329                     }
1330                 }
1331             }
1332
1333             return view;
1334         }
1335
1336         private void LoadTransitions()
1337         {
1338             foreach (string str in transitionNames)
1339             {
1340                 string resourceName = str + ".xaml";
1341                 Transition trans = null;
1342
1343                 string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
1344
1345                 string likelyResourcePath = resource + "animation/" + resourceName;
1346
1347                 if (File.Exists(likelyResourcePath))
1348                 {
1349                     trans = Xaml.Extensions.LoadObject<Transition>(likelyResourcePath);
1350                 }
1351                 if (trans != null)
1352                 {
1353                     transDictionary.Add(trans.Name, trans);
1354                 }
1355             }
1356         }
1357
1358         private void OnScaleChanged(float x, float y, float z)
1359         {
1360             Scale = new Vector3(x, y, z);
1361         }
1362
1363         private void OnBackgroundColorChanged(float r, float g, float b, float a)
1364         {
1365             BackgroundColor = new Color(r, g, b, a);
1366         }
1367
1368         private void OnPaddingChanged(ushort start, ushort end, ushort top, ushort bottom)
1369         {
1370             Padding = new Extents(start, end, top, bottom);
1371         }
1372
1373         private void OnMarginChanged(ushort start, ushort end, ushort top, ushort bottom)
1374         {
1375             Margin = new Extents(start, end, top, bottom);
1376         }
1377
1378         private void OnColorChanged(float r, float g, float b, float a)
1379         {
1380             Color = new Color(r, g, b, a);
1381         }
1382
1383         private void OnAnchorPointChanged(float x, float y, float z)
1384         {
1385             AnchorPoint = new Position(x, y, z);
1386         }
1387
1388         private void OnCellIndexChanged(float x, float y)
1389         {
1390             CellIndex = new Vector2(x, y);
1391         }
1392
1393         private void OnFlexMarginChanged(float x, float y, float z, float w)
1394         {
1395             FlexMargin = new Vector4(x, y, z, w);
1396         }
1397
1398         private void OnPaddingEXChanged(ushort start, ushort end, ushort top, ushort bottom)
1399         {
1400             PaddingEX = new Extents(start, end, top, bottom);
1401         }
1402
1403         private void OnSizeModeFactorChanged(float x, float y, float z)
1404         {
1405             SizeModeFactor = new Vector3(x, y, z);
1406         }
1407
1408         private void UpdateShadowCornerRadius(float value)
1409         {
1410             // TODO Update corner radius property only whe DALi supports visual property update.
1411             PropertyMap map = new PropertyMap();
1412
1413             if (Tizen.NUI.Object.GetProperty(swigCPtr, View.Property.SHADOW).Get(map) && !map.Empty())
1414             {
1415                 map[Visual.Property.CornerRadius] = new PropertyValue(value);
1416
1417                 Tizen.NUI.Object.SetProperty(swigCPtr, View.Property.SHADOW, new PropertyValue(map));
1418             }
1419         }
1420
1421         private bool EmptyOnTouch(object target, TouchEventArgs args)
1422         {
1423             return false;
1424         }
1425     }
1426 }