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