[NUI][API8] Add Constraint base + inhouse ResizePolicyType.KeepSizeFollowingParent...
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / View.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 using System;
18 using System.Collections.Generic;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.Binding;
22 using Tizen.NUI.Components;
23
24 namespace Tizen.NUI.BaseComponents
25 {
26     /// <summary>
27     /// View is the base class for all views.
28     /// </summary>
29     /// <since_tizen> 3 </since_tizen>
30     public partial class View : Container, IResourcesProvider
31     {
32         /// <summary>
33         /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
34         /// </summary>
35         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
36         [EditorBrowsable(EditorBrowsableState.Never)]
37         public bool layoutSet = false;
38
39         /// <summary>
40         /// Flag to allow Layouting to be disabled for Views.
41         /// Once a View has a Layout set then any children added to Views from then on will receive
42         /// automatic Layouts.
43         /// </summary>
44         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
45         [EditorBrowsable(EditorBrowsableState.Never)]
46         public static bool layoutingDisabled{get; set;} = true;
47
48         private LayoutItem _layout; // Exclusive layout assigned to this View.
49
50         // List of transitions paired with the condition that uses the transition.
51         private Dictionary<TransitionCondition, TransitionList> _layoutTransitions;
52         private int _widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
53         private int _heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
54         private int _oldWidthPolicy = LayoutParamPolicies.MatchParent; // // Store Layout width to compare against later
55         private int _oldHeightPolicy = LayoutParamPolicies.MatchParent; // Store Layout height to compare against later
56         private float _weight = 0.0f; // Weighting of child View in a Layout
57         private MeasureSpecification _measureSpecificationWidth; // Layout width and internal Mode
58         private MeasureSpecification _measureSpecificationHeight; // Layout height and internal Mode
59         private bool _backgroundImageSynchronosLoading = false;
60         private Dictionary<string, Transition> transDictionary = new Dictionary<string, Transition>();
61         private string[] transitionNames;
62         private bool controlStatePropagation = false;
63         private ViewStyle viewStyle;
64         private bool themeChangeSensitive = false;
65
66         internal Size2D sizeSetExplicitly = new Size2D(); // Store size set by API, will be used in place of NaturalSize if not set.
67         internal BackgroundExtraData backgroundExtraData;
68
69         // List of constraint
70         private Constraint widthConstraint = null;
71         private Constraint heightConstraint = null;
72
73         static View() {}
74
75         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
76         [EditorBrowsable(EditorBrowsableState.Never)]
77         public ViewStyle ViewStyle
78         {
79             get
80             {
81                 if (null == viewStyle)
82                 {
83                     ApplyStyle(GetViewStyle());
84                 }
85
86                 return viewStyle;
87             }
88         }
89
90         /// <summary>
91         /// Creates a new instance of a view.
92         /// </summary>
93         /// <since_tizen> 3 </since_tizen>
94         public View() : this(Interop.View.View_New(), true)
95         {
96             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
97         }
98
99         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
100         [EditorBrowsable(EditorBrowsableState.Never)]
101         public View(ViewStyle viewStyle) : this(Interop.View.View_New(), true, viewStyle)
102         {
103         }
104
105         /// <summary>
106         /// Create a new instance of a View with setting the status of shown or hidden.
107         /// </summary>
108         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
109         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
110         [EditorBrowsable(EditorBrowsableState.Never)]
111         public View(bool shown) : this(Interop.View.View_New(), true)
112         {
113             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
114             SetVisible(shown);
115         }
116
117         internal View(View uiControl, bool shown = true) : this(Interop.View.new_View__SWIG_1(View.getCPtr(uiControl)), true)
118         {
119             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
120             if(!shown)
121             {
122                 SetVisible(false);
123             }
124
125             backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
126         }
127
128         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
129         {
130             if (!ThemeManager.ThemeApplied) return;
131
132             if (viewStyle == null) UpdateStyle(); // Use style in the current theme
133             else ApplyStyle(viewStyle.Clone());   // Use given style
134         }
135
136         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.View.View_SWIGUpcast(cPtr), cMemoryOwn)
137         {
138             if (HasBody())
139             {
140                 PositionUsesPivotPoint = false;
141             }
142
143             _onWindowSendEventCallback = SendViewAddedEventToWindow;
144             this.OnWindowSignal().Connect(_onWindowSendEventCallback);
145
146             if (!shown)
147             {
148                 SetVisible(false);
149             }
150         }
151
152         internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true)
153         {
154             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155
156             if (!shown)
157             {
158                 SetVisible(false);
159             }
160         }
161
162         /// <summary>
163         /// The event that is triggered when the View's ControlState is changed.
164         /// </summary>
165         [EditorBrowsable(EditorBrowsableState.Never)]
166         public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
167
168         internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
169
170         private ControlState controlStates = ControlState.Normal;
171         /// <summary>
172         /// Get/Set the control state.
173         /// </summary>
174         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
175         [EditorBrowsable(EditorBrowsableState.Never)]
176         public ControlState ControlState
177         {
178             get
179             {
180                 return controlStates;
181             }
182             protected set
183             {
184                 if (controlStates == value)
185                 {
186                     return;
187                 }
188
189                 var prevState = controlStates;
190
191                 controlStates = value;
192
193                 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
194
195                 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
196
197                 if (controlStatePropagation)
198                 {
199                     foreach (View child in Children)
200                     {
201                         child.ControlState = value;
202                     }
203                 }
204
205                 OnControlStateChanged(changeInfo);
206
207                 ControlStateChangedEvent?.Invoke(this, changeInfo);
208             }
209         }
210
211         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
212         [EditorBrowsable(EditorBrowsableState.Never)]
213         public bool IsResourcesCreated
214         {
215             get
216             {
217                 return Application.Current.IsResourcesCreated;
218             }
219         }
220
221         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
222         [EditorBrowsable(EditorBrowsableState.Never)]
223         public ResourceDictionary XamlResources
224         {
225             get
226             {
227                 return Application.Current.XamlResources;
228             }
229             set
230             {
231                 Application.Current.XamlResources = value;
232             }
233         }
234
235         /// <summary>
236         /// The StyleName, type string.
237         /// The value indicates DALi style name defined in json theme file.
238         /// </summary>
239         /// <since_tizen> 3 </since_tizen>
240         public string StyleName
241         {
242             get
243             {
244                 return (string)GetValue(StyleNameProperty);
245             }
246             set
247             {
248                 SetValue(StyleNameProperty, value);
249                 NotifyPropertyChanged();
250             }
251         }
252
253         /// <summary>
254         /// The KeyInputFocus, type bool.
255         /// </summary>
256         [EditorBrowsable(EditorBrowsableState.Never)]
257         public bool KeyInputFocus
258         {
259             get
260             {
261                 return (bool)GetValue(KeyInputFocusProperty);
262             }
263             set
264             {
265                 SetValue(KeyInputFocusProperty, value);
266                 NotifyPropertyChanged();
267             }
268         }
269
270         /// <summary>
271         /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
272         /// </summary>
273         /// <remarks>
274         /// The property cascade chaining set is possible. For example, this (view.BackgroundColor.X = 0.1f;) is possible.
275         /// </remarks>
276         /// <since_tizen> 3 </since_tizen>
277         public Color BackgroundColor
278         {
279             get
280             {
281                 Color temp = (Color)GetValue(BackgroundColorProperty);
282                 return new Color(OnBackgroundColorChanged, temp.R, temp.G, temp.B, temp.A);
283             }
284             set
285             {
286                 SetValue(BackgroundColorProperty, value);
287                 if (selectorData != null)
288                 {
289                     selectorData.BackgroundImage.Reset(this);
290                     selectorData.BackgroundColor.UpdateIfNeeds(this, value);
291                 }
292                 NotifyPropertyChanged();
293             }
294         }
295
296         /// <summary>
297         /// The mutually exclusive with "backgroundColor" and "background" type Map.
298         /// </summary>
299         /// <since_tizen> 3 </since_tizen>
300         public string BackgroundImage
301         {
302             get
303             {
304                 return (string)GetValue(BackgroundImageProperty);
305             }
306             set
307             {
308                 SetValue(BackgroundImageProperty, value);
309                 if (selectorData != null)
310                 {
311                     selectorData.BackgroundColor.Reset(this);
312                     selectorData.BackgroundImage.UpdateIfNeeds(this, value);
313                 }
314                 NotifyPropertyChanged();
315             }
316         }
317
318         /// <summary>
319         /// Get or set the border of background image.
320         /// </summary>
321         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
322         [EditorBrowsable(EditorBrowsableState.Never)]
323         public Rectangle BackgroundImageBorder
324         {
325             get
326             {
327                 return (Rectangle)GetValue(BackgroundImageBorderProperty);
328             }
329             set
330             {
331                 SetValue(BackgroundImageBorderProperty, value);
332                 selectorData?.BackgroundImageBorder.UpdateIfNeeds(this, value);
333                 NotifyPropertyChanged();
334             }
335         }
336
337         /// <summary>
338         /// The background of view.
339         /// </summary>
340         /// <since_tizen> 3 </since_tizen>
341         public Tizen.NUI.PropertyMap Background
342         {
343             get
344             {
345                 return (PropertyMap)GetValue(BackgroundProperty);
346             }
347             set
348             {
349                 SetValue(BackgroundProperty, value);
350                 NotifyPropertyChanged();
351             }
352         }
353
354         /// <summary>
355         /// Describes a shadow as an image for a View.
356         /// It is null by default.
357         /// </summary>
358         /// <remarks>
359         /// Getter returns copied instance of current shadow.
360         /// </remarks>
361         /// <remarks>
362         /// The mutually exclusive with "BoxShadow".
363         /// </remarks>
364         [EditorBrowsable(EditorBrowsableState.Never)]
365         public ImageShadow ImageShadow
366         {
367             get
368             {
369                 return (ImageShadow)GetValue(ImageShadowProperty);
370             }
371             set
372             {
373                 SetValue(ImageShadowProperty, value);
374                 if (selectorData != null)
375                 {
376                     selectorData.BoxShadow.Reset(this);
377                     selectorData.ImageShadow.UpdateIfNeeds(this, value);
378                 }
379                 NotifyPropertyChanged();
380             }
381         }
382
383         /// <summary>
384         /// Describes a box shaped shadow drawing for a View.
385         /// It is null by default.
386         /// </summary>
387         /// <remarks>
388         /// Gettter returns copied instance of current shadow.
389         /// </remarks>
390         /// <remarks>
391         /// The mutually exclusive with "ImageShadow".
392         /// </remarks>
393         [EditorBrowsable(EditorBrowsableState.Never)]
394         public Shadow BoxShadow
395         {
396             get
397             {
398                 return (Shadow)GetValue(BoxShadowProperty);
399             }
400             set
401             {
402                 SetValue(BoxShadowProperty, value);
403                 if (selectorData != null)
404                 {
405                     selectorData.ImageShadow.Reset(this);
406                     selectorData.BoxShadow.UpdateIfNeeds(this, value);
407                 }
408                 NotifyPropertyChanged();
409             }
410         }
411
412         /// <summary>
413         /// The radius for the rounded corners of the View.
414         /// This will rounds background and shadow edges.
415         /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
416         /// </summary>
417         [EditorBrowsable(EditorBrowsableState.Never)]
418         public float CornerRadius
419         {
420             get
421             {
422                 return (float)GetValue(CornerRadiusProperty);
423             }
424             set
425             {
426                 SetValue(CornerRadiusProperty, value);
427                 selectorData?.CornerRadius.UpdateIfNeeds(this, value);
428                 NotifyPropertyChanged();
429             }
430         }
431
432         /// <summary>
433         /// The current state of the view.
434         /// </summary>
435         /// <since_tizen> 3 </since_tizen>
436         public States State
437         {
438             get
439             {
440                 return (States)GetValue(StateProperty);
441             }
442             set
443             {
444                 SetValue(StateProperty, value);
445                 NotifyPropertyChanged();
446             }
447         }
448
449         /// <summary>
450         /// The current sub state of the view.
451         /// </summary>
452         /// <since_tizen> 3 </since_tizen>
453         public States SubState
454         {
455             get
456             {
457                 return (States)GetValue(SubStateProperty);
458             }
459             set
460             {
461                 SetValue(SubStateProperty, value);
462                 NotifyPropertyChanged();
463             }
464         }
465
466         /// <summary>
467         /// Displays a tooltip
468         /// </summary>
469         /// <since_tizen> 3 </since_tizen>
470         public Tizen.NUI.PropertyMap Tooltip
471         {
472             get
473             {
474                 return (PropertyMap)GetValue(TooltipProperty);
475             }
476             set
477             {
478                 SetValue(TooltipProperty, value);
479                 NotifyPropertyChanged();
480             }
481         }
482
483         /// <summary>
484         /// Displays a tooltip as a text.
485         /// </summary>
486         /// <since_tizen> 3 </since_tizen>
487         public string TooltipText
488         {
489             set
490             {
491                 SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value));
492                 NotifyPropertyChanged();
493             }
494         }
495
496         /// <summary>
497         /// The Child property of FlexContainer.<br />
498         /// The proportion of the free space in the container, the flex item will receive.<br />
499         /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
500         /// </summary>
501         /// <since_tizen> 3 </since_tizen>
502         [Obsolete("Deprecated in API8, will be removed in API10.")]
503         public float Flex
504         {
505             get
506             {
507                 return (float)GetValue(FlexProperty);
508             }
509             set
510             {
511                 SetValue(FlexProperty, value);
512                 NotifyPropertyChanged();
513             }
514         }
515
516         /// <summary>
517         /// The Child property of FlexContainer.<br />
518         /// The alignment of the flex item along the cross axis, which, if set, overides the default alignment for all items in the container.<br />
519         /// </summary>
520         /// <since_tizen> 3 </since_tizen>
521         [Obsolete("Deprecated in API8, will be removed in API10.")]
522         public int AlignSelf
523         {
524             get
525             {
526                 return (int)GetValue(AlignSelfProperty);
527             }
528             set
529             {
530                 SetValue(AlignSelfProperty, value);
531                 NotifyPropertyChanged();
532             }
533         }
534
535         /// <summary>
536         /// The Child property of FlexContainer.<br />
537         /// The space around the flex item.<br />
538         /// </summary>
539         /// <remarks>
540         /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
541         /// </remarks>
542         /// <since_tizen> 3 </since_tizen>
543         [Obsolete("Deprecated in API8, will be removed in API10.")]
544         public Vector4 FlexMargin
545         {
546             get
547             {
548                 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
549                 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
550             }
551             set
552             {
553                 SetValue(FlexMarginProperty, value);
554                 NotifyPropertyChanged();
555             }
556         }
557
558         /// <summary>
559         /// The top-left cell this child occupies, if not set, the first available cell is used.
560         /// </summary>
561         /// <remarks>
562         /// The property cascade chaining set is possible. For example, this (view.CellIndex.X = 0.1f;) is possible.
563         /// </remarks>
564         /// <since_tizen> 3 </since_tizen>
565         public Vector2 CellIndex
566         {
567             get
568             {
569                 Vector2 temp = (Vector2)GetValue(CellIndexProperty);
570                 return new Vector2(OnCellIndexChanged, temp.X, temp.Y);
571             }
572             set
573             {
574                 SetValue(CellIndexProperty, value);
575                 NotifyPropertyChanged();
576             }
577         }
578
579         /// <summary>
580         /// The number of rows this child occupies, if not set, the default value is 1.
581         /// </summary>
582         /// <since_tizen> 3 </since_tizen>
583         public float RowSpan
584         {
585             get
586             {
587                 return (float)GetValue(RowSpanProperty);
588             }
589             set
590             {
591                 SetValue(RowSpanProperty, value);
592                 NotifyPropertyChanged();
593             }
594         }
595
596         /// <summary>
597         /// The number of columns this child occupies, if not set, the default value is 1.
598         /// </summary>
599         /// <since_tizen> 3 </since_tizen>
600         public float ColumnSpan
601         {
602             get
603             {
604                 return (float)GetValue(ColumnSpanProperty);
605             }
606             set
607             {
608                 SetValue(ColumnSpanProperty, value);
609                 NotifyPropertyChanged();
610             }
611         }
612
613         /// <summary>
614         /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
615         /// </summary>
616         /// <since_tizen> 3 </since_tizen>
617         public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
618         {
619             get
620             {
621                 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
622             }
623             set
624             {
625                 SetValue(CellHorizontalAlignmentProperty, value);
626                 NotifyPropertyChanged();
627             }
628         }
629
630         /// <summary>
631         /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
632         /// </summary>
633         /// <since_tizen> 3 </since_tizen>
634         public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
635         {
636             get
637             {
638                 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
639             }
640             set
641             {
642                 SetValue(CellVerticalAlignmentProperty, value);
643                 NotifyPropertyChanged();
644             }
645         }
646
647         /// <summary>
648         /// The left focusable view.<br />
649         /// This will return null if not set.<br />
650         /// This will also return null if the specified left focusable view is not on a window.<br />
651         /// </summary>
652         /// <since_tizen> 3 </since_tizen>
653         public View LeftFocusableView
654         {
655             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
656             get
657             {
658                 return (View)GetValue(LeftFocusableViewProperty);
659             }
660             set
661             {
662                 SetValue(LeftFocusableViewProperty, value);
663                 NotifyPropertyChanged();
664             }
665         }
666
667         /// <summary>
668         /// The right focusable view.<br />
669         /// This will return null if not set.<br />
670         /// This will also return null if the specified right focusable view is not on a window.<br />
671         /// </summary>
672         /// <since_tizen> 3 </since_tizen>
673         public View RightFocusableView
674         {
675             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
676             get
677             {
678                 return (View)GetValue(RightFocusableViewProperty);
679             }
680             set
681             {
682                 SetValue(RightFocusableViewProperty, value);
683                 NotifyPropertyChanged();
684             }
685         }
686
687         /// <summary>
688         /// The up focusable view.<br />
689         /// This will return null if not set.<br />
690         /// This will also return null if the specified up focusable view is not on a window.<br />
691         /// </summary>
692         /// <since_tizen> 3 </since_tizen>
693         public View UpFocusableView
694         {
695             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
696             get
697             {
698                 return (View)GetValue(UpFocusableViewProperty);
699             }
700             set
701             {
702                 SetValue(UpFocusableViewProperty, value);
703                 NotifyPropertyChanged();
704             }
705         }
706
707         /// <summary>
708         /// The down focusable view.<br />
709         /// This will return null if not set.<br />
710         /// This will also return null if the specified down focusable view is not on a window.<br />
711         /// </summary>
712         /// <since_tizen> 3 </since_tizen>
713         public View DownFocusableView
714         {
715             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
716             get
717             {
718                 return (View)GetValue(DownFocusableViewProperty);
719             }
720             set
721             {
722                 SetValue(DownFocusableViewProperty, value);
723                 NotifyPropertyChanged();
724             }
725         }
726
727         /// <summary>
728         /// Whether the view should be focusable by keyboard navigation.
729         /// </summary>
730         /// <since_tizen> 3 </since_tizen>
731         public bool Focusable
732         {
733             set
734             {
735                 SetValue(FocusableProperty, value);
736                 NotifyPropertyChanged();
737             }
738             get
739             {
740                 return (bool)GetValue(FocusableProperty);
741             }
742         }
743
744         /// <summary>
745         /// Whether the children of this view can be focusable by keyboard navigation. If user sets this to false, the children of this actor view will not be focused.
746         /// Note : Default value is true.
747         /// </summary>
748         [EditorBrowsable(EditorBrowsableState.Never)]
749         public bool FocusableChildren
750         {
751             set
752             {
753                 SetValue(FocusableChildrenProperty, value);
754                 NotifyPropertyChanged();
755             }
756             get
757             {
758                 return (bool)GetValue(FocusableChildrenProperty);
759             }
760         }
761
762         /// <summary>
763         /// Whether this view can focus by touch.
764         /// If Focusable is false, FocusableInTouch is disabled.
765         /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
766         /// </summary>
767         [EditorBrowsable(EditorBrowsableState.Never)]
768         public bool FocusableInTouch
769         {
770             set
771             {
772                 SetValue(FocusableInTouchProperty, value);
773                 NotifyPropertyChanged();
774             }
775             get
776             {
777                 return (bool)GetValue(FocusableInTouchProperty);
778             }
779         }
780
781         /// <summary>
782         ///  Retrieves the position of the view.<br />
783         ///  The coordinates are relative to the view's parent.<br />
784         /// </summary>
785         /// <since_tizen> 3 </since_tizen>
786         public Position CurrentPosition
787         {
788             get
789             {
790                 return GetCurrentPosition();
791             }
792         }
793
794         /// <summary>
795         /// Sets the size of a view for the width and the height.<br />
796         /// Geometry can be scaled to fit within this area.<br />
797         /// This does not interfere with the view's scale factor.<br />
798         /// The views default depth is the minimum of width and height.<br />
799         /// </summary>
800         /// <remarks>
801         /// This NUI object (Size2D) typed property can be configured by multiple cascade setting. <br />
802         /// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ). <br />
803         /// </remarks>
804         /// <since_tizen> 3 </since_tizen>
805         public Size2D Size2D
806         {
807             get
808             {
809                 Size2D temp = (Size2D)GetValue(Size2DProperty);
810                 int width = temp.Width;
811                 int height = temp.Height;
812
813                 if (this.Layout == null)
814                 {
815                     if (width < 0) { width = 0; }
816                     if (height < 0) { height = 0; }
817                 }
818
819                 return new Size2D(OnSize2DChanged, width, height);
820             }
821             set
822             {
823                 sizeSetExplicitly = value;  // Store size set by API, will be used in place of NaturalSize if not set.
824                 SetValue(Size2DProperty, value);
825                 // Set Specification so when layouts measure this View it matches the value set here.
826                 // All Views are currently Layouts.
827                 MeasureSpecificationWidth = new MeasureSpecification(new LayoutLength(value.Width), MeasureSpecification.ModeType.Exactly);
828                 MeasureSpecificationHeight = new MeasureSpecification(new LayoutLength(value.Height), MeasureSpecification.ModeType.Exactly);
829                 _widthPolicy = value.Width;
830                 _heightPolicy = value.Height;
831                 
832                 _layout?.RequestLayout();
833                 NotifyPropertyChanged();
834             }
835         }
836
837         /// <summary>
838         ///  Retrieves the size of the view.<br />
839         ///  The coordinates are relative to the view's parent.<br />
840         /// </summary>
841         /// <since_tizen> 3 </since_tizen>
842         public Size2D CurrentSize
843         {
844             get
845             {
846                 return GetCurrentSize();
847             }
848         }
849
850         /// <summary>
851         /// Retrieves and sets the view's opacity.<br />
852         /// </summary>
853         /// <since_tizen> 3 </since_tizen>
854         public float Opacity
855         {
856             get
857             {
858                 return (float)GetValue(OpacityProperty);
859             }
860             set
861             {
862                 SetValue(OpacityProperty, value);
863                 selectorData?.Opacity.UpdateIfNeeds(this, value);
864                 NotifyPropertyChanged();
865             }
866         }
867
868         /// <summary>
869         /// Sets the position of the view for X and Y.<br />
870         /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
871         /// If the position inheritance is disabled, sets the world position.<br />
872         /// </summary>
873         /// <remarks>
874         /// This NUI object (Position2D) typed property can be configured by multiple cascade setting. <br />
875         /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ). <br />
876         /// </remarks>
877         /// <since_tizen> 3 </since_tizen>
878         public Position2D Position2D
879         {
880             get
881             {
882                 Position2D temp = (Position2D)GetValue(Position2DProperty);
883                 return new Position2D(OnPosition2DChanged, temp.X, temp.Y);
884             }
885             set
886             {
887                 SetValue(Position2DProperty, value);
888                 NotifyPropertyChanged();
889             }
890         }
891
892         /// <summary>
893         /// Retrieves the screen postion of the view.<br />
894         /// </summary>
895         /// <since_tizen> 3 </since_tizen>
896         public Vector2 ScreenPosition
897         {
898             get
899             {
900                 Vector2 temp = new Vector2(0.0f, 0.0f);
901                 GetProperty(View.Property.SCREEN_POSITION).Get(temp);
902                 return temp;
903             }
904         }
905
906         /// <summary>
907         /// Determines whether the pivot point should be used to determine the position of the view.
908         /// This is false by default.
909         /// </summary>
910         /// <remarks>If false, then the top-left of the view is used for the position.
911         /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
912         /// </remarks>
913         /// <since_tizen> 3 </since_tizen>
914         public bool PositionUsesPivotPoint
915         {
916             get
917             {
918                 return (bool)GetValue(PositionUsesPivotPointProperty);
919             }
920             set
921             {
922                 SetValue(PositionUsesPivotPointProperty, value);
923                 NotifyPropertyChanged();
924             }
925         }
926
927         /// <summary>
928         /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead!
929         /// </summary>
930         /// <since_tizen> 3 </since_tizen>
931         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " +
932             "Like: " +
933             "View view = new View(); " +
934             "view.PivotPoint = PivotPoint.Center; " +
935             "view.PositionUsesPivotPoint = true;" +
936             " Deprecated in API5: Will be removed in API8")]
937         [EditorBrowsable(EditorBrowsableState.Never)]
938         public bool PositionUsesAnchorPoint
939         {
940             get
941             {
942                 bool temp = false;
943                 GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp);
944                 return temp;
945             }
946             set
947             {
948                 SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
949                 NotifyPropertyChanged();
950             }
951         }
952
953         /// <summary>
954         /// Queries whether the view is connected to the stage.<br />
955         /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
956         /// </summary>
957         /// <since_tizen> 3 </since_tizen>
958         public bool IsOnWindow
959         {
960             get
961             {
962                 return OnWindow();
963             }
964         }
965
966         /// <summary>
967         /// Gets the depth in the hierarchy for the view.
968         /// </summary>
969         /// <since_tizen> 3 </since_tizen>
970         public int HierarchyDepth
971         {
972             get
973             {
974                 return GetHierarchyDepth();
975             }
976         }
977
978         /// <summary>
979         /// Sets the sibling order of the view so the depth position can be defined within the same parent.
980         /// </summary>
981         /// <remarks>
982         /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
983         /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
984         /// The values set by this property will likely change.
985         /// </remarks>
986         /// <since_tizen> 3 </since_tizen>
987         public int SiblingOrder
988         {
989             get
990             {
991                 return (int)GetValue(SiblingOrderProperty);
992             }
993             set
994             {
995                 SetValue(SiblingOrderProperty, value);
996
997                 LayoutGroup layout = Layout as LayoutGroup;
998                 layout?.ChangeLayoutSiblingOrder(value);
999
1000                 NotifyPropertyChanged();
1001             }
1002         }
1003
1004         /// <summary>
1005         /// Returns the natural size of the view.
1006         /// </summary>
1007         /// <remarks>
1008         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1009         /// </remarks>
1010         /// <since_tizen> 5 </since_tizen>
1011         public Vector3 NaturalSize
1012         {
1013             get
1014             {
1015                 Vector3 ret = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true);
1016                 if (NDalicPINVOKE.SWIGPendingException.Pending)
1017                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1018                 return ret;
1019             }
1020         }
1021
1022         /// <summary>
1023         /// Returns the natural size (Size2D) of the view.
1024         /// </summary>
1025         /// <remarks>
1026         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1027         /// </remarks>
1028         /// <since_tizen> 4 </since_tizen>
1029         public Size2D NaturalSize2D
1030         {
1031             get
1032             {
1033                 Vector3 temp = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true);
1034                 if (NDalicPINVOKE.SWIGPendingException.Pending)
1035                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1036
1037                 return new Size2D((int)temp.Width, (int)temp.Height);
1038             }
1039         }
1040
1041         /// <summary>
1042         /// Gets or sets the origin of a view within its parent's area.<br />
1043         /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent, and (1.0, 1.0, 0.5) is the bottom-right corner.<br />
1044         /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1045         /// A view's position is the distance between this origin and the view's anchor-point.<br />
1046         /// </summary>
1047         /// <pre>The view has been initialized.</pre>
1048         /// <since_tizen> 3 </since_tizen>
1049         public Position ParentOrigin
1050         {
1051             get
1052             {
1053                 Position tmp = (Position)GetValue(ParentOriginProperty);
1054                 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1055             }
1056             set
1057             {
1058                 SetValue(ParentOriginProperty, value);
1059                 NotifyPropertyChanged();
1060             }
1061         }
1062
1063         /// <summary>
1064         /// Gets or sets the anchor-point of a view.<br />
1065         /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the view, and (1.0, 1.0, 0.5) is the bottom-right corner.<br />
1066         /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1067         /// A view position is the distance between its parent-origin and this anchor-point.<br />
1068         /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1069         /// <pre>The view has been initialized.</pre>
1070         /// </summary>
1071         /// <remarks>
1072         /// The property cascade chaining set is possible. For example, this (view.PivotPoint.X = 0.1f;) is possible.
1073         /// </remarks>
1074         /// <since_tizen> 3 </since_tizen>
1075         public Position PivotPoint
1076         {
1077             get
1078             {
1079                 Position tmp = (Position)GetValue(PivotPointProperty);
1080                 return new Position(OnPivotPointChanged, tmp.X, tmp.Y, tmp.Z);
1081             }
1082             set
1083             {
1084                 SetValue(PivotPointProperty, value);
1085                 NotifyPropertyChanged();
1086             }
1087         }
1088
1089         /// <summary>
1090         /// Gets or sets the size width of the view.
1091         /// </summary>
1092         /// <remarks>
1093         /// <para>
1094         /// Animatable - This property can be animated using <c>Animation</c> class.
1095         /// </para>
1096         /// </remarks>
1097         /// <since_tizen> 3 </since_tizen>
1098         public float SizeWidth
1099         {
1100             get
1101             {
1102                 return (float)GetValue(SizeWidthProperty);
1103             }
1104             set
1105             {
1106                 SetValue(SizeWidthProperty, value);
1107                 NotifyPropertyChanged();
1108             }
1109         }
1110
1111         /// <summary>
1112         /// Gets or sets the size height of the view.
1113         /// </summary>
1114         /// <remarks>
1115         /// <para>
1116         /// Animatable - This property can be animated using <c>Animation</c> class.
1117         /// </para>
1118         /// </remarks>
1119         /// <since_tizen> 3 </since_tizen>
1120         public float SizeHeight
1121         {
1122             get
1123             {
1124                 return (float)GetValue(SizeHeightProperty);
1125             }
1126             set
1127             {
1128                 SetValue(SizeHeightProperty, value);
1129                 NotifyPropertyChanged();
1130             }
1131         }
1132
1133         /// <summary>
1134         /// Gets or sets the position of the view.<br />
1135         /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1136         /// If the position inheritance is disabled, sets the world position.<br />
1137         /// </summary>
1138         /// <remarks>
1139         /// <para>
1140         /// Animatable - This property can be animated using <c>Animation</c> class.
1141         /// </para>
1142         /// The property cascade chaining set is possible. For example, this (view.Position.X = 1.0f;) is possible.
1143         /// </remarks>
1144         /// <since_tizen> 3 </since_tizen>
1145         public Position Position
1146         {
1147             get
1148             {
1149                 Position tmp = (Position)GetValue(PositionProperty);
1150                 return new Position(OnPositionChanged, tmp.X, tmp.Y, tmp.Z);
1151             }
1152             set
1153             {
1154                 SetValue(PositionProperty, value);
1155                 NotifyPropertyChanged();
1156             }
1157         }
1158
1159         /// <summary>
1160         /// Gets or sets the position X of the view.
1161         /// </summary>
1162         /// <remarks>
1163         /// <para>
1164         /// Animatable - This property can be animated using <c>Animation</c> class.
1165         /// </para>
1166         /// </remarks>
1167         /// <since_tizen> 3 </since_tizen>
1168         public float PositionX
1169         {
1170             get
1171             {
1172                 return (float)GetValue(PositionXProperty);
1173             }
1174             set
1175             {
1176                 SetValue(PositionXProperty, value);
1177                 NotifyPropertyChanged();
1178             }
1179         }
1180
1181         /// <summary>
1182         /// Gets or sets the position Y of the view.
1183         /// </summary>
1184         /// <remarks>
1185         /// <para>
1186         /// Animatable - This property can be animated using <c>Animation</c> class.
1187         /// </para>
1188         /// </remarks>
1189         /// <since_tizen> 3 </since_tizen>
1190         public float PositionY
1191         {
1192             get
1193             {
1194                 return (float)GetValue(PositionYProperty);
1195             }
1196             set
1197             {
1198                 SetValue(PositionYProperty, value);
1199                 NotifyPropertyChanged();
1200             }
1201         }
1202
1203         /// <summary>
1204         /// Gets or sets the position Z of the view.
1205         /// </summary>
1206         /// <remarks>
1207         /// <para>
1208         /// Animatable - This property can be animated using <c>Animation</c> class.
1209         /// </para>
1210         /// </remarks>
1211         /// <since_tizen> 3 </since_tizen>
1212         public float PositionZ
1213         {
1214             get
1215             {
1216                 return (float)GetValue(PositionZProperty);
1217             }
1218             set
1219             {
1220                 SetValue(PositionZProperty, value);
1221                 NotifyPropertyChanged();
1222             }
1223         }
1224
1225         /// <summary>
1226         /// Gets or sets the world position of the view.
1227         /// </summary>
1228         /// <since_tizen> 3 </since_tizen>
1229         public Vector3 WorldPosition
1230         {
1231             get
1232             {
1233                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1234                 GetProperty(View.Property.WORLD_POSITION).Get(temp);
1235                 return temp;
1236             }
1237         }
1238
1239         /// <summary>
1240         /// Gets or sets the orientation of the view.<br />
1241         /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1242         /// </summary>
1243         /// <remarks>
1244         /// <para>
1245         /// This is an asynchronous method.
1246         /// </para>
1247         /// <para>
1248         /// Animatable - This property can be animated using <c>Animation</c> class.
1249         /// </para>
1250         /// </remarks>
1251         /// <since_tizen> 3 </since_tizen>
1252         public Rotation Orientation
1253         {
1254             get
1255             {
1256                 return (Rotation)GetValue(OrientationProperty);
1257             }
1258             set
1259             {
1260                 SetValue(OrientationProperty, value);
1261                 NotifyPropertyChanged();
1262             }
1263         }
1264
1265         /// <summary>
1266         /// Gets or sets the world orientation of the view.<br />
1267         /// </summary>
1268         /// <since_tizen> 3 </since_tizen>
1269         public Rotation WorldOrientation
1270         {
1271             get
1272             {
1273                 Rotation temp = new Rotation();
1274                 GetProperty(View.Property.WORLD_ORIENTATION).Get(temp);
1275                 return temp;
1276             }
1277         }
1278
1279         /// <summary>
1280         /// Gets or sets the scale factor applied to the view.<br />
1281         /// </summary>
1282         /// <remarks>
1283         /// <para>
1284         /// Animatable - This property can be animated using <c>Animation</c> class.
1285         /// </para>
1286         /// The property cascade chaining set is possible. For example, this (view.Scale.X = 0.1f;) is possible.
1287         /// </remarks>
1288         /// <since_tizen> 3 </since_tizen>
1289         public Vector3 Scale
1290         {
1291             get
1292             {
1293                 Vector3 temp = (Vector3)GetValue(ScaleProperty);
1294                 return new Vector3(OnScaleChanged, temp.X, temp.Y, temp.Z);
1295             }
1296             set
1297             {
1298                 SetValue(ScaleProperty, value);
1299                 NotifyPropertyChanged();
1300             }
1301         }
1302
1303         /// <summary>
1304         /// Gets or sets the scale X factor applied to the view.
1305         /// </summary>
1306         /// <remarks>
1307         /// <para>
1308         /// Animatable - This property can be animated using <c>Animation</c> class.
1309         /// </para>
1310         /// </remarks>
1311         /// <since_tizen> 3 </since_tizen>
1312         public float ScaleX
1313         {
1314             get
1315             {
1316                 return (float)GetValue(ScaleXProperty);
1317             }
1318             set
1319             {
1320                 SetValue(ScaleXProperty, value);
1321                 NotifyPropertyChanged();
1322             }
1323         }
1324
1325         /// <summary>
1326         /// Gets or sets the scale Y factor applied to the view.
1327         /// </summary>
1328         /// <remarks>
1329         /// <para>
1330         /// Animatable - This property can be animated using <c>Animation</c> class.
1331         /// </para>
1332         /// </remarks>
1333         /// <since_tizen> 3 </since_tizen>
1334         public float ScaleY
1335         {
1336             get
1337             {
1338                 return (float)GetValue(ScaleYProperty);
1339             }
1340             set
1341             {
1342                 SetValue(ScaleYProperty, value);
1343                 NotifyPropertyChanged();
1344             }
1345         }
1346
1347         /// <summary>
1348         /// Gets or sets the scale Z factor applied to the view.
1349         /// </summary>
1350         /// <remarks>
1351         /// <para>
1352         /// Animatable - This property can be animated using <c>Animation</c> class.
1353         /// </para>
1354         /// </remarks>
1355         /// <since_tizen> 3 </since_tizen>
1356         public float ScaleZ
1357         {
1358             get
1359             {
1360                 return (float)GetValue(ScaleZProperty);
1361             }
1362             set
1363             {
1364                 SetValue(ScaleZProperty, value);
1365                 NotifyPropertyChanged();
1366             }
1367         }
1368
1369         /// <summary>
1370         /// Gets the world scale of the view.
1371         /// </summary>
1372         /// <since_tizen> 3 </since_tizen>
1373         public Vector3 WorldScale
1374         {
1375             get
1376             {
1377                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1378                 GetProperty(View.Property.WORLD_SCALE).Get(temp);
1379                 return temp;
1380             }
1381         }
1382
1383         /// <summary>
1384         /// Retrieves the visibility flag of the view.
1385         /// </summary>
1386         /// <remarks>
1387         /// <para>
1388         /// If the view is not visible, then the view and its children will not be rendered.
1389         /// This is regardless of the individual visibility values of the children, i.e., the view will only be rendered if all of its parents have visibility set to true.
1390         /// </para>
1391         /// <para>
1392         /// Animatable - This property can be animated using <c>Animation</c> class.
1393         /// </para>
1394         /// </remarks>
1395         /// <since_tizen> 3 </since_tizen>
1396         public bool Visibility
1397         {
1398             get
1399             {
1400                 bool temp = false;
1401                 GetProperty(View.Property.VISIBLE).Get(out temp);
1402                 return temp;
1403             }
1404         }
1405
1406         /// <summary>
1407         /// Gets the view's world color.
1408         /// </summary>
1409         /// <since_tizen> 3 </since_tizen>
1410         public Vector4 WorldColor
1411         {
1412             get
1413             {
1414                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1415                 GetProperty(View.Property.WORLD_COLOR).Get(temp);
1416                 return temp;
1417             }
1418         }
1419
1420         /// <summary>
1421         /// Gets or sets the view's name.
1422         /// </summary>
1423         /// <since_tizen> 3 </since_tizen>
1424         public string Name
1425         {
1426             get
1427             {
1428                 return (string)GetValue(NameProperty);
1429             }
1430             set
1431             {
1432                 SetValue(NameProperty, value);
1433                 NotifyPropertyChanged();
1434             }
1435         }
1436
1437         /// <summary>
1438         /// Get the number of children held by the view.
1439         /// </summary>
1440         /// <since_tizen> 3 </since_tizen>
1441         public new uint ChildCount
1442         {
1443             get
1444             {
1445                 return GetChildCount();
1446             }
1447         }
1448
1449         /// <summary>
1450         /// Gets the view's ID.
1451         /// Readonly
1452         /// </summary>
1453         /// <since_tizen> 3 </since_tizen>
1454         public uint ID
1455         {
1456             get
1457             {
1458                 return GetId();
1459             }
1460         }
1461
1462         /// <summary>
1463         /// Gets or sets the status of whether the view should emit touch or hover signals.
1464         /// </summary>
1465         /// <since_tizen> 3 </since_tizen>
1466         public bool Sensitive
1467         {
1468             get
1469             {
1470                 return (bool)GetValue(SensitiveProperty);
1471             }
1472             set
1473             {
1474                 SetValue(SensitiveProperty, value);
1475                 NotifyPropertyChanged();
1476             }
1477         }
1478
1479         /// <summary>
1480         /// Gets or sets the status of whether the view should receive a notification when touch or hover motion events leave the boundary of the view.
1481         /// </summary>
1482         /// <since_tizen> 3 </since_tizen>
1483         public bool LeaveRequired
1484         {
1485             get
1486             {
1487                 return (bool)GetValue(LeaveRequiredProperty);
1488             }
1489             set
1490             {
1491                 SetValue(LeaveRequiredProperty, value);
1492                 NotifyPropertyChanged();
1493             }
1494         }
1495
1496         /// <summary>
1497         /// Gets or sets the status of whether a child view inherits it's parent's orientation.
1498         /// </summary>
1499         /// <since_tizen> 3 </since_tizen>
1500         public bool InheritOrientation
1501         {
1502             get
1503             {
1504                 return (bool)GetValue(InheritOrientationProperty);
1505             }
1506             set
1507             {
1508                 SetValue(InheritOrientationProperty, value);
1509                 NotifyPropertyChanged();
1510             }
1511         }
1512
1513         /// <summary>
1514         /// Gets or sets the status of whether a child view inherits it's parent's scale.
1515         /// </summary>
1516         /// <since_tizen> 3 </since_tizen>
1517         public bool InheritScale
1518         {
1519             get
1520             {
1521                 return (bool)GetValue(InheritScaleProperty);
1522             }
1523             set
1524             {
1525                 SetValue(InheritScaleProperty, value);
1526                 NotifyPropertyChanged();
1527             }
1528         }
1529
1530         /// <summary>
1531         /// Gets or sets the status of how the view and its children should be drawn.<br />
1532         /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
1533         /// If an object is in a 3D layer, it will be depth-tested against other objects in the world, i.e., it may be obscured if other objects are in front.<br />
1534         /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
1535         /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
1536         /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
1537         /// </summary>
1538         /// <since_tizen> 3 </since_tizen>
1539         public DrawModeType DrawMode
1540         {
1541             get
1542             {
1543                 return (DrawModeType)GetValue(DrawModeProperty);
1544             }
1545             set
1546             {
1547                 SetValue(DrawModeProperty, value);
1548                 NotifyPropertyChanged();
1549             }
1550         }
1551
1552         /// <summary>
1553         /// Gets or sets the relative to parent size factor of the view.<br />
1554         /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
1555         /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
1556         /// </summary>
1557         /// <remarks>
1558         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
1559         /// </remarks>
1560         /// <since_tizen> 3 </since_tizen>
1561         public Vector3 SizeModeFactor
1562         {
1563             get
1564             {
1565                 Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty);
1566                 return new Vector3(OnSizeModeFactorChanged, temp.X, temp.Y, temp.Z);
1567             }
1568             set
1569             {
1570                 SetValue(SizeModeFactorProperty, value);
1571                 NotifyPropertyChanged();
1572             }
1573         }
1574
1575         /// <summary>
1576         /// Gets or sets the width resize policy to be used.
1577         /// </summary>
1578         /// <since_tizen> 3 </since_tizen>
1579         public ResizePolicyType WidthResizePolicy
1580         {
1581             get
1582             {
1583                 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
1584             }
1585             set
1586             {
1587                 SetValue(WidthResizePolicyProperty, value);
1588                 NotifyPropertyChanged();
1589             }
1590         }
1591
1592         /// <summary>
1593         /// Gets or sets the height resize policy to be used.
1594         /// </summary>
1595         /// <since_tizen> 3 </since_tizen>
1596         public ResizePolicyType HeightResizePolicy
1597         {
1598             get
1599             {
1600                 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
1601             }
1602             set
1603             {
1604                 SetValue(HeightResizePolicyProperty, value);
1605                 NotifyPropertyChanged();
1606             }
1607         }
1608
1609         /// <summary>
1610         /// Gets or sets the policy to use when setting size with size negotiation.<br />
1611         /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
1612         /// </summary>
1613         /// <since_tizen> 3 </since_tizen>
1614         public SizeScalePolicyType SizeScalePolicy
1615         {
1616             get
1617             {
1618                 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
1619             }
1620             set
1621             {
1622                 SetValue(SizeScalePolicyProperty, value);
1623                 NotifyPropertyChanged();
1624             }
1625         }
1626
1627         /// <summary>
1628         ///  Gets or sets the status of whether the width size is dependent on the height size.
1629         /// </summary>
1630         /// <since_tizen> 3 </since_tizen>
1631         public bool WidthForHeight
1632         {
1633             get
1634             {
1635                 return (bool)GetValue(WidthForHeightProperty);
1636             }
1637             set
1638             {
1639                 SetValue(WidthForHeightProperty, value);
1640                 NotifyPropertyChanged();
1641             }
1642         }
1643
1644         /// <summary>
1645         /// Gets or sets the status of whether the height size is dependent on the width size.
1646         /// </summary>
1647         /// <since_tizen> 3 </since_tizen>
1648         public bool HeightForWidth
1649         {
1650             get
1651             {
1652                 return (bool)GetValue(HeightForWidthProperty);
1653             }
1654             set
1655             {
1656                 SetValue(HeightForWidthProperty, value);
1657                 NotifyPropertyChanged();
1658             }
1659         }
1660
1661         /// <summary>
1662         /// Gets or sets the padding for use in layout.
1663         /// </summary>
1664         /// <remarks>
1665         /// The property cascade chaining set is possible. For example, this (view.Padding.X = 0.1f;) is possible.
1666         /// </remarks>
1667         /// <since_tizen> 5 </since_tizen>
1668         public Extents Padding
1669         {
1670             get
1671             {
1672                 // If View has a Layout then padding in stored in the base Layout class
1673                 if (Layout != null)
1674                 {
1675                     return Layout.Padding;
1676                 }
1677                 else
1678                 {
1679                     Extents temp = (Extents)GetValue(PaddingProperty);
1680                     return new Extents(OnPaddingChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1681                 }
1682                 // Two return points to prevent creating a zeroed Extent native object before assignment
1683             }
1684             set
1685             {
1686                 Extents padding = value;
1687                 if (Layout != null)
1688                 {
1689                     // Layout set so store Padding in LayoutItem instead of in View.
1690                     // If View stores the Padding value then Legacy Size Negotiation will overwrite
1691                     // the position and sizes measure in the Layouting.
1692                     Layout.Padding = value;
1693                     // If Layout is a LayoutItem then it could be a View that handles it's own padding.
1694                     // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
1695                     if (typeof(LayoutGroup).IsAssignableFrom(Layout.GetType())) // If a Layout container of some kind.
1696                     {
1697                         padding = new Extents(0, 0, 0, 0); // Reset value stored in View.
1698                     }
1699                 }
1700
1701                 SetValue(PaddingProperty, padding);
1702                 NotifyPropertyChanged();
1703             }
1704         }
1705
1706         /// <summary>
1707         /// Gets or sets the minimum size the view can be assigned in size negotiation.
1708         /// </summary>
1709         /// <remarks>
1710         /// The property cascade chaining set is possible. For example, this (view.MinimumSize.Width = 1;) is possible.
1711         /// </remarks>
1712         /// <since_tizen> 3 </since_tizen>
1713         public Size2D MinimumSize
1714         {
1715             get
1716             {
1717                 Size2D tmp = (Size2D)GetValue(MinimumSizeProperty);
1718                 return new Size2D(OnMinimumSizeChanged, tmp.Width, tmp.Height);
1719             }
1720             set
1721             {
1722                 if (_layout != null)
1723                 {
1724                     // Note: it only works if minimum size is >= than natural size.
1725                     // To force the size it should be done through the width&height spec or Size2D.
1726                     _layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
1727                     _layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
1728                     _layout.RequestLayout();
1729                 }
1730                 SetValue(MinimumSizeProperty, value);
1731                 NotifyPropertyChanged();
1732             }
1733         }
1734
1735         /// <summary>
1736         /// Gets or sets the maximum size the view can be assigned in size negotiation.
1737         /// </summary>
1738         /// <remarks>
1739         /// The property cascade chaining set is possible. For example, this (view.MaximumSize.Width = 1;) is possible.
1740         /// </remarks>
1741         /// <since_tizen> 3 </since_tizen>
1742         public Size2D MaximumSize
1743         {
1744             get
1745             {
1746                 Size2D tmp = (Size2D)GetValue(MaximumSizeProperty);
1747                 return new Size2D(OnMaximumSizeChanged, tmp.Width, tmp.Height);
1748             }
1749             set
1750             {
1751                 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
1752                 // MATCH_PARENT spec + parent container size can be used to limit
1753                 if (_layout != null)
1754                 {
1755                     _layout.RequestLayout();
1756                 }
1757                 SetValue(MaximumSizeProperty, value);
1758                 NotifyPropertyChanged();
1759             }
1760         }
1761
1762         /// <summary>
1763         /// Gets or sets whether a child view inherits it's parent's position.<br />
1764         /// Default is to inherit.<br />
1765         /// Switching this off means that using position sets the view's world position, i.e., translates from the world origin (0,0,0) to the pivot point of the view.<br />
1766         /// </summary>
1767         /// <since_tizen> 3 </since_tizen>
1768         public bool InheritPosition
1769         {
1770             get
1771             {
1772                 return (bool)GetValue(InheritPositionProperty);
1773             }
1774             set
1775             {
1776                 SetValue(InheritPositionProperty, value);
1777                 NotifyPropertyChanged();
1778             }
1779         }
1780
1781         /// <summary>
1782         /// Gets or sets the clipping behavior (mode) of it's children.
1783         /// </summary>
1784         /// <since_tizen> 3 </since_tizen>
1785         public ClippingModeType ClippingMode
1786         {
1787             get
1788             {
1789                 return (ClippingModeType)GetValue(ClippingModeProperty);
1790             }
1791             set
1792             {
1793                 SetValue(ClippingModeProperty, value);
1794                 NotifyPropertyChanged();
1795             }
1796         }
1797
1798         /// <summary>
1799         /// Gets the number of renderers held by the view.
1800         /// </summary>
1801         /// <since_tizen> 3 </since_tizen>
1802         public uint RendererCount
1803         {
1804             get
1805             {
1806                 return GetRendererCount();
1807             }
1808         }
1809
1810         /// <summary>
1811         /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
1812         /// </summary>
1813         /// <remarks>
1814         /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
1815         /// </remarks>
1816         /// <since_tizen> 3 </since_tizen>
1817         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
1818             "Like: " +
1819             "View view = new View(); " +
1820             "view.PivotPoint = PivotPoint.Center; " +
1821             "view.PositionUsesPivotPoint = true;")]
1822         [EditorBrowsable(EditorBrowsableState.Never)]
1823         public Position AnchorPoint
1824         {
1825             get
1826             {
1827                 Position temp = new Position(0.0f, 0.0f, 0.0f);
1828                 GetProperty(View.Property.ANCHOR_POINT).Get(temp);
1829                 return new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
1830             }
1831             set
1832             {
1833                 SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
1834                 NotifyPropertyChanged();
1835             }
1836         }
1837
1838         /// <summary>
1839         /// Sets the size of a view for the width, the height and the depth.<br />
1840         /// Geometry can be scaled to fit within this area.<br />
1841         /// This does not interfere with the view's scale factor.<br />
1842         /// The views default depth is the minimum of width and height.<br />
1843         /// </summary>
1844         /// <remarks>
1845         /// <para>
1846         /// Animatable - This property can be animated using <c>Animation</c> class.
1847         /// </para>
1848         /// The property cascade chaining set is possible. For example, this (view.Size.Width = 1.0f;) is possible.
1849         /// </remarks>
1850         /// <since_tizen> 5 </since_tizen>
1851         public Size Size
1852         {
1853             get
1854             {
1855                 Size tmp = (Size)GetValue(SizeProperty);
1856                 return new Size(OnSizeChanged, tmp.Width, tmp.Height, tmp.Depth);
1857             }
1858             set
1859             {
1860                 SetValue(SizeProperty, value);
1861                 NotifyPropertyChanged();
1862             }
1863         }
1864
1865         /// <summary>
1866         /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
1867         /// </summary>
1868         /// <since_tizen> 3 </since_tizen>
1869         [Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
1870             "Like: " +
1871             "Container parent =  view.GetParent(); " +
1872             "View view = parent as View;")]
1873         [EditorBrowsable(EditorBrowsableState.Never)]
1874         public new View Parent
1875         {
1876             get
1877             {
1878                 View ret;
1879                 IntPtr cPtr = Interop.Actor.Actor_GetParent(swigCPtr);
1880                 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
1881                 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
1882
1883                 if (basehandle is Layer layer)
1884                 {
1885                     ret = new View(Layer.getCPtr(layer).Handle, false);
1886                     NUILog.Error("This Parent property is deprecated, should do not be used");
1887                 }
1888                 else
1889                 {
1890                     ret = basehandle as View;
1891                 }
1892
1893                 Interop.BaseHandle.delete_BaseHandle(CPtr);
1894                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1895
1896                 if (NDalicPINVOKE.SWIGPendingException.Pending)
1897                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1898                 return ret;
1899             }
1900         }
1901
1902         /// <summary>
1903         /// Gets/Sets whether inherit parent's the layout Direction.
1904         /// </summary>
1905         /// <since_tizen> 4 </since_tizen>
1906         public bool InheritLayoutDirection
1907         {
1908             get
1909             {
1910                 return (bool)GetValue(InheritLayoutDirectionProperty);
1911             }
1912             set
1913             {
1914                 SetValue(InheritLayoutDirectionProperty, value);
1915                 NotifyPropertyChanged();
1916             }
1917         }
1918
1919         /// <summary>
1920         /// Gets/Sets the layout Direction.
1921         /// </summary>
1922         /// <since_tizen> 4 </since_tizen>
1923         public ViewLayoutDirectionType LayoutDirection
1924         {
1925             get
1926             {
1927                 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
1928             }
1929             set
1930             {
1931                 SetValue(LayoutDirectionProperty, value);
1932                 NotifyPropertyChanged();
1933                 _layout?.RequestLayout();
1934             }
1935         }
1936
1937         /// <summary>
1938         /// Gets or sets the Margin for use in layout.
1939         /// </summary>
1940         /// <remarks>
1941         /// Margin property is supported by Layout algorithms and containers.
1942         /// Please Set Layout if you want to use Margin property.
1943         /// The property cascade chaining set is possible. For example, this (view.Margin.X = 0.1f;) is possible.
1944         /// </remarks>
1945         /// <since_tizen> 4 </since_tizen>
1946         public Extents Margin
1947         {
1948             get
1949             {
1950                 // If View has a Layout then margin is stored in Layout.
1951                 if (Layout != null)
1952                 {
1953                     return Layout.Margin;
1954                 }
1955                 else
1956                 {
1957                     // If Layout not set then return margin stored in View.
1958                     Extents temp = (Extents)GetValue(MarginProperty);
1959                     return new Extents(OnMarginChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1960                 }
1961                 // Two return points to prevent creating a zeroed Extent native object before assignment
1962             }
1963             set
1964             {
1965                 if (Layout != null)
1966                 {
1967                     // Layout set so store Margin in LayoutItem instead of View.
1968                     // If View stores the Margin too then the Legacy Size Negotiation will
1969                     // overwrite the position and size values measured in the Layouting.
1970                     Layout.Margin = value;
1971                     SetValue(MarginProperty, new Extents(0,0,0,0));
1972                     _layout?.RequestLayout();
1973                 }
1974                 else
1975                 {
1976                     SetValue(MarginProperty, value);
1977                 }
1978                 NotifyPropertyChanged();
1979                 _layout?.RequestLayout();
1980             }
1981         }
1982
1983         ///<summary>
1984         /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
1985         ///</summary>
1986         /// <since_tizen> 6 </since_tizen>
1987         public int WidthSpecification
1988         {
1989             get
1990             {
1991                 return _widthPolicy;
1992             }
1993             set
1994             {
1995                 _widthPolicy = value;
1996                 if( _oldWidthPolicy != _widthPolicy )
1997                 {
1998                     if (_widthPolicy >= 0)
1999                     {
2000                         _measureSpecificationWidth = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
2001
2002                         if(_heightPolicy>=0) // Policy an exact value
2003                         {
2004                             // Create Size2D only both _widthPolicy and _heightPolicy are set.
2005                             Size2D = new Size2D(_widthPolicy,_heightPolicy);
2006                         }
2007                     }
2008                     _layout?.RequestLayout();
2009                     _oldWidthPolicy = _widthPolicy;
2010                 }
2011             }
2012         }
2013
2014         ///<summary>
2015         /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
2016         ///</summary>
2017         /// <since_tizen> 6 </since_tizen>
2018         public int HeightSpecification
2019         {
2020             get
2021             {
2022                 return _heightPolicy;
2023             }
2024             set
2025             {
2026                 _heightPolicy = value;
2027                 if( _oldHeightPolicy != _heightPolicy )
2028                 {
2029                     if (_heightPolicy >= 0)
2030                     {
2031                         _measureSpecificationHeight = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
2032
2033                         if(_widthPolicy>=0) // Policy an exact value
2034                         {
2035                             // Create Size2D only both _widthPolicy and _heightPolicy are set.
2036                             Size2D = new Size2D(_widthPolicy,_heightPolicy);
2037                         }
2038
2039                     }
2040                     _layout?.RequestLayout();
2041                     _oldHeightPolicy = _heightPolicy;
2042                 }
2043             }
2044         }
2045
2046         ///<summary>
2047         /// Gets the List of transitions for this View.
2048         ///</summary>
2049         /// <since_tizen> 6 </since_tizen>
2050         public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2051         {
2052             get
2053             {
2054                 if (_layoutTransitions == null)
2055                 {
2056                     _layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2057                 }
2058                 return _layoutTransitions;
2059             }
2060         }
2061
2062         ///<summary>
2063         /// Set a layout transitions for this View.
2064         ///</summary>
2065         /// <remarks>
2066         /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2067         /// </remarks>
2068         /// <since_tizen> 6 </since_tizen>
2069         public LayoutTransition LayoutTransition
2070         {
2071             set
2072             {
2073                 if (_layoutTransitions == null)
2074                 {
2075                     _layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2076                 }
2077                 LayoutTransitionsHelper.AddTransitionForCondition(_layoutTransitions,value.Condition,value, true);
2078
2079                 AttachTransitionsToChildren(value);
2080             }
2081         }
2082
2083         /// <summary>
2084         /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
2085         /// </summary>
2086         /// <remarks>
2087         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2088         /// </remarks>
2089         /// <since_tizen> 4 </since_tizen>
2090         [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
2091         [EditorBrowsable(EditorBrowsableState.Never)]
2092         public Extents PaddingEX
2093         {
2094             get
2095             {
2096                 Extents temp = new Extents(0, 0, 0, 0);
2097                 GetProperty(View.Property.PADDING).Get(temp);
2098                 return new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2099             }
2100             set
2101             {
2102                 SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value));
2103                 NotifyPropertyChanged();
2104                 _layout?.RequestLayout();
2105             }
2106         }
2107
2108         /// <since_tizen> 6 </since_tizen>
2109         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2110         [EditorBrowsable(EditorBrowsableState.Never)]
2111         public Style XamlStyle
2112         {
2113             get
2114             {
2115                 return (Style)GetValue(XamlStyleProperty);
2116             }
2117             set
2118             {
2119                 SetValue(XamlStyleProperty, value);
2120             }
2121         }
2122
2123         /// <summary>
2124         /// The Color of View. This is an RGBA value.
2125         /// </summary>
2126         /// <remarks>
2127         /// <para>
2128         /// Animatable - This property can be animated using <c>Animation</c> class.
2129         /// </para>
2130         /// The property cascade chaining set is possible. For example, this (view.Color.X = 0.1f;) is possible.
2131         /// </remarks>
2132         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2133         [EditorBrowsable(EditorBrowsableState.Never)]
2134         public Color Color
2135         {
2136             get
2137             {
2138                 Color temp = (Color)GetValue(ColorProperty);
2139                 return new Color(OnColorChanged, temp.R, temp.G, temp.B, temp.A);
2140             }
2141             set
2142             {
2143                 SetValue(ColorProperty, value);
2144                 selectorData?.Color.UpdateIfNeeds(this, value);
2145                 NotifyPropertyChanged();
2146             }
2147         }
2148
2149         /// <summary>
2150         /// Set the layout on this View. Replaces any existing Layout.
2151         /// </summary>
2152         /// <since_tizen> 6 </since_tizen>
2153         public LayoutItem Layout
2154         {
2155             get
2156             {
2157                 return _layout;
2158             }
2159             set
2160             {
2161                 // Do nothing if layout provided is already set on this View.
2162                 if (value == _layout)
2163                 {
2164                     return;
2165                 }
2166
2167                 layoutingDisabled = false;
2168                 layoutSet = true;
2169
2170                 // If new layout being set already has a owner then that owner receives a replacement default layout.
2171                 // First check if the layout to be set already has a owner.
2172                 if (value?.Owner != null)
2173                 {
2174                     // Previous owner of the layout gets a default layout as a replacement.
2175                     value.Owner.Layout = new AbsoluteLayout();
2176
2177                     // Copy Margin and Padding to replacement LayoutGroup.
2178                     if (value.Owner.Layout != null)
2179                     {
2180                         value.Owner.Layout.Margin = value.Margin;
2181                         value.Owner.Layout.Padding = value.Padding;
2182                     }
2183                 }
2184
2185                 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2186                 // View if no replacement. Previously margin and padding values would have been moved from
2187                 // the View to the layout.
2188                 if (_layout != null ) // Existing layout
2189                 {
2190                     if (value != null)
2191                     {
2192                         // Existing layout being replaced so copy over margin and padding values.
2193                         value.Margin = _layout.Margin;
2194                         value.Padding = _layout.Padding;
2195                     }
2196                     else
2197                     {
2198                       // Layout not being replaced so restore margin and padding to View.
2199                       SetValue(MarginProperty, _layout.Margin);
2200                       SetValue(PaddingProperty, _layout.Padding);
2201                       NotifyPropertyChanged();
2202                     }
2203                 }
2204                 else
2205                 {
2206                     // First Layout to be added to the View hence copy
2207                     // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2208                     if (value != null)
2209                     {
2210                         if (Margin.Top != 0 || Margin.Bottom != 0 || Margin.Start != 0 || Margin.End != 0)
2211                         {
2212                             // If View already has a margin set then store it in Layout instead.
2213                             value.Margin = Margin;
2214                             SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2215                             NotifyPropertyChanged();
2216                         }
2217
2218                         if (Padding.Top != 0 || Padding.Bottom != 0 || Padding.Start != 0 || Padding.End != 0)
2219                         {
2220                             // If View already has a padding set then store it in Layout instead.
2221                             value.Padding = Padding;
2222                             // If Layout is a LayoutItem then it could be a View that handles it's own padding.
2223                             // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
2224                             if (typeof(LayoutGroup).IsAssignableFrom(value.GetType())) // If a Layout container of some kind.
2225                             {
2226                                 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
2227                                 NotifyPropertyChanged();
2228                             }
2229                         }
2230                     }
2231                 }
2232
2233                 // Remove existing layout from it's parent layout group.
2234                 _layout?.Unparent();
2235
2236                 // Set layout to this view
2237                 SetLayout(value);
2238             }
2239         }
2240
2241         /// <summary>
2242         /// The weight of the View, used to share available space in a layout with siblings.
2243         /// </summary>
2244         /// <since_tizen> 6 </since_tizen>
2245         public float Weight
2246         {
2247             get
2248             {
2249                 return _weight;
2250             }
2251             set
2252             {
2253                 _weight = value;
2254                 _layout?.RequestLayout();
2255             }
2256         }
2257
2258         /// <summary>
2259         ///  Whether to load the BackgroundImage synchronously.
2260         ///  If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2261         ///  Note: For Normal Quad images only.
2262         /// </summary>
2263         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2264         [EditorBrowsable(EditorBrowsableState.Never)]
2265         public bool BackgroundImageSynchronosLoading
2266         {
2267             get
2268             {
2269                 return _backgroundImageSynchronosLoading;
2270             }
2271             set
2272             {
2273                 _backgroundImageSynchronosLoading = value;
2274
2275                 string bgUrl = null;
2276                 Background.Find(ImageVisualProperty.URL)?.Get(out bgUrl);
2277
2278                 if (!string.IsNullOrEmpty(bgUrl))
2279                 {
2280                     PropertyMap bgMap = this.Background;
2281                     bgMap.Add("synchronousLoading", new PropertyValue(_backgroundImageSynchronosLoading));
2282                     Background = bgMap;
2283                 }
2284             }
2285         }
2286
2287         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2288         [EditorBrowsable(EditorBrowsableState.Never)]
2289         public Vector2 UpdateSizeHint
2290         {
2291             get
2292             {
2293                 return (Vector2)GetValue(UpdateSizeHintProperty);
2294             }
2295             set
2296             {
2297                 SetValue(UpdateSizeHintProperty, value);
2298                 NotifyPropertyChanged();
2299             }
2300         }
2301
2302         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
2303         [EditorBrowsable(EditorBrowsableState.Never)]
2304         public string[] TransitionNames
2305         {
2306             get
2307             {
2308                 return transitionNames;
2309             }
2310             set
2311             {
2312                 transitionNames = value;
2313                 LoadTransitions();
2314             }
2315         }
2316
2317         /// <summary>
2318         /// Enable/Disable ControlState propagation for children.
2319         /// It is false by default.
2320         /// If the View needs to share ControlState with descendants, please set it true.
2321         /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
2322         /// </summary>
2323         [EditorBrowsable(EditorBrowsableState.Never)]
2324         public bool EnableControlStatePropagation
2325         {
2326             get => controlStatePropagation;
2327             set
2328             {
2329                 controlStatePropagation = value;
2330
2331                 foreach (View child in Children)
2332                 {
2333                     child.EnableControlStatePropagation = value;
2334                 }
2335             }
2336         }
2337
2338         /// <summary>
2339         /// If this property is set to true, the View can have a touch related ControlState (such as Pressed) when touch.
2340         /// By default, it is false in View, true in Control.
2341         /// Note that if the value is true, the View will be a touch receptor.
2342         /// </summary>
2343         [EditorBrowsable(EditorBrowsableState.Never)]
2344         public bool EnableControlState
2345         {
2346             get
2347             {
2348                 return (bool)GetValue(EnableControlStateProperty);
2349             }
2350             set
2351             {
2352                 SetValue(EnableControlStateProperty, value);
2353             }
2354         }
2355
2356          /// <summary>
2357         /// Whether the actor grab all touches even if touch leaves its boundary.
2358         /// </summary>
2359         /// <returns>true, if it grab all touch after start</returns>
2360         [EditorBrowsable(EditorBrowsableState.Never)]
2361         public bool GrabTouchAfterLeave
2362         {
2363             get
2364             {
2365                 bool temp = false;
2366                 GetProperty(View.Property.CaptureAllTouchAfterStart).Get(out temp);
2367                 return temp;
2368             }
2369             set
2370             {
2371                 SetProperty(View.Property.CaptureAllTouchAfterStart, new Tizen.NUI.PropertyValue(value));
2372                 NotifyPropertyChanged();
2373             }
2374         }
2375
2376         /// <summary>
2377         /// If the value is true, the View will change its style as the theme changes.
2378         /// It is false by default, but turned to true when setting StyleName (by setting property or using specified constructor).
2379         /// </summary>
2380         [EditorBrowsable(EditorBrowsableState.Never)]
2381         public bool ThemeChangeSensitive
2382         {
2383             get => (bool)GetValue(ThemeChangeSensitiveProperty);
2384             set => SetValue(ThemeChangeSensitiveProperty, value);
2385         }
2386
2387         /// <summary>
2388         /// Get Style, it is abstract function and must be override.
2389         /// </summary>
2390         /// <since_tizen> 6 </since_tizen>
2391         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2392         // TODO: It should be deprecated. please use CreateViewStyle instead.
2393         [EditorBrowsable(EditorBrowsableState.Never)]
2394         protected virtual ViewStyle GetViewStyle()
2395         {
2396             return CreateViewStyle();
2397         }
2398
2399         /// <summary>
2400         /// Create Style, it is abstract function and must be override.
2401         /// </summary>
2402         [EditorBrowsable(EditorBrowsableState.Never)]
2403         protected virtual ViewStyle CreateViewStyle()
2404         {
2405             return new ViewStyle();
2406         }
2407
2408         /// <summary>
2409         /// Called after the View's ControlStates changed.
2410         /// </summary>
2411         /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
2412         [EditorBrowsable(EditorBrowsableState.Never)]
2413         protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
2414         {
2415         }
2416
2417         /// <summary>
2418         /// </summary>
2419         [EditorBrowsable(EditorBrowsableState.Never)]
2420         protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
2421         {
2422             UpdateStyle();
2423         }
2424
2425         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2426         [EditorBrowsable(EditorBrowsableState.Never)]
2427         public virtual void ApplyStyle(ViewStyle viewStyle)
2428         {
2429             if (null == viewStyle || this.viewStyle == viewStyle) return;
2430
2431             this.viewStyle = viewStyle;
2432
2433             Dictionary<string, BindableProperty> bindablePropertyOfView;
2434             Type viewType = GetType();
2435
2436             Dictionary<string, BindableProperty> bindablePropertyOfStyle;
2437             Type styleType = viewStyle.GetType();
2438
2439             BindableProperty.GetBindablePropertysOfType(viewType, out bindablePropertyOfView);
2440             BindableProperty.GetBindablePropertysOfType(styleType, out bindablePropertyOfStyle);
2441
2442             if (null != bindablePropertyOfView && null != bindablePropertyOfStyle)
2443             {
2444                 foreach (KeyValuePair<string, BindableProperty> keyValuePair in bindablePropertyOfStyle)
2445                 {
2446                     BindableProperty viewProperty;
2447                     bindablePropertyOfView.TryGetValue(keyValuePair.Key, out viewProperty);
2448
2449                     if (null != viewProperty && viewProperty != StyleNameProperty)
2450                     {
2451                         object value = viewStyle.GetValue(keyValuePair.Value);
2452
2453                         if (null != value)
2454                         {
2455                             SetValue(viewProperty, value);
2456                         }
2457                     }
2458                 }
2459             }
2460         }
2461     }
2462 }