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