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