Release 8.0.0.15408
[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( Layout.GetType() != typeof(LayoutItem)) // If a Layout container of some kind.
1624                     {
1625                         padding =  new Extents(0,0,0,0); // Reset value stored in View.
1626                     }
1627                     _layout?.RequestLayout();
1628                 }
1629                 SetValue(PaddingProperty, padding);
1630                 NotifyPropertyChanged();
1631                 _layout?.RequestLayout();
1632             }
1633         }
1634
1635         /// <summary>
1636         /// Gets or sets the minimum size the view can be assigned in size negotiation.
1637         /// </summary>
1638         /// <remarks>
1639         /// The property cascade chaining set is possible. For example, this (view.MinimumSize.Width = 1;) is possible.
1640         /// </remarks>
1641         /// <since_tizen> 3 </since_tizen>
1642         public Size2D MinimumSize
1643         {
1644             get
1645             {
1646                 Size2D tmp = (Size2D)GetValue(MinimumSizeProperty);
1647                 return new Size2D(OnMinimumSizeChanged, tmp.Width, tmp.Height);
1648             }
1649             set
1650             {
1651                 if (_layout != null)
1652                 {
1653                     // Note: it only works if minimum size is >= than natural size.
1654                     // To force the size it should be done through the width&height spec or Size2D.
1655                     _layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
1656                     _layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
1657                     _layout.RequestLayout();
1658                 }
1659                 SetValue(MinimumSizeProperty, value);
1660                 NotifyPropertyChanged();
1661             }
1662         }
1663
1664         /// <summary>
1665         /// Gets or sets the maximum size the view can be assigned in size negotiation.
1666         /// </summary>
1667         /// <remarks>
1668         /// The property cascade chaining set is possible. For example, this (view.MaximumSize.Width = 1;) is possible.
1669         /// </remarks>
1670         /// <since_tizen> 3 </since_tizen>
1671         public Size2D MaximumSize
1672         {
1673             get
1674             {
1675                 Size2D tmp = (Size2D)GetValue(MaximumSizeProperty);
1676                 return new Size2D(OnMaximumSizeChanged, tmp.Width, tmp.Height);
1677             }
1678             set
1679             {
1680                 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
1681                 // MATCH_PARENT spec + parent container size can be used to limit
1682                 if (_layout != null)
1683                 {
1684                     _layout.RequestLayout();
1685                 }
1686                 SetValue(MaximumSizeProperty, value);
1687                 NotifyPropertyChanged();
1688             }
1689         }
1690
1691         /// <summary>
1692         /// Gets or sets whether a child view inherits it's parent's position.<br />
1693         /// Default is to inherit.<br />
1694         /// 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 />
1695         /// </summary>
1696         /// <since_tizen> 3 </since_tizen>
1697         public bool InheritPosition
1698         {
1699             get
1700             {
1701                 return (bool)GetValue(InheritPositionProperty);
1702             }
1703             set
1704             {
1705                 SetValue(InheritPositionProperty, value);
1706                 NotifyPropertyChanged();
1707             }
1708         }
1709
1710         /// <summary>
1711         /// Gets or sets the clipping behavior (mode) of it's children.
1712         /// </summary>
1713         /// <since_tizen> 3 </since_tizen>
1714         public ClippingModeType ClippingMode
1715         {
1716             get
1717             {
1718                 return (ClippingModeType)GetValue(ClippingModeProperty);
1719             }
1720             set
1721             {
1722                 SetValue(ClippingModeProperty, value);
1723                 NotifyPropertyChanged();
1724             }
1725         }
1726
1727         /// <summary>
1728         /// Gets the number of renderers held by the view.
1729         /// </summary>
1730         /// <since_tizen> 3 </since_tizen>
1731         public uint RendererCount
1732         {
1733             get
1734             {
1735                 return GetRendererCount();
1736             }
1737         }
1738
1739         /// <summary>
1740         /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
1741         /// </summary>
1742         /// <remarks>
1743         /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
1744         /// </remarks>
1745         /// <since_tizen> 3 </since_tizen>
1746         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
1747             "Like: " +
1748             "View view = new View(); " +
1749             "view.PivotPoint = PivotPoint.Center; " +
1750             "view.PositionUsesPivotPoint = true;")]
1751         [EditorBrowsable(EditorBrowsableState.Never)]
1752         public Position AnchorPoint
1753         {
1754             get
1755             {
1756                 Position temp = new Position(0.0f, 0.0f, 0.0f);
1757                 GetProperty(View.Property.ANCHOR_POINT).Get(temp);
1758                 return new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
1759             }
1760             set
1761             {
1762                 SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
1763                 NotifyPropertyChanged();
1764             }
1765         }
1766
1767         /// <summary>
1768         /// Sets the size of a view for the width, the height and the depth.<br />
1769         /// Geometry can be scaled to fit within this area.<br />
1770         /// This does not interfere with the view's scale factor.<br />
1771         /// The views default depth is the minimum of width and height.<br />
1772         /// </summary>
1773         /// <remarks>
1774         /// <para>
1775         /// Animatable - This property can be animated using <c>Animation</c> class.
1776         /// </para>
1777         /// The property cascade chaining set is possible. For example, this (view.Size.Width = 1.0f;) is possible.
1778         /// </remarks>
1779         /// <since_tizen> 5 </since_tizen>
1780         public Size Size
1781         {
1782             get
1783             {
1784                 Size tmp = (Size)GetValue(SizeProperty);
1785                 return new Size(OnSizeChanged, tmp.Width, tmp.Height, tmp.Depth);
1786             }
1787             set
1788             {
1789                 SetValue(SizeProperty, value);
1790                 NotifyPropertyChanged();
1791             }
1792         }
1793
1794         /// <summary>
1795         /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
1796         /// </summary>
1797         /// <since_tizen> 3 </since_tizen>
1798         [Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
1799             "Like: " +
1800             "Container parent =  view.GetParent(); " +
1801             "View view = parent as View;")]
1802         [EditorBrowsable(EditorBrowsableState.Never)]
1803         public new View Parent
1804         {
1805             get
1806             {
1807                 View ret;
1808                 IntPtr cPtr = Interop.Actor.Actor_GetParent(swigCPtr);
1809                 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
1810                 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
1811
1812                 if (basehandle is Layer layer)
1813                 {
1814                     ret = new View(Layer.getCPtr(layer).Handle, false);
1815                     NUILog.Error("This Parent property is deprecated, shoud do not be used");
1816                 }
1817                 else
1818                 {
1819                     ret = basehandle as View;
1820                 }
1821
1822                 Interop.BaseHandle.delete_BaseHandle(CPtr);
1823                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1824
1825                 if (NDalicPINVOKE.SWIGPendingException.Pending)
1826                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1827                 return ret;
1828             }
1829         }
1830
1831         /// <summary>
1832         /// Gets/Sets whether inherit parent's the layout Direction.
1833         /// </summary>
1834         /// <since_tizen> 4 </since_tizen>
1835         public bool InheritLayoutDirection
1836         {
1837             get
1838             {
1839                 return (bool)GetValue(InheritLayoutDirectionProperty);
1840             }
1841             set
1842             {
1843                 SetValue(InheritLayoutDirectionProperty, value);
1844                 NotifyPropertyChanged();
1845             }
1846         }
1847
1848         /// <summary>
1849         /// Gets/Sets the layout Direction.
1850         /// </summary>
1851         /// <since_tizen> 4 </since_tizen>
1852         public ViewLayoutDirectionType LayoutDirection
1853         {
1854             get
1855             {
1856                 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
1857             }
1858             set
1859             {
1860                 SetValue(LayoutDirectionProperty, value);
1861                 NotifyPropertyChanged();
1862                 _layout?.RequestLayout();
1863             }
1864         }
1865
1866         /// <summary>
1867         /// Gets or sets the Margin for use in layout.
1868         /// </summary>
1869         /// <remarks>
1870         /// Margin property is supported by Layout algorithms and containers.
1871         /// Please Set Layout if you want to use Margin property.
1872         /// The property cascade chaining set is possible. For example, this (view.Margin.X = 0.1f;) is possible.
1873         /// </remarks>
1874         /// <since_tizen> 4 </since_tizen>
1875         public Extents Margin
1876         {
1877             get
1878             {
1879                 // If View has a Layout then margin is stored in Layout.
1880                 if (Layout != null)
1881                 {
1882                     return Layout.Margin;
1883                 }
1884                 else
1885                 {
1886                     // If Layout not set then return margin stored in View.
1887                     Extents temp = (Extents)GetValue(MarginProperty);
1888                     return new Extents(OnMarginChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1889                 }
1890                 // Two return points to prevent creating a zeroed Extent native object before assignment
1891             }
1892             set
1893             {
1894                 if (Layout != null)
1895                 {
1896                     // Layout set so store Margin in LayoutItem instead of View.
1897                     // If View stores the Margin too then the Legacy Size Negotiation will
1898                     // overwrite the position and size values measured in the Layouting.
1899                     Layout.Margin = value;
1900                     SetValue(MarginProperty, new Extents(0,0,0,0));
1901                     _layout?.RequestLayout();
1902                 }
1903                 else
1904                 {
1905                     SetValue(MarginProperty, value);
1906                 }
1907                 NotifyPropertyChanged();
1908                 _layout?.RequestLayout();
1909             }
1910         }
1911
1912         ///<summary>
1913         /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
1914         ///</summary>
1915         /// <since_tizen> 6 </since_tizen>
1916         public int WidthSpecification
1917         {
1918             get
1919             {
1920                 return _widthPolicy;
1921             }
1922             set
1923             {
1924                 _widthPolicy = value;
1925                 if( _oldWidthPolicy != _widthPolicy )
1926                 {
1927                     if (_widthPolicy >= 0)
1928                     {
1929                         _measureSpecificationWidth = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
1930
1931                         if(_heightPolicy>=0) // Policy an exact value
1932                         {
1933                             Size2D.Width = _widthPolicy;
1934                         }
1935                         else
1936                         {
1937                             // Store _heightPolicy in the Size2D memember as will be reset to 0 by a Size2D callback.
1938                             // Size2D height will store the specification value (negative number) this will then be applied to the
1939                             // HeightSpecification when the Size2D callback is invoked.
1940                             Size2D = new Size2D(_widthPolicy,_heightPolicy);
1941                         }
1942                     }
1943                     _layout?.RequestLayout();
1944                     _oldWidthPolicy = _widthPolicy;
1945                 }
1946             }
1947         }
1948
1949         ///<summary>
1950         /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
1951         ///</summary>
1952         /// <since_tizen> 6 </since_tizen>
1953         public int HeightSpecification
1954         {
1955             get
1956             {
1957                 return _heightPolicy;
1958             }
1959             set
1960             {
1961                 _heightPolicy = value;
1962                 if( _oldHeightPolicy != _heightPolicy )
1963                 {
1964                     if (_heightPolicy >= 0)
1965                     {
1966                         _measureSpecificationHeight = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
1967
1968                         if(_widthPolicy>=0) // Policy an exact value
1969                         {
1970                             Size2D.Height = _heightPolicy;
1971                         }
1972                         else
1973                         {
1974                             // Store widthPolicy in the Size2D memember as will be reset to 0 by a Size2D callback.
1975                             // Size2D height will store the specification value (negative number) this will then be applied to the
1976                             // HeightSpecification when the Size2D callback is invoked.
1977                             Size2D = new Size2D(_widthPolicy,_heightPolicy);
1978                         }
1979
1980                     }
1981                     _layout?.RequestLayout();
1982                     _oldHeightPolicy = _heightPolicy;
1983                 }
1984             }
1985         }
1986
1987         ///<summary>
1988         /// Gets the List of transitions for this View.
1989         ///</summary>
1990         /// <since_tizen> 6 </since_tizen>
1991         public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
1992         {
1993             get
1994             {
1995                 if (_layoutTransitions == null)
1996                 {
1997                     _layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
1998                 }
1999                 return _layoutTransitions;
2000             }
2001         }
2002
2003         ///<summary>
2004         /// Set a layout transitions for this View.
2005         ///</summary>
2006         /// <remarks>
2007         /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2008         /// </remarks>
2009         /// <since_tizen> 6 </since_tizen>
2010         public LayoutTransition LayoutTransition
2011         {
2012             set
2013             {
2014                 if (_layoutTransitions == null)
2015                 {
2016                     _layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2017                 }
2018                 LayoutTransitionsHelper.AddTransitionForCondition(_layoutTransitions,value.Condition,value, true);
2019
2020                 AttachTransitionsToChildren(value);
2021             }
2022         }
2023
2024         /// <summary>
2025         /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
2026         /// </summary>
2027         /// <remarks>
2028         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2029         /// </remarks>
2030         /// <since_tizen> 4 </since_tizen>
2031         [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
2032         [EditorBrowsable(EditorBrowsableState.Never)]
2033         public Extents PaddingEX
2034         {
2035             get
2036             {
2037                 Extents temp = new Extents(0, 0, 0, 0);
2038                 GetProperty(View.Property.PADDING).Get(temp);
2039                 return new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2040             }
2041             set
2042             {
2043                 SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value));
2044                 NotifyPropertyChanged();
2045                 _layout?.RequestLayout();
2046             }
2047         }
2048
2049         /// <since_tizen> 6 </since_tizen>
2050         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2051         [EditorBrowsable(EditorBrowsableState.Never)]
2052         public Style XamlStyle
2053         {
2054             get
2055             {
2056                 return (Style)GetValue(XamlStyleProperty);
2057             }
2058             set
2059             {
2060                 SetValue(XamlStyleProperty, value);
2061             }
2062         }
2063
2064         /// <summary>
2065         /// The Color of View. This is an RGBA value.
2066         /// </summary>
2067         /// <remarks>
2068         /// <para>
2069         /// Animatable - This property can be animated using <c>Animation</c> class.
2070         /// </para>
2071         /// The property cascade chaining set is possible. For example, this (view.Color.X = 0.1f;) is possible.
2072         /// </remarks>
2073         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2074         [EditorBrowsable(EditorBrowsableState.Never)]
2075         public Color Color
2076         {
2077             get
2078             {
2079                 Color temp = (Color)GetValue(ColorProperty);
2080                 return new Color(OnColorChanged, temp.R, temp.G, temp.B, temp.A);
2081             }
2082             set
2083             {
2084                 SetValue(ColorProperty, value);
2085                 selectorData?.Color.UpdateIfNeeds(this, value);
2086                 NotifyPropertyChanged();
2087             }
2088         }
2089
2090         /// <summary>
2091         /// Set the layout on this View. Replaces any existing Layout.
2092         /// </summary>
2093         /// <since_tizen> 6 </since_tizen>
2094         public LayoutItem Layout
2095         {
2096             get
2097             {
2098                 return _layout;
2099             }
2100             set
2101             {
2102                 // Do nothing if layout provided is already set on this View.
2103                 if (value == _layout)
2104                 {
2105                     return;
2106                 }
2107
2108                 Log.Info("NUI", "Setting Layout on:" + Name + "\n");
2109                 layoutingDisabled = false;
2110                 layoutSet = true;
2111
2112                 // If new layout being set already has a owner then that owner receives a replacement default layout.
2113                 // First check if the layout to be set already has a owner.
2114                 if (value?.Owner != null)
2115                 {
2116                     // Previous owner of the layout gets a default layout as a replacement.
2117                     value.Owner.Layout = new AbsoluteLayout();
2118
2119                     // Copy Margin and Padding to replacement LayoutGroup.
2120                     value.Owner.Layout.Margin = value.Margin;
2121                     value.Owner.Layout.Padding = value.Padding;
2122                 }
2123
2124                 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2125                 // View if no replacement. Previously margin and padding values would have been moved from
2126                 // the View to the layout.
2127                 if (_layout != null ) // Existing layout
2128                 {
2129                     if (value != null)
2130                     {
2131                         // Existing layout being replaced so copy over margin and padding values.
2132                         value.Margin = _layout.Margin;
2133                         value.Padding = _layout.Padding;
2134                     }
2135                     else
2136                     {
2137                       // Layout not being replaced so restore margin and padding to View.
2138                       SetValue(MarginProperty, _layout.Margin);
2139                       SetValue(PaddingProperty, _layout.Padding);
2140                       NotifyPropertyChanged();
2141                     }
2142                 }
2143                 else
2144                 {
2145                     // First Layout to be added to the View hence copy
2146
2147                     // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2148                     if (value !=null)
2149                     {
2150                         if (Margin.Top != 0 || Margin.Bottom !=0 || Margin.Start !=0 || Margin.End != 0)
2151                         {
2152                             // If View already has a margin set then store it in Layout instead.
2153                             value.Margin = Margin;
2154                             SetValue(MarginProperty, new Extents(0,0,0,0));
2155                             NotifyPropertyChanged();
2156                         }
2157
2158                         if (Padding.Top != 0 || Padding.Bottom !=0 || Padding.Start !=0 || Padding.End != 0)
2159                         {
2160                             // If View already has a padding set then store it in Layout instead.
2161                             value.Padding = Padding;
2162                             SetValue(PaddingProperty, new Extents(0,0,0,0));
2163                             NotifyPropertyChanged();
2164                         }
2165                     }
2166                 }
2167
2168                 // Remove existing layout from it's parent layout group.
2169                 _layout?.Unparent();
2170
2171                 // Set layout to this view
2172                 SetLayout(value);
2173             }
2174         }
2175
2176         /// <summary>
2177         /// The weight of the View, used to share available space in a layout with siblings.
2178         /// </summary>
2179         /// <since_tizen> 6 </since_tizen>
2180         public float Weight
2181         {
2182             get
2183             {
2184                 return _weight;
2185             }
2186             set
2187             {
2188                 _weight = value;
2189                 _layout?.RequestLayout();
2190             }
2191         }
2192
2193         /// <summary>
2194         ///  Whether to load the BackgroundImage synchronously.
2195         ///  If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2196         ///  Note: For Normal Quad images only.
2197         /// </summary>
2198         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2199         [EditorBrowsable(EditorBrowsableState.Never)]
2200         public bool BackgroundImageSynchronosLoading
2201         {
2202             get
2203             {
2204                 return _backgroundImageSynchronosLoading;
2205             }
2206             set
2207             {
2208                 _backgroundImageSynchronosLoading = value;
2209                 string bgUrl = "";
2210                 int visualType = 0;
2211                 Background.Find(Visual.Property.Type)?.Get(out visualType);
2212                 if (visualType == (int)Visual.Type.Image)
2213                 {
2214                     Background.Find(ImageVisualProperty.URL)?.Get(out bgUrl);
2215                 }
2216
2217                 if (bgUrl.Length != 0)
2218                 {
2219                     PropertyMap bgMap = this.Background;
2220                     bgMap.Add("synchronousLoading", new PropertyValue(_backgroundImageSynchronosLoading));
2221                     Background = bgMap;
2222                 }
2223             }
2224         }
2225
2226         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2227         [EditorBrowsable(EditorBrowsableState.Never)]
2228         public Vector2 UpdateSizeHint
2229         {
2230             get
2231             {
2232                 return (Vector2)GetValue(UpdateSizeHintProperty);
2233             }
2234             set
2235             {
2236                 SetValue(UpdateSizeHintProperty, value);
2237                 NotifyPropertyChanged();
2238             }
2239         }
2240
2241         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
2242         [EditorBrowsable(EditorBrowsableState.Never)]
2243         public string[] TransitionNames
2244         {
2245             get
2246             {
2247                 return transitionNames;
2248             }
2249             set
2250             {
2251                 transitionNames = value;
2252                 LoadTransitions();
2253             }
2254         }
2255
2256         /// <summary>
2257         /// Enable/Disable ControlState propagation for children.
2258         /// It is false by default.
2259         /// If the View needs to share ControlState with descendants, please set it true.
2260         /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
2261         /// </summary>
2262         [EditorBrowsable(EditorBrowsableState.Never)]
2263         public bool EnableControlStatePropagation
2264         {
2265             get => controlStatePropagation;
2266             set
2267             {
2268                 controlStatePropagation = value;
2269
2270                 foreach (View child in Children)
2271                 {
2272                     child.EnableControlStatePropagation = value;
2273                 }
2274             }
2275         }
2276
2277         /// <summary>
2278         /// Get Style, it is abstract function and must be override.
2279         /// </summary>
2280         /// <since_tizen> 6 </since_tizen>
2281         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2282         // TODO: It should be deprecated. please use CreateViewStyle instead.
2283         [EditorBrowsable(EditorBrowsableState.Never)]
2284         protected virtual ViewStyle GetViewStyle()
2285         {
2286             return CreateViewStyle();
2287         }
2288
2289         /// <summary>
2290         /// Create Style, it is abstract function and must be override.
2291         /// </summary>
2292         [EditorBrowsable(EditorBrowsableState.Never)]
2293         protected virtual ViewStyle CreateViewStyle()
2294         {
2295             return new ViewStyle();
2296         }
2297
2298         /// <summary>
2299         /// Called after the View's ControlStates changed.
2300         /// </summary>
2301         /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
2302         [EditorBrowsable(EditorBrowsableState.Never)]
2303         protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
2304         {
2305         }
2306
2307         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2308         [EditorBrowsable(EditorBrowsableState.Never)]
2309         public virtual void ApplyStyle(ViewStyle viewStyle)
2310         {
2311             if (null == viewStyle || this.viewStyle == viewStyle) return;
2312
2313             this.viewStyle = viewStyle;
2314
2315             Dictionary<string, BindableProperty> bindablePropertyOfView;
2316             Type viewType = GetType();
2317
2318             Dictionary<string, BindableProperty> bindablePropertyOfStyle;
2319             Type styleType = viewStyle.GetType();
2320
2321             BindableProperty.GetBindablePropertysOfType(viewType, out bindablePropertyOfView);
2322             BindableProperty.GetBindablePropertysOfType(styleType, out bindablePropertyOfStyle);
2323
2324             if (null != bindablePropertyOfView && null != bindablePropertyOfStyle)
2325             {
2326                 foreach (KeyValuePair<string, BindableProperty> keyValuePair in bindablePropertyOfStyle)
2327                 {
2328                     BindableProperty viewProperty;
2329                     bindablePropertyOfView.TryGetValue(keyValuePair.Key, out viewProperty);
2330
2331                     if (null != viewProperty)
2332                     {
2333                         object value = viewStyle.GetValue(keyValuePair.Value);
2334
2335                         if (null != value)
2336                         {
2337                             SetValue(viewProperty, value);
2338                         }
2339                     }
2340                 }
2341             }
2342         }
2343     }
2344 }