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