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