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