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