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