[NUI] Change setter of property (#2298)
[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                 int width = temp.Width;
771                 int height = temp.Height;
772
773                 if (this.Layout == null)
774                 {
775                     if (width < 0) { width = 0; }
776                     if (height < 0) { height = 0; }
777                 }
778
779                 return new Size2D(OnSize2DChanged, width, height);
780             }
781             set
782             {
783                 sizeSetExplicitly = value;  // Store size set by API, will be used in place of NaturalSize if not set.
784                 SetValue(Size2DProperty, value);
785                 // Set Specification so when layouts measure this View it matches the value set here.
786                 // All Views are currently Layouts.
787                 MeasureSpecificationWidth = new MeasureSpecification(new LayoutLength(value.Width), MeasureSpecification.ModeType.Exactly);
788                 MeasureSpecificationHeight = new MeasureSpecification(new LayoutLength(value.Height), MeasureSpecification.ModeType.Exactly);
789                 _widthPolicy = value.Width;
790                 _heightPolicy = value.Height;
791                 
792                 _layout?.RequestLayout();
793                 NotifyPropertyChanged();
794             }
795         }
796
797         /// <summary>
798         ///  Retrieves the size of the view.<br />
799         ///  The coordinates are relative to the view's parent.<br />
800         /// </summary>
801         /// <since_tizen> 3 </since_tizen>
802         public Size2D CurrentSize
803         {
804             get
805             {
806                 return GetCurrentSize();
807             }
808         }
809
810         /// <summary>
811         /// Retrieves and sets the view's opacity.<br />
812         /// </summary>
813         /// <since_tizen> 3 </since_tizen>
814         public float Opacity
815         {
816             get
817             {
818                 return (float)GetValue(OpacityProperty);
819             }
820             set
821             {
822                 SetValue(OpacityProperty, value);
823                 selectorData?.Opacity.UpdateIfNeeds(this, value);
824                 NotifyPropertyChanged();
825             }
826         }
827
828         /// <summary>
829         /// Sets the position of the view for X and Y.<br />
830         /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
831         /// If the position inheritance is disabled, sets the world position.<br />
832         /// </summary>
833         /// <remarks>
834         /// This NUI object (Position2D) typed property can be configured by multiple cascade setting. <br />
835         /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ). <br />
836         /// </remarks>
837         /// <since_tizen> 3 </since_tizen>
838         public Position2D Position2D
839         {
840             get
841             {
842                 Position2D temp = (Position2D)GetValue(Position2DProperty);
843                 return new Position2D(OnPosition2DChanged, temp.X, temp.Y);
844             }
845             set
846             {
847                 SetValue(Position2DProperty, value);
848                 NotifyPropertyChanged();
849             }
850         }
851
852         /// <summary>
853         /// Retrieves the screen postion of the view.<br />
854         /// </summary>
855         /// <since_tizen> 3 </since_tizen>
856         public Vector2 ScreenPosition
857         {
858             get
859             {
860                 Vector2 temp = new Vector2(0.0f, 0.0f);
861                 GetProperty(View.Property.SCREEN_POSITION).Get(temp);
862                 return temp;
863             }
864         }
865
866         /// <summary>
867         /// Determines whether the pivot point should be used to determine the position of the view.
868         /// This is false by default.
869         /// </summary>
870         /// <remarks>If false, then the top-left of the view is used for the position.
871         /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
872         /// </remarks>
873         /// <since_tizen> 3 </since_tizen>
874         public bool PositionUsesPivotPoint
875         {
876             get
877             {
878                 return (bool)GetValue(PositionUsesPivotPointProperty);
879             }
880             set
881             {
882                 SetValue(PositionUsesPivotPointProperty, value);
883                 NotifyPropertyChanged();
884             }
885         }
886
887         /// <summary>
888         /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead!
889         /// </summary>
890         /// <since_tizen> 3 </since_tizen>
891         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " +
892             "Like: " +
893             "View view = new View(); " +
894             "view.PivotPoint = PivotPoint.Center; " +
895             "view.PositionUsesPivotPoint = true;" +
896             " Deprecated in API5: Will be removed in API8")]
897         [EditorBrowsable(EditorBrowsableState.Never)]
898         public bool PositionUsesAnchorPoint
899         {
900             get
901             {
902                 bool temp = false;
903                 GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp);
904                 return temp;
905             }
906             set
907             {
908                 SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
909                 NotifyPropertyChanged();
910             }
911         }
912
913         /// <summary>
914         /// Queries whether the view is connected to the stage.<br />
915         /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
916         /// </summary>
917         /// <since_tizen> 3 </since_tizen>
918         public bool IsOnWindow
919         {
920             get
921             {
922                 return OnWindow();
923             }
924         }
925
926         /// <summary>
927         /// Gets the depth in the hierarchy for the view.
928         /// </summary>
929         /// <since_tizen> 3 </since_tizen>
930         public int HierarchyDepth
931         {
932             get
933             {
934                 return GetHierarchyDepth();
935             }
936         }
937
938         /// <summary>
939         /// Sets the sibling order of the view so the depth position can be defined within the same parent.
940         /// </summary>
941         /// <remarks>
942         /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
943         /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
944         /// The values set by this property will likely change.
945         /// </remarks>
946         /// <since_tizen> 3 </since_tizen>
947         public int SiblingOrder
948         {
949             get
950             {
951                 return (int)GetValue(SiblingOrderProperty);
952             }
953             set
954             {
955                 SetValue(SiblingOrderProperty, value);
956
957                 LayoutGroup layout = Layout as LayoutGroup;
958                 layout?.ChangeLayoutSiblingOrder(value);
959
960                 NotifyPropertyChanged();
961             }
962         }
963
964         /// <summary>
965         /// Returns the natural size of the view.
966         /// </summary>
967         /// <remarks>
968         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
969         /// </remarks>
970         /// <since_tizen> 5 </since_tizen>
971         public Vector3 NaturalSize
972         {
973             get
974             {
975                 Vector3 ret = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true);
976                 if (NDalicPINVOKE.SWIGPendingException.Pending)
977                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
978                 return ret;
979             }
980         }
981
982         /// <summary>
983         /// Returns the natural size (Size2D) of the view.
984         /// </summary>
985         /// <remarks>
986         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
987         /// </remarks>
988         /// <since_tizen> 4 </since_tizen>
989         public Size2D NaturalSize2D
990         {
991             get
992             {
993                 Vector3 temp = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true);
994                 if (NDalicPINVOKE.SWIGPendingException.Pending)
995                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
996
997                 return new Size2D((int)temp.Width, (int)temp.Height);
998             }
999         }
1000
1001         /// <summary>
1002         /// Gets or sets the origin of a view within its parent's area.<br />
1003         /// 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 />
1004         /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1005         /// A view's position is the distance between this origin and the view's anchor-point.<br />
1006         /// </summary>
1007         /// <pre>The view has been initialized.</pre>
1008         /// <since_tizen> 3 </since_tizen>
1009         public Position ParentOrigin
1010         {
1011             get
1012             {
1013                 Position tmp = (Position)GetValue(ParentOriginProperty);
1014                 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1015             }
1016             set
1017             {
1018                 SetValue(ParentOriginProperty, value);
1019                 NotifyPropertyChanged();
1020             }
1021         }
1022
1023         /// <summary>
1024         /// Gets or sets the anchor-point of a view.<br />
1025         /// 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 />
1026         /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1027         /// A view position is the distance between its parent-origin and this anchor-point.<br />
1028         /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1029         /// <pre>The view has been initialized.</pre>
1030         /// </summary>
1031         /// <remarks>
1032         /// The property cascade chaining set is possible. For example, this (view.PivotPoint.X = 0.1f;) is possible.
1033         /// </remarks>
1034         /// <since_tizen> 3 </since_tizen>
1035         public Position PivotPoint
1036         {
1037             get
1038             {
1039                 Position tmp = (Position)GetValue(PivotPointProperty);
1040                 return new Position(OnPivotPointChanged, tmp.X, tmp.Y, tmp.Z);
1041             }
1042             set
1043             {
1044                 SetValue(PivotPointProperty, value);
1045                 NotifyPropertyChanged();
1046             }
1047         }
1048
1049         /// <summary>
1050         /// Gets or sets the size width of the view.
1051         /// </summary>
1052         /// <remarks>
1053         /// <para>
1054         /// Animatable - This property can be animated using <c>Animation</c> class.
1055         /// </para>
1056         /// </remarks>
1057         /// <since_tizen> 3 </since_tizen>
1058         public float SizeWidth
1059         {
1060             get
1061             {
1062                 return (float)GetValue(SizeWidthProperty);
1063             }
1064             set
1065             {
1066                 SetValue(SizeWidthProperty, value);
1067                 NotifyPropertyChanged();
1068             }
1069         }
1070
1071         /// <summary>
1072         /// Gets or sets the size height of the view.
1073         /// </summary>
1074         /// <remarks>
1075         /// <para>
1076         /// Animatable - This property can be animated using <c>Animation</c> class.
1077         /// </para>
1078         /// </remarks>
1079         /// <since_tizen> 3 </since_tizen>
1080         public float SizeHeight
1081         {
1082             get
1083             {
1084                 return (float)GetValue(SizeHeightProperty);
1085             }
1086             set
1087             {
1088                 SetValue(SizeHeightProperty, value);
1089                 NotifyPropertyChanged();
1090             }
1091         }
1092
1093         /// <summary>
1094         /// Gets or sets the position of the view.<br />
1095         /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1096         /// If the position inheritance is disabled, sets the world position.<br />
1097         /// </summary>
1098         /// <remarks>
1099         /// <para>
1100         /// Animatable - This property can be animated using <c>Animation</c> class.
1101         /// </para>
1102         /// The property cascade chaining set is possible. For example, this (view.Position.X = 1.0f;) is possible.
1103         /// </remarks>
1104         /// <since_tizen> 3 </since_tizen>
1105         public Position Position
1106         {
1107             get
1108             {
1109                 Position tmp = (Position)GetValue(PositionProperty);
1110                 return new Position(OnPositionChanged, tmp.X, tmp.Y, tmp.Z);
1111             }
1112             set
1113             {
1114                 SetValue(PositionProperty, value);
1115                 NotifyPropertyChanged();
1116             }
1117         }
1118
1119         /// <summary>
1120         /// Gets or sets the position X of the view.
1121         /// </summary>
1122         /// <remarks>
1123         /// <para>
1124         /// Animatable - This property can be animated using <c>Animation</c> class.
1125         /// </para>
1126         /// </remarks>
1127         /// <since_tizen> 3 </since_tizen>
1128         public float PositionX
1129         {
1130             get
1131             {
1132                 return (float)GetValue(PositionXProperty);
1133             }
1134             set
1135             {
1136                 SetValue(PositionXProperty, value);
1137                 NotifyPropertyChanged();
1138             }
1139         }
1140
1141         /// <summary>
1142         /// Gets or sets the position Y of the view.
1143         /// </summary>
1144         /// <remarks>
1145         /// <para>
1146         /// Animatable - This property can be animated using <c>Animation</c> class.
1147         /// </para>
1148         /// </remarks>
1149         /// <since_tizen> 3 </since_tizen>
1150         public float PositionY
1151         {
1152             get
1153             {
1154                 return (float)GetValue(PositionYProperty);
1155             }
1156             set
1157             {
1158                 SetValue(PositionYProperty, value);
1159                 NotifyPropertyChanged();
1160             }
1161         }
1162
1163         /// <summary>
1164         /// Gets or sets the position Z of the view.
1165         /// </summary>
1166         /// <remarks>
1167         /// <para>
1168         /// Animatable - This property can be animated using <c>Animation</c> class.
1169         /// </para>
1170         /// </remarks>
1171         /// <since_tizen> 3 </since_tizen>
1172         public float PositionZ
1173         {
1174             get
1175             {
1176                 return (float)GetValue(PositionZProperty);
1177             }
1178             set
1179             {
1180                 SetValue(PositionZProperty, value);
1181                 NotifyPropertyChanged();
1182             }
1183         }
1184
1185         /// <summary>
1186         /// Gets or sets the world position of the view.
1187         /// </summary>
1188         /// <since_tizen> 3 </since_tizen>
1189         public Vector3 WorldPosition
1190         {
1191             get
1192             {
1193                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1194                 GetProperty(View.Property.WORLD_POSITION).Get(temp);
1195                 return temp;
1196             }
1197         }
1198
1199         /// <summary>
1200         /// Gets or sets the orientation of the view.<br />
1201         /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1202         /// </summary>
1203         /// <remarks>
1204         /// <para>
1205         /// This is an asynchronous method.
1206         /// </para>
1207         /// <para>
1208         /// Animatable - This property can be animated using <c>Animation</c> class.
1209         /// </para>
1210         /// </remarks>
1211         /// <since_tizen> 3 </since_tizen>
1212         public Rotation Orientation
1213         {
1214             get
1215             {
1216                 return (Rotation)GetValue(OrientationProperty);
1217             }
1218             set
1219             {
1220                 SetValue(OrientationProperty, value);
1221                 NotifyPropertyChanged();
1222             }
1223         }
1224
1225         /// <summary>
1226         /// Gets or sets the world orientation of the view.<br />
1227         /// </summary>
1228         /// <since_tizen> 3 </since_tizen>
1229         public Rotation WorldOrientation
1230         {
1231             get
1232             {
1233                 Rotation temp = new Rotation();
1234                 GetProperty(View.Property.WORLD_ORIENTATION).Get(temp);
1235                 return temp;
1236             }
1237         }
1238
1239         /// <summary>
1240         /// Gets or sets the scale factor applied to the view.<br />
1241         /// </summary>
1242         /// <remarks>
1243         /// <para>
1244         /// Animatable - This property can be animated using <c>Animation</c> class.
1245         /// </para>
1246         /// The property cascade chaining set is possible. For example, this (view.Scale.X = 0.1f;) is possible.
1247         /// </remarks>
1248         /// <since_tizen> 3 </since_tizen>
1249         public Vector3 Scale
1250         {
1251             get
1252             {
1253                 Vector3 temp = (Vector3)GetValue(ScaleProperty);
1254                 return new Vector3(OnScaleChanged, temp.X, temp.Y, temp.Z);
1255             }
1256             set
1257             {
1258                 SetValue(ScaleProperty, value);
1259                 NotifyPropertyChanged();
1260             }
1261         }
1262
1263         /// <summary>
1264         /// Gets or sets the scale X factor applied to the view.
1265         /// </summary>
1266         /// <remarks>
1267         /// <para>
1268         /// Animatable - This property can be animated using <c>Animation</c> class.
1269         /// </para>
1270         /// </remarks>
1271         /// <since_tizen> 3 </since_tizen>
1272         public float ScaleX
1273         {
1274             get
1275             {
1276                 return (float)GetValue(ScaleXProperty);
1277             }
1278             set
1279             {
1280                 SetValue(ScaleXProperty, value);
1281                 NotifyPropertyChanged();
1282             }
1283         }
1284
1285         /// <summary>
1286         /// Gets or sets the scale Y factor applied to the view.
1287         /// </summary>
1288         /// <remarks>
1289         /// <para>
1290         /// Animatable - This property can be animated using <c>Animation</c> class.
1291         /// </para>
1292         /// </remarks>
1293         /// <since_tizen> 3 </since_tizen>
1294         public float ScaleY
1295         {
1296             get
1297             {
1298                 return (float)GetValue(ScaleYProperty);
1299             }
1300             set
1301             {
1302                 SetValue(ScaleYProperty, value);
1303                 NotifyPropertyChanged();
1304             }
1305         }
1306
1307         /// <summary>
1308         /// Gets or sets the scale Z factor applied to the view.
1309         /// </summary>
1310         /// <remarks>
1311         /// <para>
1312         /// Animatable - This property can be animated using <c>Animation</c> class.
1313         /// </para>
1314         /// </remarks>
1315         /// <since_tizen> 3 </since_tizen>
1316         public float ScaleZ
1317         {
1318             get
1319             {
1320                 return (float)GetValue(ScaleZProperty);
1321             }
1322             set
1323             {
1324                 SetValue(ScaleZProperty, value);
1325                 NotifyPropertyChanged();
1326             }
1327         }
1328
1329         /// <summary>
1330         /// Gets the world scale of the view.
1331         /// </summary>
1332         /// <since_tizen> 3 </since_tizen>
1333         public Vector3 WorldScale
1334         {
1335             get
1336             {
1337                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1338                 GetProperty(View.Property.WORLD_SCALE).Get(temp);
1339                 return temp;
1340             }
1341         }
1342
1343         /// <summary>
1344         /// Retrieves the visibility flag of the view.
1345         /// </summary>
1346         /// <remarks>
1347         /// <para>
1348         /// If the view is not visible, then the view and its children will not be rendered.
1349         /// 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.
1350         /// </para>
1351         /// <para>
1352         /// Animatable - This property can be animated using <c>Animation</c> class.
1353         /// </para>
1354         /// </remarks>
1355         /// <since_tizen> 3 </since_tizen>
1356         public bool Visibility
1357         {
1358             get
1359             {
1360                 bool temp = false;
1361                 GetProperty(View.Property.VISIBLE).Get(out temp);
1362                 return temp;
1363             }
1364         }
1365
1366         /// <summary>
1367         /// Gets the view's world color.
1368         /// </summary>
1369         /// <since_tizen> 3 </since_tizen>
1370         public Vector4 WorldColor
1371         {
1372             get
1373             {
1374                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1375                 GetProperty(View.Property.WORLD_COLOR).Get(temp);
1376                 return temp;
1377             }
1378         }
1379
1380         /// <summary>
1381         /// Gets or sets the view's name.
1382         /// </summary>
1383         /// <since_tizen> 3 </since_tizen>
1384         public string Name
1385         {
1386             get
1387             {
1388                 return (string)GetValue(NameProperty);
1389             }
1390             set
1391             {
1392                 SetValue(NameProperty, value);
1393                 NotifyPropertyChanged();
1394             }
1395         }
1396
1397         /// <summary>
1398         /// Get the number of children held by the view.
1399         /// </summary>
1400         /// <since_tizen> 3 </since_tizen>
1401         public new uint ChildCount
1402         {
1403             get
1404             {
1405                 return GetChildCount();
1406             }
1407         }
1408
1409         /// <summary>
1410         /// Gets the view's ID.
1411         /// Readonly
1412         /// </summary>
1413         /// <since_tizen> 3 </since_tizen>
1414         public uint ID
1415         {
1416             get
1417             {
1418                 return GetId();
1419             }
1420         }
1421
1422         /// <summary>
1423         /// Gets or sets the status of whether the view should emit touch or hover signals.
1424         /// </summary>
1425         /// <since_tizen> 3 </since_tizen>
1426         public bool Sensitive
1427         {
1428             get
1429             {
1430                 return (bool)GetValue(SensitiveProperty);
1431             }
1432             set
1433             {
1434                 SetValue(SensitiveProperty, value);
1435                 NotifyPropertyChanged();
1436             }
1437         }
1438
1439         /// <summary>
1440         /// 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.
1441         /// </summary>
1442         /// <since_tizen> 3 </since_tizen>
1443         public bool LeaveRequired
1444         {
1445             get
1446             {
1447                 return (bool)GetValue(LeaveRequiredProperty);
1448             }
1449             set
1450             {
1451                 SetValue(LeaveRequiredProperty, value);
1452                 NotifyPropertyChanged();
1453             }
1454         }
1455
1456         /// <summary>
1457         /// Gets or sets the status of whether a child view inherits it's parent's orientation.
1458         /// </summary>
1459         /// <since_tizen> 3 </since_tizen>
1460         public bool InheritOrientation
1461         {
1462             get
1463             {
1464                 return (bool)GetValue(InheritOrientationProperty);
1465             }
1466             set
1467             {
1468                 SetValue(InheritOrientationProperty, value);
1469                 NotifyPropertyChanged();
1470             }
1471         }
1472
1473         /// <summary>
1474         /// Gets or sets the status of whether a child view inherits it's parent's scale.
1475         /// </summary>
1476         /// <since_tizen> 3 </since_tizen>
1477         public bool InheritScale
1478         {
1479             get
1480             {
1481                 return (bool)GetValue(InheritScaleProperty);
1482             }
1483             set
1484             {
1485                 SetValue(InheritScaleProperty, value);
1486                 NotifyPropertyChanged();
1487             }
1488         }
1489
1490         /// <summary>
1491         /// Gets or sets the status of how the view and its children should be drawn.<br />
1492         /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
1493         /// 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 />
1494         /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
1495         /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
1496         /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
1497         /// </summary>
1498         /// <since_tizen> 3 </since_tizen>
1499         public DrawModeType DrawMode
1500         {
1501             get
1502             {
1503                 return (DrawModeType)GetValue(DrawModeProperty);
1504             }
1505             set
1506             {
1507                 SetValue(DrawModeProperty, value);
1508                 NotifyPropertyChanged();
1509             }
1510         }
1511
1512         /// <summary>
1513         /// Gets or sets the relative to parent size factor of the view.<br />
1514         /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
1515         /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
1516         /// </summary>
1517         /// <remarks>
1518         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
1519         /// </remarks>
1520         /// <since_tizen> 3 </since_tizen>
1521         public Vector3 SizeModeFactor
1522         {
1523             get
1524             {
1525                 Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty);
1526                 return new Vector3(OnSizeModeFactorChanged, temp.X, temp.Y, temp.Z);
1527             }
1528             set
1529             {
1530                 SetValue(SizeModeFactorProperty, value);
1531                 NotifyPropertyChanged();
1532             }
1533         }
1534
1535         /// <summary>
1536         /// Gets or sets the width resize policy to be used.
1537         /// </summary>
1538         /// <since_tizen> 3 </since_tizen>
1539         public ResizePolicyType WidthResizePolicy
1540         {
1541             get
1542             {
1543                 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
1544             }
1545             set
1546             {
1547                 SetValue(WidthResizePolicyProperty, value);
1548                 NotifyPropertyChanged();
1549             }
1550         }
1551
1552         /// <summary>
1553         /// Gets or sets the height resize policy to be used.
1554         /// </summary>
1555         /// <since_tizen> 3 </since_tizen>
1556         public ResizePolicyType HeightResizePolicy
1557         {
1558             get
1559             {
1560                 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
1561             }
1562             set
1563             {
1564                 SetValue(HeightResizePolicyProperty, value);
1565                 NotifyPropertyChanged();
1566             }
1567         }
1568
1569         /// <summary>
1570         /// Gets or sets the policy to use when setting size with size negotiation.<br />
1571         /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
1572         /// </summary>
1573         /// <since_tizen> 3 </since_tizen>
1574         public SizeScalePolicyType SizeScalePolicy
1575         {
1576             get
1577             {
1578                 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
1579             }
1580             set
1581             {
1582                 SetValue(SizeScalePolicyProperty, value);
1583                 NotifyPropertyChanged();
1584             }
1585         }
1586
1587         /// <summary>
1588         ///  Gets or sets the status of whether the width size is dependent on the height size.
1589         /// </summary>
1590         /// <since_tizen> 3 </since_tizen>
1591         public bool WidthForHeight
1592         {
1593             get
1594             {
1595                 return (bool)GetValue(WidthForHeightProperty);
1596             }
1597             set
1598             {
1599                 SetValue(WidthForHeightProperty, value);
1600                 NotifyPropertyChanged();
1601             }
1602         }
1603
1604         /// <summary>
1605         /// Gets or sets the status of whether the height size is dependent on the width size.
1606         /// </summary>
1607         /// <since_tizen> 3 </since_tizen>
1608         public bool HeightForWidth
1609         {
1610             get
1611             {
1612                 return (bool)GetValue(HeightForWidthProperty);
1613             }
1614             set
1615             {
1616                 SetValue(HeightForWidthProperty, value);
1617                 NotifyPropertyChanged();
1618             }
1619         }
1620
1621         /// <summary>
1622         /// Gets or sets the padding for use in layout.
1623         /// </summary>
1624         /// <remarks>
1625         /// The property cascade chaining set is possible. For example, this (view.Padding.X = 0.1f;) is possible.
1626         /// </remarks>
1627         /// <since_tizen> 5 </since_tizen>
1628         public Extents Padding
1629         {
1630             get
1631             {
1632                 // If View has a Layout then padding in stored in the base Layout class
1633                 if (Layout != null)
1634                 {
1635                     return Layout.Padding;
1636                 }
1637                 else
1638                 {
1639                     Extents temp = (Extents)GetValue(PaddingProperty);
1640                     return new Extents(OnPaddingChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1641                 }
1642                 // Two return points to prevent creating a zeroed Extent native object before assignment
1643             }
1644             set
1645             {
1646                 Extents padding = value;
1647                 if (Layout != null)
1648                 {
1649                     // Layout set so store Padding in LayoutItem instead of in View.
1650                     // If View stores the Padding value then Legacy Size Negotiation will overwrite
1651                     // the position and sizes measure in the Layouting.
1652                     Layout.Padding = value;
1653                     // If Layout is a LayoutItem then it could be a View that handles it's own padding.
1654                     // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
1655                     if (typeof(LayoutGroup).IsAssignableFrom(Layout.GetType())) // If a Layout container of some kind.
1656                     {
1657                         padding = new Extents(0, 0, 0, 0); // Reset value stored in View.
1658                     }
1659                 }
1660
1661                 SetValue(PaddingProperty, padding);
1662                 NotifyPropertyChanged();
1663             }
1664         }
1665
1666         /// <summary>
1667         /// Gets or sets the minimum size the view can be assigned in size negotiation.
1668         /// </summary>
1669         /// <remarks>
1670         /// The property cascade chaining set is possible. For example, this (view.MinimumSize.Width = 1;) is possible.
1671         /// </remarks>
1672         /// <since_tizen> 3 </since_tizen>
1673         public Size2D MinimumSize
1674         {
1675             get
1676             {
1677                 Size2D tmp = (Size2D)GetValue(MinimumSizeProperty);
1678                 return new Size2D(OnMinimumSizeChanged, tmp.Width, tmp.Height);
1679             }
1680             set
1681             {
1682                 if (_layout != null)
1683                 {
1684                     // Note: it only works if minimum size is >= than natural size.
1685                     // To force the size it should be done through the width&height spec or Size2D.
1686                     _layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
1687                     _layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
1688                     _layout.RequestLayout();
1689                 }
1690                 SetValue(MinimumSizeProperty, value);
1691                 NotifyPropertyChanged();
1692             }
1693         }
1694
1695         /// <summary>
1696         /// Gets or sets the maximum size the view can be assigned in size negotiation.
1697         /// </summary>
1698         /// <remarks>
1699         /// The property cascade chaining set is possible. For example, this (view.MaximumSize.Width = 1;) is possible.
1700         /// </remarks>
1701         /// <since_tizen> 3 </since_tizen>
1702         public Size2D MaximumSize
1703         {
1704             get
1705             {
1706                 Size2D tmp = (Size2D)GetValue(MaximumSizeProperty);
1707                 return new Size2D(OnMaximumSizeChanged, tmp.Width, tmp.Height);
1708             }
1709             set
1710             {
1711                 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
1712                 // MATCH_PARENT spec + parent container size can be used to limit
1713                 if (_layout != null)
1714                 {
1715                     _layout.RequestLayout();
1716                 }
1717                 SetValue(MaximumSizeProperty, value);
1718                 NotifyPropertyChanged();
1719             }
1720         }
1721
1722         /// <summary>
1723         /// Gets or sets whether a child view inherits it's parent's position.<br />
1724         /// Default is to inherit.<br />
1725         /// 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 />
1726         /// </summary>
1727         /// <since_tizen> 3 </since_tizen>
1728         public bool InheritPosition
1729         {
1730             get
1731             {
1732                 return (bool)GetValue(InheritPositionProperty);
1733             }
1734             set
1735             {
1736                 SetValue(InheritPositionProperty, value);
1737                 NotifyPropertyChanged();
1738             }
1739         }
1740
1741         /// <summary>
1742         /// Gets or sets the clipping behavior (mode) of it's children.
1743         /// </summary>
1744         /// <since_tizen> 3 </since_tizen>
1745         public ClippingModeType ClippingMode
1746         {
1747             get
1748             {
1749                 return (ClippingModeType)GetValue(ClippingModeProperty);
1750             }
1751             set
1752             {
1753                 SetValue(ClippingModeProperty, value);
1754                 NotifyPropertyChanged();
1755             }
1756         }
1757
1758         /// <summary>
1759         /// Gets the number of renderers held by the view.
1760         /// </summary>
1761         /// <since_tizen> 3 </since_tizen>
1762         public uint RendererCount
1763         {
1764             get
1765             {
1766                 return GetRendererCount();
1767             }
1768         }
1769
1770         /// <summary>
1771         /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
1772         /// </summary>
1773         /// <remarks>
1774         /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
1775         /// </remarks>
1776         /// <since_tizen> 3 </since_tizen>
1777         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
1778             "Like: " +
1779             "View view = new View(); " +
1780             "view.PivotPoint = PivotPoint.Center; " +
1781             "view.PositionUsesPivotPoint = true;")]
1782         [EditorBrowsable(EditorBrowsableState.Never)]
1783         public Position AnchorPoint
1784         {
1785             get
1786             {
1787                 Position temp = new Position(0.0f, 0.0f, 0.0f);
1788                 GetProperty(View.Property.ANCHOR_POINT).Get(temp);
1789                 return new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
1790             }
1791             set
1792             {
1793                 SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
1794                 NotifyPropertyChanged();
1795             }
1796         }
1797
1798         /// <summary>
1799         /// Sets the size of a view for the width, the height and the depth.<br />
1800         /// Geometry can be scaled to fit within this area.<br />
1801         /// This does not interfere with the view's scale factor.<br />
1802         /// The views default depth is the minimum of width and height.<br />
1803         /// </summary>
1804         /// <remarks>
1805         /// <para>
1806         /// Animatable - This property can be animated using <c>Animation</c> class.
1807         /// </para>
1808         /// The property cascade chaining set is possible. For example, this (view.Size.Width = 1.0f;) is possible.
1809         /// </remarks>
1810         /// <since_tizen> 5 </since_tizen>
1811         public Size Size
1812         {
1813             get
1814             {
1815                 Size tmp = (Size)GetValue(SizeProperty);
1816                 return new Size(OnSizeChanged, tmp.Width, tmp.Height, tmp.Depth);
1817             }
1818             set
1819             {
1820                 SetValue(SizeProperty, value);
1821                 NotifyPropertyChanged();
1822             }
1823         }
1824
1825         /// <summary>
1826         /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
1827         /// </summary>
1828         /// <since_tizen> 3 </since_tizen>
1829         [Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
1830             "Like: " +
1831             "Container parent =  view.GetParent(); " +
1832             "View view = parent as View;")]
1833         [EditorBrowsable(EditorBrowsableState.Never)]
1834         public new View Parent
1835         {
1836             get
1837             {
1838                 View ret;
1839                 IntPtr cPtr = Interop.Actor.Actor_GetParent(swigCPtr);
1840                 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
1841                 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
1842
1843                 if (basehandle is Layer layer)
1844                 {
1845                     ret = new View(Layer.getCPtr(layer).Handle, false);
1846                     NUILog.Error("This Parent property is deprecated, shoud do not be used");
1847                 }
1848                 else
1849                 {
1850                     ret = basehandle as View;
1851                 }
1852
1853                 Interop.BaseHandle.delete_BaseHandle(CPtr);
1854                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1855
1856                 if (NDalicPINVOKE.SWIGPendingException.Pending)
1857                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1858                 return ret;
1859             }
1860         }
1861
1862         /// <summary>
1863         /// Gets/Sets whether inherit parent's the layout Direction.
1864         /// </summary>
1865         /// <since_tizen> 4 </since_tizen>
1866         public bool InheritLayoutDirection
1867         {
1868             get
1869             {
1870                 return (bool)GetValue(InheritLayoutDirectionProperty);
1871             }
1872             set
1873             {
1874                 SetValue(InheritLayoutDirectionProperty, value);
1875                 NotifyPropertyChanged();
1876             }
1877         }
1878
1879         /// <summary>
1880         /// Gets/Sets the layout Direction.
1881         /// </summary>
1882         /// <since_tizen> 4 </since_tizen>
1883         public ViewLayoutDirectionType LayoutDirection
1884         {
1885             get
1886             {
1887                 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
1888             }
1889             set
1890             {
1891                 SetValue(LayoutDirectionProperty, value);
1892                 NotifyPropertyChanged();
1893                 _layout?.RequestLayout();
1894             }
1895         }
1896
1897         /// <summary>
1898         /// Gets or sets the Margin for use in layout.
1899         /// </summary>
1900         /// <remarks>
1901         /// Margin property is supported by Layout algorithms and containers.
1902         /// Please Set Layout if you want to use Margin property.
1903         /// The property cascade chaining set is possible. For example, this (view.Margin.X = 0.1f;) is possible.
1904         /// </remarks>
1905         /// <since_tizen> 4 </since_tizen>
1906         public Extents Margin
1907         {
1908             get
1909             {
1910                 // If View has a Layout then margin is stored in Layout.
1911                 if (Layout != null)
1912                 {
1913                     return Layout.Margin;
1914                 }
1915                 else
1916                 {
1917                     // If Layout not set then return margin stored in View.
1918                     Extents temp = (Extents)GetValue(MarginProperty);
1919                     return new Extents(OnMarginChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1920                 }
1921                 // Two return points to prevent creating a zeroed Extent native object before assignment
1922             }
1923             set
1924             {
1925                 if (Layout != null)
1926                 {
1927                     // Layout set so store Margin in LayoutItem instead of View.
1928                     // If View stores the Margin too then the Legacy Size Negotiation will
1929                     // overwrite the position and size values measured in the Layouting.
1930                     Layout.Margin = value;
1931                     SetValue(MarginProperty, new Extents(0,0,0,0));
1932                     _layout?.RequestLayout();
1933                 }
1934                 else
1935                 {
1936                     SetValue(MarginProperty, value);
1937                 }
1938                 NotifyPropertyChanged();
1939                 _layout?.RequestLayout();
1940             }
1941         }
1942
1943         ///<summary>
1944         /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
1945         ///</summary>
1946         /// <since_tizen> 6 </since_tizen>
1947         public int WidthSpecification
1948         {
1949             get
1950             {
1951                 return _widthPolicy;
1952             }
1953             set
1954             {
1955                 _widthPolicy = value;
1956                 if( _oldWidthPolicy != _widthPolicy )
1957                 {
1958                     if (_widthPolicy >= 0)
1959                     {
1960                         _measureSpecificationWidth = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
1961
1962                         if(_heightPolicy>=0) // Policy an exact value
1963                         {
1964                             // Create Size2D only both _widthPolicy and _heightPolicy are set.
1965                             Size2D = new Size2D(_widthPolicy,_heightPolicy);
1966                         }
1967                     }
1968                     _layout?.RequestLayout();
1969                     _oldWidthPolicy = _widthPolicy;
1970                 }
1971             }
1972         }
1973
1974         ///<summary>
1975         /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
1976         ///</summary>
1977         /// <since_tizen> 6 </since_tizen>
1978         public int HeightSpecification
1979         {
1980             get
1981             {
1982                 return _heightPolicy;
1983             }
1984             set
1985             {
1986                 _heightPolicy = value;
1987                 if( _oldHeightPolicy != _heightPolicy )
1988                 {
1989                     if (_heightPolicy >= 0)
1990                     {
1991                         _measureSpecificationHeight = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
1992
1993                         if(_widthPolicy>=0) // Policy an exact value
1994                         {
1995                             // Create Size2D only both _widthPolicy and _heightPolicy are set.
1996                             Size2D = new Size2D(_widthPolicy,_heightPolicy);
1997                         }
1998
1999                     }
2000                     _layout?.RequestLayout();
2001                     _oldHeightPolicy = _heightPolicy;
2002                 }
2003             }
2004         }
2005
2006         ///<summary>
2007         /// Gets the List of transitions for this View.
2008         ///</summary>
2009         /// <since_tizen> 6 </since_tizen>
2010         public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2011         {
2012             get
2013             {
2014                 if (_layoutTransitions == null)
2015                 {
2016                     _layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2017                 }
2018                 return _layoutTransitions;
2019             }
2020         }
2021
2022         ///<summary>
2023         /// Set a layout transitions for this View.
2024         ///</summary>
2025         /// <remarks>
2026         /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2027         /// </remarks>
2028         /// <since_tizen> 6 </since_tizen>
2029         public LayoutTransition LayoutTransition
2030         {
2031             set
2032             {
2033                 if (_layoutTransitions == null)
2034                 {
2035                     _layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2036                 }
2037                 LayoutTransitionsHelper.AddTransitionForCondition(_layoutTransitions,value.Condition,value, true);
2038
2039                 AttachTransitionsToChildren(value);
2040             }
2041         }
2042
2043         /// <summary>
2044         /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
2045         /// </summary>
2046         /// <remarks>
2047         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2048         /// </remarks>
2049         /// <since_tizen> 4 </since_tizen>
2050         [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
2051         [EditorBrowsable(EditorBrowsableState.Never)]
2052         public Extents PaddingEX
2053         {
2054             get
2055             {
2056                 Extents temp = new Extents(0, 0, 0, 0);
2057                 GetProperty(View.Property.PADDING).Get(temp);
2058                 return new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2059             }
2060             set
2061             {
2062                 SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value));
2063                 NotifyPropertyChanged();
2064                 _layout?.RequestLayout();
2065             }
2066         }
2067
2068         /// <since_tizen> 6 </since_tizen>
2069         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2070         [EditorBrowsable(EditorBrowsableState.Never)]
2071         public Style XamlStyle
2072         {
2073             get
2074             {
2075                 return (Style)GetValue(XamlStyleProperty);
2076             }
2077             set
2078             {
2079                 SetValue(XamlStyleProperty, value);
2080             }
2081         }
2082
2083         /// <summary>
2084         /// The Color of View. This is an RGBA value.
2085         /// </summary>
2086         /// <remarks>
2087         /// <para>
2088         /// Animatable - This property can be animated using <c>Animation</c> class.
2089         /// </para>
2090         /// The property cascade chaining set is possible. For example, this (view.Color.X = 0.1f;) is possible.
2091         /// </remarks>
2092         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2093         [EditorBrowsable(EditorBrowsableState.Never)]
2094         public Color Color
2095         {
2096             get
2097             {
2098                 Color temp = (Color)GetValue(ColorProperty);
2099                 return new Color(OnColorChanged, temp.R, temp.G, temp.B, temp.A);
2100             }
2101             set
2102             {
2103                 SetValue(ColorProperty, value);
2104                 selectorData?.Color.UpdateIfNeeds(this, value);
2105                 NotifyPropertyChanged();
2106             }
2107         }
2108
2109         /// <summary>
2110         /// Set the layout on this View. Replaces any existing Layout.
2111         /// </summary>
2112         /// <since_tizen> 6 </since_tizen>
2113         public LayoutItem Layout
2114         {
2115             get
2116             {
2117                 return _layout;
2118             }
2119             set
2120             {
2121                 // Do nothing if layout provided is already set on this View.
2122                 if (value == _layout)
2123                 {
2124                     return;
2125                 }
2126
2127                 layoutingDisabled = false;
2128                 layoutSet = true;
2129
2130                 // If new layout being set already has a owner then that owner receives a replacement default layout.
2131                 // First check if the layout to be set already has a owner.
2132                 if (value?.Owner != null)
2133                 {
2134                     // Previous owner of the layout gets a default layout as a replacement.
2135                     value.Owner.Layout = new AbsoluteLayout();
2136
2137                     // Copy Margin and Padding to replacement LayoutGroup.
2138                     if (value.Owner.Layout != null)
2139                     {
2140                         value.Owner.Layout.Margin = value.Margin;
2141                         value.Owner.Layout.Padding = value.Padding;
2142                     }
2143                 }
2144
2145                 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2146                 // View if no replacement. Previously margin and padding values would have been moved from
2147                 // the View to the layout.
2148                 if (_layout != null ) // Existing layout
2149                 {
2150                     if (value != null)
2151                     {
2152                         // Existing layout being replaced so copy over margin and padding values.
2153                         value.Margin = _layout.Margin;
2154                         value.Padding = _layout.Padding;
2155                     }
2156                     else
2157                     {
2158                       // Layout not being replaced so restore margin and padding to View.
2159                       SetValue(MarginProperty, _layout.Margin);
2160                       SetValue(PaddingProperty, _layout.Padding);
2161                       NotifyPropertyChanged();
2162                     }
2163                 }
2164                 else
2165                 {
2166                     // First Layout to be added to the View hence copy
2167
2168                     // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2169                     if (value !=null)
2170                     {
2171                         if (Margin.Top != 0 || Margin.Bottom !=0 || Margin.Start !=0 || Margin.End != 0)
2172                         {
2173                             // If View already has a margin set then store it in Layout instead.
2174                             value.Margin = Margin;
2175                             SetValue(MarginProperty, new Extents(0,0,0,0));
2176                             NotifyPropertyChanged();
2177                         }
2178
2179                         if (Padding.Top != 0 || Padding.Bottom !=0 || Padding.Start !=0 || Padding.End != 0)
2180                         {
2181                             // If View already has a padding set then store it in Layout instead.
2182                             value.Padding = Padding;
2183                             SetValue(PaddingProperty, new Extents(0,0,0,0));
2184                             NotifyPropertyChanged();
2185                         }
2186                     }
2187                 }
2188
2189                 // Remove existing layout from it's parent layout group.
2190                 _layout?.Unparent();
2191
2192                 // Set layout to this view
2193                 SetLayout(value);
2194             }
2195         }
2196
2197         /// <summary>
2198         /// The weight of the View, used to share available space in a layout with siblings.
2199         /// </summary>
2200         /// <since_tizen> 6 </since_tizen>
2201         public float Weight
2202         {
2203             get
2204             {
2205                 return _weight;
2206             }
2207             set
2208             {
2209                 _weight = value;
2210                 _layout?.RequestLayout();
2211             }
2212         }
2213
2214         /// <summary>
2215         ///  Whether to load the BackgroundImage synchronously.
2216         ///  If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2217         ///  Note: For Normal Quad images only.
2218         /// </summary>
2219         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2220         [EditorBrowsable(EditorBrowsableState.Never)]
2221         public bool BackgroundImageSynchronosLoading
2222         {
2223             get
2224             {
2225                 return _backgroundImageSynchronosLoading;
2226             }
2227             set
2228             {
2229                 _backgroundImageSynchronosLoading = value;
2230
2231                 string bgUrl = null;
2232                 Background.Find(ImageVisualProperty.URL)?.Get(out bgUrl);
2233
2234                 if (!string.IsNullOrEmpty(bgUrl))
2235                 {
2236                     PropertyMap bgMap = this.Background;
2237                     bgMap.Add("synchronousLoading", new PropertyValue(_backgroundImageSynchronosLoading));
2238                     Background = bgMap;
2239                 }
2240             }
2241         }
2242
2243         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2244         [EditorBrowsable(EditorBrowsableState.Never)]
2245         public Vector2 UpdateSizeHint
2246         {
2247             get
2248             {
2249                 return (Vector2)GetValue(UpdateSizeHintProperty);
2250             }
2251             set
2252             {
2253                 SetValue(UpdateSizeHintProperty, value);
2254                 NotifyPropertyChanged();
2255             }
2256         }
2257
2258         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
2259         [EditorBrowsable(EditorBrowsableState.Never)]
2260         public string[] TransitionNames
2261         {
2262             get
2263             {
2264                 return transitionNames;
2265             }
2266             set
2267             {
2268                 transitionNames = value;
2269                 LoadTransitions();
2270             }
2271         }
2272
2273         /// <summary>
2274         /// Enable/Disable ControlState propagation for children.
2275         /// It is false by default.
2276         /// If the View needs to share ControlState with descendants, please set it true.
2277         /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
2278         /// </summary>
2279         [EditorBrowsable(EditorBrowsableState.Never)]
2280         public bool EnableControlStatePropagation
2281         {
2282             get => controlStatePropagation;
2283             set
2284             {
2285                 controlStatePropagation = value;
2286
2287                 foreach (View child in Children)
2288                 {
2289                     child.EnableControlStatePropagation = value;
2290                 }
2291             }
2292         }
2293
2294         /// <summary>
2295         /// If this property is set to true, the View can have a touch related ControlState (such as Pressed) when touch.
2296         /// By default, it is false in View, true in Control.
2297         /// Note that if the value is true, the View will be a touch receptor.
2298         /// </summary>
2299         [EditorBrowsable(EditorBrowsableState.Never)]
2300         public bool EnableControlState
2301         {
2302             get
2303             {
2304                 return (bool)GetValue(EnableControlStateProperty);
2305             }
2306             set
2307             {
2308                 SetValue(EnableControlStateProperty, value);
2309             }
2310         }
2311
2312          /// <summary>
2313         /// Whether the actor grab all touches even if touch leaves its boundary.
2314         /// </summary>
2315         /// <returns>true, if it grab all touch after start</returns>
2316         [EditorBrowsable(EditorBrowsableState.Never)]
2317         public bool GrabTouchAfterLeave
2318         {
2319             get
2320             {
2321                 bool temp = false;
2322                 GetProperty(View.Property.CaptureAllTouchAfterStart).Get(out temp);
2323                 return temp;
2324             }
2325             set
2326             {
2327                 SetProperty(View.Property.CaptureAllTouchAfterStart, new Tizen.NUI.PropertyValue(value));
2328                 NotifyPropertyChanged();
2329             }
2330         }
2331
2332         /// <summary>
2333         /// If the value is true, the View will change its style as the theme changes.
2334         /// It is false by default, but turned to true when setting StyleName (by setting property or using specified constructor).
2335         /// </summary>
2336         [EditorBrowsable(EditorBrowsableState.Never)]
2337         public bool ThemeChangeSensitive
2338         {
2339             get => (bool)GetValue(ThemeChangeSensitiveProperty);
2340             set => SetValue(ThemeChangeSensitiveProperty, value);
2341         }
2342
2343         /// <summary>
2344         /// Get Style, it is abstract function and must be override.
2345         /// </summary>
2346         /// <since_tizen> 6 </since_tizen>
2347         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2348         // TODO: It should be deprecated. please use CreateViewStyle instead.
2349         [EditorBrowsable(EditorBrowsableState.Never)]
2350         protected virtual ViewStyle GetViewStyle()
2351         {
2352             return CreateViewStyle();
2353         }
2354
2355         /// <summary>
2356         /// Create Style, it is abstract function and must be override.
2357         /// </summary>
2358         [EditorBrowsable(EditorBrowsableState.Never)]
2359         protected virtual ViewStyle CreateViewStyle()
2360         {
2361             return new ViewStyle();
2362         }
2363
2364         /// <summary>
2365         /// Called after the View's ControlStates changed.
2366         /// </summary>
2367         /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
2368         [EditorBrowsable(EditorBrowsableState.Never)]
2369         protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
2370         {
2371         }
2372
2373         /// <summary>
2374         /// </summary>
2375         [EditorBrowsable(EditorBrowsableState.Never)]
2376         protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
2377         {
2378             UpdateStyle();
2379         }
2380
2381         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2382         [EditorBrowsable(EditorBrowsableState.Never)]
2383         public virtual void ApplyStyle(ViewStyle viewStyle)
2384         {
2385             if (null == viewStyle || this.viewStyle == viewStyle) return;
2386
2387             this.viewStyle = viewStyle;
2388
2389             Dictionary<string, BindableProperty> bindablePropertyOfView;
2390             Type viewType = GetType();
2391
2392             Dictionary<string, BindableProperty> bindablePropertyOfStyle;
2393             Type styleType = viewStyle.GetType();
2394
2395             BindableProperty.GetBindablePropertysOfType(viewType, out bindablePropertyOfView);
2396             BindableProperty.GetBindablePropertysOfType(styleType, out bindablePropertyOfStyle);
2397
2398             if (null != bindablePropertyOfView && null != bindablePropertyOfStyle)
2399             {
2400                 foreach (KeyValuePair<string, BindableProperty> keyValuePair in bindablePropertyOfStyle)
2401                 {
2402                     BindableProperty viewProperty;
2403                     bindablePropertyOfView.TryGetValue(keyValuePair.Key, out viewProperty);
2404
2405                     if (null != viewProperty && viewProperty != StyleNameProperty)
2406                     {
2407                         object value = viewStyle.GetValue(keyValuePair.Value);
2408
2409                         if (null != value)
2410                         {
2411                             SetValue(viewProperty, value);
2412                         }
2413                     }
2414                 }
2415             }
2416         }
2417     }
2418 }