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