[NUI] Fix Dropdown runtime error (#1232)
[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         /// <since_tizen> 3 </since_tizen>
669         public float Opacity
670         {
671             get
672             {
673                 return (float)GetValue(OpacityProperty);
674             }
675             set
676             {
677                 SetValue(OpacityProperty, value);
678                 NotifyPropertyChanged();
679             }
680         }
681
682         /// <summary>
683         /// Sets the position of the view for X and Y.<br />
684         /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
685         /// If the position inheritance is disabled, sets the world position.<br />
686         /// </summary>
687         /// <remarks>
688         /// This NUI object (Position2D) typed property can be configured by multiple cascade setting. <br />
689         /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ). <br />
690         /// </remarks>
691         /// <since_tizen> 3 </since_tizen>
692         public Position2D Position2D
693         {
694             get
695             {
696                 Position2D temp = (Position2D)GetValue(Position2DProperty);
697                 return new Position2D(OnPosition2DChanged, temp.X, temp.Y);
698             }
699             set
700             {
701                 SetValue(Position2DProperty, value);
702                 NotifyPropertyChanged();
703             }
704         }
705
706         /// <summary>
707         /// Retrieves the screen postion of the view.<br />
708         /// </summary>
709         /// <since_tizen> 3 </since_tizen>
710         public Vector2 ScreenPosition
711         {
712             get
713             {
714                 Vector2 temp = new Vector2(0.0f, 0.0f);
715                 GetProperty(View.Property.SCREEN_POSITION).Get(temp);
716                 return temp;
717             }
718         }
719
720         /// <summary>
721         /// Determines whether the pivot point should be used to determine the position of the view.
722         /// This is true by default.
723         /// </summary>
724         /// <remarks>If false, then the top-left of the view is used for the position.
725         /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
726         /// </remarks>
727         /// <since_tizen> 3 </since_tizen>
728         public bool PositionUsesPivotPoint
729         {
730             get
731             {
732                 return (bool)GetValue(PositionUsesPivotPointProperty);
733             }
734             set
735             {
736                 SetValue(PositionUsesPivotPointProperty, value);
737                 NotifyPropertyChanged();
738             }
739         }
740
741         /// <summary>
742         /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead!
743         /// </summary>
744         /// <since_tizen> 3 </since_tizen>
745         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " +
746             "Like: " +
747             "View view = new View(); " +
748             "view.PivotPoint = PivotPoint.Center; " +
749             "view.PositionUsesPivotPoint = true;" +
750             " Deprecated in API5: Will be removed in API8")]
751         [EditorBrowsable(EditorBrowsableState.Never)]
752         public bool PositionUsesAnchorPoint
753         {
754             get
755             {
756                 bool temp = false;
757                 GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp);
758                 return temp;
759             }
760             set
761             {
762                 SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
763                 NotifyPropertyChanged();
764             }
765         }
766
767         /// <summary>
768         /// Queries whether the view is connected to the stage.<br />
769         /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
770         /// </summary>
771         /// <since_tizen> 3 </since_tizen>
772         public bool IsOnWindow
773         {
774             get
775             {
776                 return OnWindow();
777             }
778         }
779
780         /// <summary>
781         /// Gets the depth in the hierarchy for the view.
782         /// </summary>
783         /// <since_tizen> 3 </since_tizen>
784         public int HierarchyDepth
785         {
786             get
787             {
788                 return GetHierarchyDepth();
789             }
790         }
791
792         /// <summary>
793         /// Sets the sibling order of the view so the depth position can be defined within the same parent.
794         /// </summary>
795         /// <remarks>
796         /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
797         /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
798         /// The values set by this property will likely change.
799         /// </remarks>
800         /// <since_tizen> 3 </since_tizen>
801         public int SiblingOrder
802         {
803             get
804             {
805                 return (int)GetValue(SiblingOrderProperty);
806             }
807             set
808             {
809                 SetValue(SiblingOrderProperty, value);
810                 NotifyPropertyChanged();
811             }
812         }
813
814         /// <summary>
815         /// Returns the natural size of the view.
816         /// </summary>
817         /// <remarks>
818         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
819         /// </remarks>
820         /// <since_tizen> 5 </since_tizen>
821         public Vector3 NaturalSize
822         {
823             get
824             {
825                 Vector3 ret = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true);
826                 if (NDalicPINVOKE.SWIGPendingException.Pending)
827                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
828                 return ret;
829             }
830         }
831
832         /// <summary>
833         /// Returns the natural size (Size2D) of the view.
834         /// </summary>
835         /// <remarks>
836         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
837         /// </remarks>
838         /// <since_tizen> 4 </since_tizen>
839         public Size2D NaturalSize2D
840         {
841             get
842             {
843                 Vector3 temp = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true);
844                 if (NDalicPINVOKE.SWIGPendingException.Pending)
845                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
846
847                 return new Size2D((int)temp.Width, (int)temp.Height);
848             }
849         }
850
851         /// <summary>
852         /// Gets or sets the origin of a view within its parent's area.<br />
853         /// 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 />
854         /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
855         /// A view's position is the distance between this origin and the view's anchor-point.<br />
856         /// </summary>
857         /// <pre>The view has been initialized.</pre>
858         /// <since_tizen> 3 </since_tizen>
859         public Position ParentOrigin
860         {
861             get
862             {
863                 Position tmp = (Position)GetValue(ParentOriginProperty);
864                 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
865             }
866             set
867             {
868                 SetValue(ParentOriginProperty, value);
869                 NotifyPropertyChanged();
870             }
871         }
872
873         /// <summary>
874         /// Gets or sets the anchor-point of a view.<br />
875         /// 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 />
876         /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
877         /// A view position is the distance between its parent-origin and this anchor-point.<br />
878         /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
879         /// <pre>The view has been initialized.</pre>
880         /// </summary>
881         /// <remarks>
882         /// The property cascade chaining set is possible. For example, this (view.PivotPoint.X = 0.1f;) is possible.
883         /// </remarks>
884         /// <since_tizen> 3 </since_tizen>
885         public Position PivotPoint
886         {
887             get
888             {
889                 Position tmp = (Position)GetValue(PivotPointProperty);
890                 return new Position(OnPivotPointChanged, tmp.X, tmp.Y, tmp.Z);
891             }
892             set
893             {
894                 SetValue(PivotPointProperty, value);
895                 NotifyPropertyChanged();
896             }
897         }
898
899         /// <summary>
900         /// Gets or sets the size width of the view.
901         /// </summary>
902         /// <remarks>
903         /// <para>
904         /// Animatable - This property can be animated using <c>Animation</c> class.
905         /// </para>
906         /// </remarks>
907         /// <since_tizen> 3 </since_tizen>
908         public float SizeWidth
909         {
910             get
911             {
912                 return (float)GetValue(SizeWidthProperty);
913             }
914             set
915             {
916                 SetValue(SizeWidthProperty, value);
917                 WidthSpecification = (int)Math.Ceiling(value);
918                 NotifyPropertyChanged();
919             }
920         }
921
922         /// <summary>
923         /// Gets or sets the size height of the view.
924         /// </summary>
925         /// <remarks>
926         /// <para>
927         /// Animatable - This property can be animated using <c>Animation</c> class.
928         /// </para>
929         /// </remarks>
930         /// <since_tizen> 3 </since_tizen>
931         public float SizeHeight
932         {
933             get
934             {
935                 return (float)GetValue(SizeHeightProperty);
936             }
937             set
938             {
939                 SetValue(SizeHeightProperty, value);
940                 HeightSpecification = (int)Math.Ceiling(value);
941                 NotifyPropertyChanged();
942             }
943         }
944
945         /// <summary>
946         /// Gets or sets the position of the view.<br />
947         /// By default, sets the position vector between the parent origin and pivot point (default).<br />
948         /// If the position inheritance is disabled, sets the world position.<br />
949         /// </summary>
950         /// <remarks>
951         /// <para>
952         /// Animatable - This property can be animated using <c>Animation</c> class.
953         /// </para>
954         /// The property cascade chaining set is possible. For example, this (view.Position.X = 1.0f;) is possible.
955         /// </remarks>
956         /// <since_tizen> 3 </since_tizen>
957         public Position Position
958         {
959             get
960             {
961                 Position tmp = (Position)GetValue(PositionProperty);
962                 return new Position(OnPositionChanged, tmp.X, tmp.Y, tmp.Z);
963             }
964             set
965             {
966                 SetValue(PositionProperty, value);
967                 NotifyPropertyChanged();
968             }
969         }
970
971         /// <summary>
972         /// Gets or sets the position X of the view.
973         /// </summary>
974         /// <remarks>
975         /// <para>
976         /// Animatable - This property can be animated using <c>Animation</c> class.
977         /// </para>
978         /// </remarks>
979         /// <since_tizen> 3 </since_tizen>
980         public float PositionX
981         {
982             get
983             {
984                 return (float)GetValue(PositionXProperty);
985             }
986             set
987             {
988                 SetValue(PositionXProperty, value);
989                 NotifyPropertyChanged();
990             }
991         }
992
993         /// <summary>
994         /// Gets or sets the position Y of the view.
995         /// </summary>
996         /// <remarks>
997         /// <para>
998         /// Animatable - This property can be animated using <c>Animation</c> class.
999         /// </para>
1000         /// </remarks>
1001         /// <since_tizen> 3 </since_tizen>
1002         public float PositionY
1003         {
1004             get
1005             {
1006                 return (float)GetValue(PositionYProperty);
1007             }
1008             set
1009             {
1010                 SetValue(PositionYProperty, value);
1011                 NotifyPropertyChanged();
1012             }
1013         }
1014
1015         /// <summary>
1016         /// Gets or sets the position Z of the view.
1017         /// </summary>
1018         /// <remarks>
1019         /// <para>
1020         /// Animatable - This property can be animated using <c>Animation</c> class.
1021         /// </para>
1022         /// </remarks>
1023         /// <since_tizen> 3 </since_tizen>
1024         public float PositionZ
1025         {
1026             get
1027             {
1028                 return (float)GetValue(PositionZProperty);
1029             }
1030             set
1031             {
1032                 SetValue(PositionZProperty, value);
1033                 NotifyPropertyChanged();
1034             }
1035         }
1036
1037         /// <summary>
1038         /// Gets or sets the world position of the view.
1039         /// </summary>
1040         /// <since_tizen> 3 </since_tizen>
1041         public Vector3 WorldPosition
1042         {
1043             get
1044             {
1045                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1046                 GetProperty(View.Property.WORLD_POSITION).Get(temp);
1047                 return temp;
1048             }
1049         }
1050
1051         /// <summary>
1052         /// Gets or sets the orientation of the view.<br />
1053         /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1054         /// </summary>
1055         /// <remarks>
1056         /// <para>
1057         /// This is an asynchronous method.
1058         /// </para>
1059         /// <para>
1060         /// Animatable - This property can be animated using <c>Animation</c> class.
1061         /// </para>
1062         /// </remarks>
1063         /// <since_tizen> 3 </since_tizen>
1064         public Rotation Orientation
1065         {
1066             get
1067             {
1068                 return (Rotation)GetValue(OrientationProperty);
1069             }
1070             set
1071             {
1072                 SetValue(OrientationProperty, value);
1073                 NotifyPropertyChanged();
1074             }
1075         }
1076
1077         /// <summary>
1078         /// Gets or sets the world orientation of the view.<br />
1079         /// </summary>
1080         /// <since_tizen> 3 </since_tizen>
1081         public Rotation WorldOrientation
1082         {
1083             get
1084             {
1085                 Rotation temp = new Rotation();
1086                 GetProperty(View.Property.WORLD_ORIENTATION).Get(temp);
1087                 return temp;
1088             }
1089         }
1090
1091         /// <summary>
1092         /// Gets or sets the scale factor applied to the view.<br />
1093         /// </summary>
1094         /// <remarks>
1095         /// <para>
1096         /// Animatable - This property can be animated using <c>Animation</c> class.
1097         /// </para>
1098         /// The property cascade chaining set is possible. For example, this (view.Scale.X = 0.1f;) is possible.
1099         /// </remarks>
1100         /// <since_tizen> 3 </since_tizen>
1101         public Vector3 Scale
1102         {
1103             get
1104             {
1105                 Vector3 temp = (Vector3)GetValue(ScaleProperty);
1106                 return new Vector3(OnScaleChanged, temp.X, temp.Y, temp.Z);
1107             }
1108             set
1109             {
1110                 SetValue(ScaleProperty, value);
1111                 NotifyPropertyChanged();
1112             }
1113         }
1114
1115         /// <summary>
1116         /// Gets or sets the scale X factor applied to the view.
1117         /// </summary>
1118         /// <remarks>
1119         /// <para>
1120         /// Animatable - This property can be animated using <c>Animation</c> class.
1121         /// </para>
1122         /// </remarks>
1123         /// <since_tizen> 3 </since_tizen>
1124         public float ScaleX
1125         {
1126             get
1127             {
1128                 return (float)GetValue(ScaleXProperty);
1129             }
1130             set
1131             {
1132                 SetValue(ScaleXProperty, value);
1133                 NotifyPropertyChanged();
1134             }
1135         }
1136
1137         /// <summary>
1138         /// Gets or sets the scale Y factor applied to the view.
1139         /// </summary>
1140         /// <remarks>
1141         /// <para>
1142         /// Animatable - This property can be animated using <c>Animation</c> class.
1143         /// </para>
1144         /// </remarks>
1145         /// <since_tizen> 3 </since_tizen>
1146         public float ScaleY
1147         {
1148             get
1149             {
1150                 return (float)GetValue(ScaleYProperty);
1151             }
1152             set
1153             {
1154                 SetValue(ScaleYProperty, value);
1155                 NotifyPropertyChanged();
1156             }
1157         }
1158
1159         /// <summary>
1160         /// Gets or sets the scale Z factor applied to the view.
1161         /// </summary>
1162         /// <remarks>
1163         /// <para>
1164         /// Animatable - This property can be animated using <c>Animation</c> class.
1165         /// </para>
1166         /// </remarks>
1167         /// <since_tizen> 3 </since_tizen>
1168         public float ScaleZ
1169         {
1170             get
1171             {
1172                 return (float)GetValue(ScaleZProperty);
1173             }
1174             set
1175             {
1176                 SetValue(ScaleZProperty, value);
1177                 NotifyPropertyChanged();
1178             }
1179         }
1180
1181         /// <summary>
1182         /// Gets the world scale of the view.
1183         /// </summary>
1184         /// <since_tizen> 3 </since_tizen>
1185         public Vector3 WorldScale
1186         {
1187             get
1188             {
1189                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1190                 GetProperty(View.Property.WORLD_SCALE).Get(temp);
1191                 return temp;
1192             }
1193         }
1194
1195         /// <summary>
1196         /// Retrieves the visibility flag of the view.
1197         /// </summary>
1198         /// <remarks>
1199         /// <para>
1200         /// If the view is not visible, then the view and its children will not be rendered.
1201         /// 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.
1202         /// </para>
1203         /// <para>
1204         /// Animatable - This property can be animated using <c>Animation</c> class.
1205         /// </para>
1206         /// </remarks>
1207         /// <since_tizen> 3 </since_tizen>
1208         public bool Visibility
1209         {
1210             get
1211             {
1212                 bool temp = false;
1213                 GetProperty(View.Property.VISIBLE).Get(out temp);
1214                 return temp;
1215             }
1216         }
1217
1218         /// <summary>
1219         /// Gets the view's world color.
1220         /// </summary>
1221         /// <since_tizen> 3 </since_tizen>
1222         public Vector4 WorldColor
1223         {
1224             get
1225             {
1226                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1227                 GetProperty(View.Property.WORLD_COLOR).Get(temp);
1228                 return temp;
1229             }
1230         }
1231
1232         /// <summary>
1233         /// Gets or sets the view's name.
1234         /// </summary>
1235         /// <since_tizen> 3 </since_tizen>
1236         public string Name
1237         {
1238             get
1239             {
1240                 return (string)GetValue(NameProperty);
1241             }
1242             set
1243             {
1244                 SetValue(NameProperty, value);
1245                 NotifyPropertyChanged();
1246             }
1247         }
1248
1249         /// <summary>
1250         /// Get the number of children held by the view.
1251         /// </summary>
1252         /// <since_tizen> 3 </since_tizen>
1253         public new uint ChildCount
1254         {
1255             get
1256             {
1257                 return GetChildCount();
1258             }
1259         }
1260
1261         /// <summary>
1262         /// Gets the view's ID.
1263         /// Readonly
1264         /// </summary>
1265         /// <since_tizen> 3 </since_tizen>
1266         public uint ID
1267         {
1268             get
1269             {
1270                 return GetId();
1271             }
1272         }
1273
1274         /// <summary>
1275         /// Gets or sets the status of whether the view should emit touch or hover signals.
1276         /// </summary>
1277         /// <since_tizen> 3 </since_tizen>
1278         public bool Sensitive
1279         {
1280             get
1281             {
1282                 return (bool)GetValue(SensitiveProperty);
1283             }
1284             set
1285             {
1286                 SetValue(SensitiveProperty, value);
1287                 NotifyPropertyChanged();
1288             }
1289         }
1290
1291         /// <summary>
1292         /// 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.
1293         /// </summary>
1294         /// <since_tizen> 3 </since_tizen>
1295         public bool LeaveRequired
1296         {
1297             get
1298             {
1299                 return (bool)GetValue(LeaveRequiredProperty);
1300             }
1301             set
1302             {
1303                 SetValue(LeaveRequiredProperty, value);
1304                 NotifyPropertyChanged();
1305             }
1306         }
1307
1308         /// <summary>
1309         /// Gets or sets the status of whether a child view inherits it's parent's orientation.
1310         /// </summary>
1311         /// <since_tizen> 3 </since_tizen>
1312         public bool InheritOrientation
1313         {
1314             get
1315             {
1316                 return (bool)GetValue(InheritOrientationProperty);
1317             }
1318             set
1319             {
1320                 SetValue(InheritOrientationProperty, value);
1321                 NotifyPropertyChanged();
1322             }
1323         }
1324
1325         /// <summary>
1326         /// Gets or sets the status of whether a child view inherits it's parent's scale.
1327         /// </summary>
1328         /// <since_tizen> 3 </since_tizen>
1329         public bool InheritScale
1330         {
1331             get
1332             {
1333                 return (bool)GetValue(InheritScaleProperty);
1334             }
1335             set
1336             {
1337                 SetValue(InheritScaleProperty, value);
1338                 NotifyPropertyChanged();
1339             }
1340         }
1341
1342         /// <summary>
1343         /// Gets or sets the status of how the view and its children should be drawn.<br />
1344         /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
1345         /// 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 />
1346         /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
1347         /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
1348         /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
1349         /// </summary>
1350         /// <since_tizen> 3 </since_tizen>
1351         public DrawModeType DrawMode
1352         {
1353             get
1354             {
1355                 return (DrawModeType)GetValue(DrawModeProperty);
1356             }
1357             set
1358             {
1359                 SetValue(DrawModeProperty, value);
1360                 NotifyPropertyChanged();
1361             }
1362         }
1363
1364         /// <summary>
1365         /// Gets or sets the relative to parent size factor of the view.<br />
1366         /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
1367         /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
1368         /// </summary>
1369         /// <remarks>
1370         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
1371         /// </remarks>
1372         /// <since_tizen> 3 </since_tizen>
1373         public Vector3 SizeModeFactor
1374         {
1375             get
1376             {
1377                 Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty);
1378                 return new Vector3(OnSizeModeFactorChanged, temp.X, temp.Y, temp.Z);
1379             }
1380             set
1381             {
1382                 SetValue(SizeModeFactorProperty, value);
1383                 NotifyPropertyChanged();
1384             }
1385         }
1386
1387         /// <summary>
1388         /// Gets or sets the width resize policy to be used.
1389         /// </summary>
1390         /// <since_tizen> 3 </since_tizen>
1391         public ResizePolicyType WidthResizePolicy
1392         {
1393             get
1394             {
1395                 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
1396             }
1397             set
1398             {
1399                 SetValue(WidthResizePolicyProperty, value);
1400                 // Match ResizePolicy to new Layouting.
1401                 // Parent relative policies can not be mapped at this point as parent size unknown.
1402                 switch (value)
1403                 {
1404                     case ResizePolicyType.UseNaturalSize:
1405                     {
1406                         WidthSpecification = LayoutParamPolicies.WrapContent;
1407                         break;
1408                     }
1409                     case ResizePolicyType.FillToParent:
1410                     {
1411                         WidthSpecification = LayoutParamPolicies.MatchParent;
1412                         break;
1413                     }
1414                     case ResizePolicyType.FitToChildren:
1415                     {
1416                         WidthSpecification = LayoutParamPolicies.WrapContent;
1417                         break;
1418                     }
1419                     default:
1420                         break;
1421                 }
1422                 NotifyPropertyChanged();
1423             }
1424         }
1425
1426         /// <summary>
1427         /// Gets or sets the height resize policy to be used.
1428         /// </summary>
1429         /// <since_tizen> 3 </since_tizen>
1430         public ResizePolicyType HeightResizePolicy
1431         {
1432             get
1433             {
1434                 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
1435             }
1436             set
1437             {
1438                 SetValue(HeightResizePolicyProperty, value);
1439                 // Match ResizePolicy to new Layouting.
1440                 // Parent relative policies can not be mapped at this point as parent size unknown.
1441                 switch (value)
1442                 {
1443                     case ResizePolicyType.UseNaturalSize:
1444                     {
1445                         HeightSpecification = LayoutParamPolicies.WrapContent;
1446                         break;
1447                     }
1448                     case ResizePolicyType.FillToParent:
1449                     {
1450                         HeightSpecification = LayoutParamPolicies.MatchParent;
1451                         break;
1452                     }
1453                     case ResizePolicyType.FitToChildren:
1454                     {
1455                         HeightSpecification = LayoutParamPolicies.WrapContent;
1456                         break;
1457                     }
1458                     default:
1459                         break;
1460                 }
1461                 NotifyPropertyChanged();
1462             }
1463         }
1464
1465         /// <summary>
1466         /// Gets or sets the policy to use when setting size with size negotiation.<br />
1467         /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
1468         /// </summary>
1469         /// <since_tizen> 3 </since_tizen>
1470         public SizeScalePolicyType SizeScalePolicy
1471         {
1472             get
1473             {
1474                 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
1475             }
1476             set
1477             {
1478                 SetValue(SizeScalePolicyProperty, value);
1479                 NotifyPropertyChanged();
1480             }
1481         }
1482
1483         /// <summary>
1484         ///  Gets or sets the status of whether the width size is dependent on the height size.
1485         /// </summary>
1486         /// <since_tizen> 3 </since_tizen>
1487         public bool WidthForHeight
1488         {
1489             get
1490             {
1491                 return (bool)GetValue(WidthForHeightProperty);
1492             }
1493             set
1494             {
1495                 SetValue(WidthForHeightProperty, value);
1496                 NotifyPropertyChanged();
1497             }
1498         }
1499
1500         /// <summary>
1501         /// Gets or sets the status of whether the height size is dependent on the width size.
1502         /// </summary>
1503         /// <since_tizen> 3 </since_tizen>
1504         public bool HeightForWidth
1505         {
1506             get
1507             {
1508                 return (bool)GetValue(HeightForWidthProperty);
1509             }
1510             set
1511             {
1512                 SetValue(HeightForWidthProperty, value);
1513                 NotifyPropertyChanged();
1514             }
1515         }
1516
1517         /// <summary>
1518         /// Gets or sets the padding for use in layout.
1519         /// </summary>
1520         /// <remarks>
1521         /// The property cascade chaining set is possible. For example, this (view.Padding.X = 0.1f;) is possible.
1522         /// </remarks>
1523         /// <since_tizen> 5 </since_tizen>
1524         public Extents Padding
1525         {
1526             get
1527             {
1528                 // If View has a Layout then padding in stored in the base Layout class
1529                 if (Layout !=null)
1530                 {
1531                     return Layout.Padding;
1532                 }
1533                 else
1534                 {
1535                     Extents temp = (Extents)GetValue(PaddingProperty);
1536                     return new Extents(OnPaddingChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1537                 }
1538                 // Two return points to prevent creating a zeroed Extent native object before assignment
1539             }
1540             set
1541             {
1542                 Extents padding = value;
1543                 if (Layout !=null)
1544                 {
1545                     // Layout set so store Padding in LayoutItem instead of in View.
1546                     // If View stores the Padding value then Legacy Size Negotiation will overwrite
1547                     // the position and sizes measure in the Layouting.
1548                     Layout.Padding = value;
1549                     // If Layout is a LayoutItem then it could be a View that handles it's own padding.
1550                     // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
1551                     if( Layout.GetType() != typeof(LayoutItem)) // If a Layout container of some kind.
1552                     {
1553                         padding =  new Extents(0,0,0,0); // Reset value stored in View.
1554                     }
1555                     _layout?.RequestLayout();
1556                 }
1557                 SetValue(PaddingProperty, padding);
1558                 NotifyPropertyChanged();
1559                 _layout?.RequestLayout();
1560             }
1561         }
1562
1563         /// <summary>
1564         /// Gets or sets the minimum size the view can be assigned in size negotiation.
1565         /// </summary>
1566         /// <remarks>
1567         /// The property cascade chaining set is possible. For example, this (view.MinimumSize.Width = 1;) is possible.
1568         /// </remarks>
1569         /// <since_tizen> 3 </since_tizen>
1570         public Size2D MinimumSize
1571         {
1572             get
1573             {
1574                 Size2D tmp = (Size2D)GetValue(MinimumSizeProperty);
1575                 return new Size2D(OnMinimumSizeChanged, tmp.Width, tmp.Height);
1576             }
1577             set
1578             {
1579                 if (_layout != null)
1580                 {
1581                     // Note: it only works if minimum size is >= than natural size.
1582                     // To force the size it should be done through the width&height spec or Size2D.
1583                     _layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
1584                     _layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
1585                     _layout.RequestLayout();
1586                 }
1587                 SetValue(MinimumSizeProperty, value);
1588                 NotifyPropertyChanged();
1589             }
1590         }
1591
1592         /// <summary>
1593         /// Gets or sets the maximum size the view can be assigned in size negotiation.
1594         /// </summary>
1595         /// <remarks>
1596         /// The property cascade chaining set is possible. For example, this (view.MaximumSize.Width = 1;) is possible.
1597         /// </remarks>
1598         /// <since_tizen> 3 </since_tizen>
1599         public Size2D MaximumSize
1600         {
1601             get
1602             {
1603                 Size2D tmp = (Size2D)GetValue(MaximumSizeProperty);
1604                 return new Size2D(OnMaximumSizeChanged, tmp.Width, tmp.Height);
1605             }
1606             set
1607             {
1608                 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
1609                 // MATCH_PARENT spec + parent container size can be used to limit
1610                 if (_layout != null)
1611                 {
1612                     // Note: it only works if minimum size is >= than natural size.
1613                     // To force the size it should be done through the width&height spec or Size2D.
1614                     _layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Width);
1615                     _layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Height);
1616                     _layout.RequestLayout();
1617                 }
1618                 SetValue(MaximumSizeProperty, value);
1619                 NotifyPropertyChanged();
1620             }
1621         }
1622
1623         /// <summary>
1624         /// Gets or sets whether a child view inherits it's parent's position.<br />
1625         /// Default is to inherit.<br />
1626         /// 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 />
1627         /// </summary>
1628         /// <since_tizen> 3 </since_tizen>
1629         public bool InheritPosition
1630         {
1631             get
1632             {
1633                 return (bool)GetValue(InheritPositionProperty);
1634             }
1635             set
1636             {
1637                 SetValue(InheritPositionProperty, value);
1638                 NotifyPropertyChanged();
1639             }
1640         }
1641
1642         /// <summary>
1643         /// Gets or sets the clipping behavior (mode) of it's children.
1644         /// </summary>
1645         /// <since_tizen> 3 </since_tizen>
1646         public ClippingModeType ClippingMode
1647         {
1648             get
1649             {
1650                 return (ClippingModeType)GetValue(ClippingModeProperty);
1651             }
1652             set
1653             {
1654                 SetValue(ClippingModeProperty, value);
1655                 NotifyPropertyChanged();
1656             }
1657         }
1658
1659         /// <summary>
1660         /// Gets the number of renderers held by the view.
1661         /// </summary>
1662         /// <since_tizen> 3 </since_tizen>
1663         public uint RendererCount
1664         {
1665             get
1666             {
1667                 return GetRendererCount();
1668             }
1669         }
1670
1671         /// <summary>
1672         /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
1673         /// </summary>
1674         /// <remarks>
1675         /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
1676         /// </remarks>
1677         /// <since_tizen> 3 </since_tizen>
1678         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
1679             "Like: " +
1680             "View view = new View(); " +
1681             "view.PivotPoint = PivotPoint.Center; " +
1682             "view.PositionUsesPivotPoint = true;")]
1683         [EditorBrowsable(EditorBrowsableState.Never)]
1684         public Position AnchorPoint
1685         {
1686             get
1687             {
1688                 Position temp = new Position(0.0f, 0.0f, 0.0f);
1689                 GetProperty(View.Property.ANCHOR_POINT).Get(temp);
1690                 return new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
1691             }
1692             set
1693             {
1694                 SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
1695                 NotifyPropertyChanged();
1696             }
1697         }
1698
1699         /// <summary>
1700         /// Sets the size of a view for the width, the height and the depth.<br />
1701         /// Geometry can be scaled to fit within this area.<br />
1702         /// This does not interfere with the view's scale factor.<br />
1703         /// The views default depth is the minimum of width and height.<br />
1704         /// </summary>
1705         /// <remarks>
1706         /// <para>
1707         /// Animatable - This property can be animated using <c>Animation</c> class.
1708         /// </para>
1709         /// The property cascade chaining set is possible. For example, this (view.Size.Width = 1.0f;) is possible.
1710         /// </remarks>
1711         /// <since_tizen> 5 </since_tizen>
1712         public Size Size
1713         {
1714             get
1715             {
1716                 Size tmp = (Size)GetValue(SizeProperty);
1717                 return new Size(OnSizeChanged, tmp.Width, tmp.Height, tmp.Depth);
1718             }
1719             set
1720             {
1721                 SetValue(SizeProperty, value);
1722                 // Set Specification so when layouts measure this View it matches the value set here.
1723                 // All Views are currently Layouts.
1724                 WidthSpecification = (int)Math.Ceiling(value.Width);
1725                 HeightSpecification = (int)Math.Ceiling(value.Height);
1726                 NotifyPropertyChanged();
1727             }
1728         }
1729
1730         /// <summary>
1731         /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
1732         /// </summary>
1733         /// <since_tizen> 3 </since_tizen>
1734         [Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
1735             "Like: " +
1736             "Container parent =  view.GetParent(); " +
1737             "View view = parent as View;")]
1738         [EditorBrowsable(EditorBrowsableState.Never)]
1739         public new View Parent
1740         {
1741             get
1742             {
1743                 View ret;
1744                 IntPtr cPtr = Interop.Actor.Actor_GetParent(swigCPtr);
1745                 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
1746                 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
1747
1748                 if (basehandle is Layer layer)
1749                 {
1750                     ret = new View(Layer.getCPtr(layer).Handle, false);
1751                     NUILog.Error("This Parent property is deprecated, shoud do not be used");
1752                 }
1753                 else
1754                 {
1755                     ret = basehandle as View;
1756                 }
1757
1758                 Interop.BaseHandle.delete_BaseHandle(CPtr);
1759                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1760
1761                 if (NDalicPINVOKE.SWIGPendingException.Pending)
1762                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1763                 return ret;
1764             }
1765         }
1766
1767         /// <summary>
1768         /// Gets/Sets whether inherit parent's the layout Direction.
1769         /// </summary>
1770         /// <since_tizen> 4 </since_tizen>
1771         public bool InheritLayoutDirection
1772         {
1773             get
1774             {
1775                 return (bool)GetValue(InheritLayoutDirectionProperty);
1776             }
1777             set
1778             {
1779                 SetValue(InheritLayoutDirectionProperty, value);
1780                 NotifyPropertyChanged();
1781             }
1782         }
1783
1784         /// <summary>
1785         /// Gets/Sets the layout Direction.
1786         /// </summary>
1787         /// <since_tizen> 4 </since_tizen>
1788         public ViewLayoutDirectionType LayoutDirection
1789         {
1790             get
1791             {
1792                 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
1793             }
1794             set
1795             {
1796                 SetValue(LayoutDirectionProperty, value);
1797                 NotifyPropertyChanged();
1798                 _layout?.RequestLayout();
1799             }
1800         }
1801
1802         /// <summary>
1803         /// Gets or sets the Margin for use in layout.
1804         /// </summary>
1805         /// <remarks>
1806         /// Margin property is supported by Layout algorithms and containers.
1807         /// Please Set Layout if you want to use Margin property.
1808         /// The property cascade chaining set is possible. For example, this (view.Margin.X = 0.1f;) is possible.
1809         /// </remarks>
1810         /// <since_tizen> 4 </since_tizen>
1811         public Extents Margin
1812         {
1813             get
1814             {
1815                 // If View has a Layout then margin is stored in Layout.
1816                 if (Layout != null)
1817                 {
1818                     return Layout.Margin;
1819                 }
1820                 else
1821                 {
1822                     // If Layout not set then return margin stored in View.
1823                     Extents temp = (Extents)GetValue(MarginProperty);
1824                     return new Extents(OnMarginChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1825                 }
1826                 // Two return points to prevent creating a zeroed Extent native object before assignment
1827             }
1828             set
1829             {
1830                 if (Layout != null)
1831                 {
1832                     // Layout set so store Margin in LayoutItem instead of View.
1833                     // If View stores the Margin too then the Legacy Size Negotiation will
1834                     // overwrite the position and size values measured in the Layouting.
1835                     Layout.Margin = value;
1836                     SetValue(MarginProperty, new Extents(0,0,0,0));
1837                     _layout?.RequestLayout();
1838                 }
1839                 else
1840                 {
1841                     SetValue(MarginProperty, value);
1842                 }
1843                 NotifyPropertyChanged();
1844                 _layout?.RequestLayout();
1845             }
1846         }
1847
1848         ///<summary>
1849         /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
1850         ///</summary>
1851         /// <since_tizen> 6 </since_tizen>
1852         public int WidthSpecification
1853         {
1854             get
1855             {
1856                 return _widthPolicy;
1857             }
1858             set
1859             {
1860                 _widthPolicy = value;
1861                 if (_widthPolicy >= 0)
1862                 {
1863                     _measureSpecificationWidth = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
1864
1865                     if(_heightPolicy>=0) // Policy an exact value
1866                     {
1867                         Size2D.Width = _widthPolicy;
1868                     }
1869                     else
1870                     {
1871                         // Store _heightPolicy in the Size2D memember as will be reset to 0 by a Size2D callback.
1872                         // Size2D height will store the specification value (negative number) this will then be applied to the
1873                         // HeightSpecification when the Size2D callback is invoked.
1874                         Size2D = new Size2D(_widthPolicy,_heightPolicy);
1875                     }
1876                 }
1877                 _layout?.RequestLayout();
1878             }
1879         }
1880
1881         ///<summary>
1882         /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
1883         ///</summary>
1884         /// <since_tizen> 6 </since_tizen>
1885         public int HeightSpecification
1886         {
1887             get
1888             {
1889                 return _heightPolicy;
1890             }
1891             set
1892             {
1893                 _heightPolicy = value;
1894                 if (_heightPolicy >= 0)
1895                 {
1896                     _measureSpecificationHeight = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
1897
1898                     if(_widthPolicy>=0) // Policy an exact value
1899                     {
1900                         Size2D.Height = _heightPolicy;
1901                     }
1902                     else
1903                     {
1904                         // Store widthPolicy in the Size2D memember as will be reset to 0 by a Size2D callback.
1905                         // Size2D height will store the specification value (negative number) this will then be applied to the
1906                         // HeightSpecification when the Size2D callback is invoked.
1907                         Size2D = new Size2D(_widthPolicy,_heightPolicy);
1908                     }
1909
1910                 }
1911                _layout?.RequestLayout();
1912             }
1913         }
1914
1915         ///<summary>
1916         /// Gets the List of transitions for this View.
1917         ///</summary>
1918         /// <since_tizen> 6 </since_tizen>
1919         public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
1920         {
1921             get
1922             {
1923                 if (_layoutTransitions == null)
1924                 {
1925                     _layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
1926                 }
1927                 return _layoutTransitions;
1928             }
1929         }
1930
1931         ///<summary>
1932         /// Set a layout transitions for this View.
1933         ///</summary>
1934         /// <remarks>
1935         /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
1936         /// </remarks>
1937         /// <since_tizen> 6 </since_tizen>
1938         public LayoutTransition LayoutTransition
1939         {
1940             set
1941             {
1942                 if (_layoutTransitions == null)
1943                 {
1944                     _layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
1945                 }
1946                 LayoutTransitionsHelper.AddTransitionForCondition(_layoutTransitions,value.Condition,value, true);
1947
1948                 AttachTransitionsToChildren(value);
1949             }
1950         }
1951
1952         /// <summary>
1953         /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
1954         /// </summary>
1955         /// <remarks>
1956         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
1957         /// </remarks>
1958         /// <since_tizen> 4 </since_tizen>
1959         [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
1960         [EditorBrowsable(EditorBrowsableState.Never)]
1961         public Extents PaddingEX
1962         {
1963             get
1964             {
1965                 Extents temp = new Extents(0, 0, 0, 0);
1966                 GetProperty(View.Property.PADDING).Get(temp);
1967                 return new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1968             }
1969             set
1970             {
1971                 SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value));
1972                 NotifyPropertyChanged();
1973                 _layout?.RequestLayout();
1974             }
1975         }
1976
1977         /// <since_tizen> 6 </since_tizen>
1978         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
1979         [EditorBrowsable(EditorBrowsableState.Never)]
1980         public Style XamlStyle
1981         {
1982             get
1983             {
1984                 return (Style)GetValue(XamlStyleProperty);
1985             }
1986             set
1987             {
1988                 SetValue(XamlStyleProperty, value);
1989             }
1990         }
1991
1992         /// <summary>
1993         /// The Color of View. This is an RGBA value.
1994         /// </summary>
1995         /// <remarks>
1996         /// <para>
1997         /// Animatable - This property can be animated using <c>Animation</c> class.
1998         /// </para>
1999         /// The property cascade chaining set is possible. For example, this (view.Color.X = 0.1f;) is possible.
2000         /// </remarks>
2001         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2002         [EditorBrowsable(EditorBrowsableState.Never)]
2003         public Color Color
2004         {
2005             get
2006             {
2007                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
2008                 GetProperty(Interop.ActorProperty.Actor_Property_COLOR_get()).Get(temp);
2009                 return new Color(OnColorChanged, temp.R, temp.G, temp.B, temp.A);
2010             }
2011             set
2012             {
2013                 SetColor(value);
2014             }
2015         }
2016
2017         /// <summary>
2018         /// Set the layout on this View. Replaces any existing Layout.
2019         /// </summary>
2020         /// <since_tizen> 6 </since_tizen>
2021         public LayoutItem Layout
2022         {
2023             get
2024             {
2025                 return _layout;
2026             }
2027             set
2028             {
2029                 // Do nothing if layout provided is already set on this View.
2030                 if (value == _layout)
2031                 {
2032                     return;
2033                 }
2034
2035                 Log.Info("NUI", "Setting Layout on:" + Name + "\n");
2036                 layoutingDisabled = false;
2037                 layoutSet = true;
2038
2039                 // If new layout being set already has a owner then that owner receives a replacement default layout.
2040                 // First check if the layout to be set already has a owner.
2041                 if (value?.Owner != null)
2042                 {
2043                     // Previous owner of the layout gets a default layout as a replacement.
2044                     value.Owner.Layout = new LayoutGroup();
2045
2046                     // Copy Margin and Padding to replacement LayoutGroup.
2047                     value.Owner.Layout.Margin = value.Margin;
2048                     value.Owner.Layout.Padding = value.Padding;
2049                 }
2050
2051                 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2052                 // View if no replacement. Previously margin and padding values would have been moved from
2053                 // the View to the layout.
2054                 if (_layout != null ) // Existing layout
2055                 {
2056                     if (value != null)
2057                     {
2058                         // Existing layout being replaced so copy over margin and padding values.
2059                         value.Margin = _layout.Margin;
2060                         value.Padding = _layout.Padding;
2061                     }
2062                     else
2063                     {
2064                       // Layout not being replaced so restore margin and padding to View.
2065                       SetValue(MarginProperty, _layout.Margin);
2066                       SetValue(PaddingProperty, _layout.Padding);
2067                       NotifyPropertyChanged();
2068                     }
2069                 }
2070                 else
2071                 {
2072                     // First Layout to be added to the View hence copy
2073
2074                     // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2075                     if (value !=null)
2076                     {
2077                         if (Margin.Top != 0 || Margin.Bottom !=0 || Margin.Start !=0 || Margin.End != 0)
2078                         {
2079                             // If View already has a margin set then store it in Layout instead.
2080                             value.Margin = Margin;
2081                             SetValue(MarginProperty, new Extents(0,0,0,0));
2082                             NotifyPropertyChanged();
2083                         }
2084
2085                         if (Padding.Top != 0 || Padding.Bottom !=0 || Padding.Start !=0 || Padding.End != 0)
2086                         {
2087                             // If View already has a padding set then store it in Layout instead.
2088                             value.Padding = Padding;
2089                             SetValue(PaddingProperty, new Extents(0,0,0,0));
2090                             NotifyPropertyChanged();
2091                         }
2092                     }
2093                 }
2094
2095                 // Remove existing layout from it's parent layout group.
2096                 _layout?.Unparent();
2097
2098                 // Set layout to this view
2099                 SetLayout(value);
2100             }
2101         }
2102
2103         /// <summary>
2104         /// The weight of the View, used to share available space in a layout with siblings.
2105         /// </summary>
2106         /// <since_tizen> 6 </since_tizen>
2107         public float Weight
2108         {
2109             get
2110             {
2111                 return _weight;
2112             }
2113             set
2114             {
2115                 _weight = value;
2116                 _layout?.RequestLayout();
2117             }
2118         }
2119
2120         /// <summary>
2121         ///  Whether to load the BackgroundImage synchronously.
2122         ///  If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2123         ///  Note: For Normal Quad images only.
2124         /// </summary>
2125         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2126         [EditorBrowsable(EditorBrowsableState.Never)]
2127         public bool BackgroundImageSynchronosLoading
2128         {
2129             get
2130             {
2131                 return _backgroundImageSynchronosLoading;
2132             }
2133             set
2134             {
2135                 _backgroundImageSynchronosLoading = value;
2136                 string bgUrl = "";
2137                 int visualType = 0;
2138                 Background.Find(Visual.Property.Type)?.Get(out visualType);
2139                 if (visualType == (int)Visual.Type.Image)
2140                 {
2141                     Background.Find(ImageVisualProperty.URL)?.Get(out bgUrl);
2142                 }
2143
2144                 if (bgUrl.Length != 0)
2145                 {
2146                     PropertyMap bgMap = this.Background;
2147                     bgMap.Add("synchronousLoading", new PropertyValue(_backgroundImageSynchronosLoading));
2148                     Background = bgMap;
2149                 }
2150             }
2151         }
2152
2153         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2154         [EditorBrowsable(EditorBrowsableState.Never)]
2155         public Vector2 UpdateSizeHint
2156         {
2157             get
2158             {
2159                 return (Vector2)GetValue(UpdateSizeHintProperty);
2160             }
2161             set
2162             {
2163                 SetValue(UpdateSizeHintProperty, value);
2164                 NotifyPropertyChanged();
2165             }
2166         }
2167
2168         /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
2169         [EditorBrowsable(EditorBrowsableState.Never)]
2170         public string[] TransitionNames
2171         {
2172             get
2173             {
2174                 return transitionNames;
2175             }
2176             set
2177             {
2178                 transitionNames = value;
2179                 LoadTransitions();
2180             }
2181         }
2182
2183         /// <summary>
2184         /// Get Style, it is abstract function and must be override.
2185         /// </summary>
2186         /// <since_tizen> 6 </since_tizen>
2187         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2188         [EditorBrowsable(EditorBrowsableState.Never)]
2189         protected virtual ViewStyle GetViewStyle()
2190         {
2191             viewStyle = new ViewStyle();
2192             return viewStyle;
2193         }
2194
2195         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2196         [EditorBrowsable(EditorBrowsableState.Never)]
2197         protected virtual bool OnControlStateChanged(ControlStates currentState)
2198         {
2199             //If need to apply the state to all child, return true;
2200             return true;
2201         }
2202         internal static readonly BindableProperty BackgroundImageSelectorProperty = BindableProperty.Create("BackgroundImageSelector", typeof(Selector<string>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2203         {
2204             var view = (View)bindable;
2205             view.backgroundImageSelector.Clone((Selector<string>)newValue);
2206         },
2207         defaultValueCreator: (bindable) =>
2208         {
2209             var view = (View)bindable;
2210             return view.backgroundImageSelector;
2211         });
2212         private TriggerableSelector<string> _backgroundImageSelector;
2213         private TriggerableSelector<string> backgroundImageSelector
2214         {
2215             get
2216             {
2217                 if (null == _backgroundImageSelector)
2218                 {
2219                     _backgroundImageSelector = new TriggerableSelector<string>(this, BackgroundImageProperty);
2220                 }
2221                 return _backgroundImageSelector;
2222             }
2223         }
2224         internal static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector<Color>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2225         {
2226             var view = (View)bindable;
2227             view.backgroundColorSelector.Clone((Selector<Color>)newValue);
2228         },
2229         defaultValueCreator: (bindable) =>
2230         {
2231             var view = (View)bindable;
2232             return view.backgroundColorSelector;
2233         });
2234         private TriggerableSelector<Color> _backgroundColorSelector;
2235         private TriggerableSelector<Color> backgroundColorSelector
2236         {
2237             get
2238             {
2239                 if (null == _backgroundColorSelector)
2240                 {
2241                     _backgroundColorSelector = new TriggerableSelector<Color>(this, BackgroundColorProperty);
2242                 }
2243                 return _backgroundColorSelector;
2244             }
2245         }
2246         internal static readonly BindableProperty BackgroundImageBorderSelectorProperty = BindableProperty.Create("BackgroundImageBorderSelector", typeof(Selector<Rectangle>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2247         {
2248             var view = (View)bindable;
2249             view.backgroundImageBorderSelector.Clone((Selector<Rectangle>)newValue);
2250         },
2251         defaultValueCreator: (bindable) =>
2252         {
2253             var view = (View)bindable;
2254             return view.backgroundImageBorderSelector;
2255         });
2256         private TriggerableSelector<Rectangle> _backgroundImageBorderSelector;
2257         private TriggerableSelector<Rectangle> backgroundImageBorderSelector
2258         {
2259             get
2260             {
2261                 if (null == _backgroundImageBorderSelector)
2262                 {
2263                     _backgroundImageBorderSelector = new TriggerableSelector<Rectangle>(this, BackgroundImageBorderProperty);
2264                 }
2265                 return _backgroundImageBorderSelector;
2266             }
2267         }
2268         internal static readonly BindableProperty OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector<float?>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2269         {
2270             var view = (View)bindable;
2271             view.opacitySelector.Clone((Selector<float?>)newValue);
2272         },
2273         defaultValueCreator: (bindable) =>
2274         {
2275             var view = (View)bindable;
2276             return view.opacitySelector;
2277         });
2278         private TriggerableSelector<float?> _opacitySelector;
2279         private TriggerableSelector<float?> opacitySelector
2280         {
2281             get
2282             {
2283                 if (null == _opacitySelector)
2284                 {
2285                     _opacitySelector = new TriggerableSelector<float?>(this, OpacityProperty);
2286                 }
2287                 return _opacitySelector;
2288             }
2289         }
2290
2291         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2292         [EditorBrowsable(EditorBrowsableState.Never)]
2293         public virtual void ApplyStyle(ViewStyle viewStyle)
2294         {
2295             if (null == viewStyle)
2296             {
2297                 return;
2298             }
2299
2300             if (this.viewStyle == viewStyle)
2301             {
2302                 return;
2303             }
2304
2305             if (null != this.viewStyle)
2306             {
2307                 simpleBinding.Clear();
2308             }
2309
2310             this.viewStyle = viewStyle;
2311
2312             Dictionary<string, BindableProperty> bindablePropertyOfView;
2313             Type viewType = GetType();
2314
2315             Dictionary<string, BindableProperty> bindablePropertyOfStyle;
2316             Type styleType = viewStyle.GetType();
2317
2318             BindableProperty.GetBindablePropertysOfType(viewType, out bindablePropertyOfView);
2319             BindableProperty.GetBindablePropertysOfType(styleType, out bindablePropertyOfStyle);
2320
2321             if (null != bindablePropertyOfView && null != bindablePropertyOfStyle)
2322             {
2323                 foreach (KeyValuePair<string, BindableProperty> keyValuePair in bindablePropertyOfStyle)
2324                 {
2325                     BindableProperty viewProperty;
2326                     bindablePropertyOfView.TryGetValue(keyValuePair.Key, out viewProperty);
2327
2328                     if (null != viewProperty)
2329                     {
2330                         object value = viewStyle.GetValue(keyValuePair.Value);
2331
2332                         if (null != value)
2333                         {
2334                             SetValue(viewProperty, value);
2335                         }
2336
2337                         simpleBinding.Bind(viewStyle, keyValuePair.Value, this, viewProperty, BindingDirection.TwoWay);
2338                     }
2339                 }
2340             }
2341         }
2342
2343         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2344         [EditorBrowsable(EditorBrowsableState.Never)]
2345         private BundledPipe simpleBinding = new BundledPipe();
2346     }
2347 }