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