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