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