Add FloatGraphicsTypeConverter and support converter in PixelSize in Text.
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / View.cs
1 /*
2  * Copyright(c) 2021 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
23 namespace Tizen.NUI.BaseComponents
24 {
25     /// <summary>
26     /// View is the base class for all views.
27     /// </summary>
28     /// <since_tizen> 3 </since_tizen>
29     public partial class View : Container, IResourcesProvider
30     {
31         private static HashSet<BindableProperty> positionPropertyGroup = new HashSet<BindableProperty>();
32         private static HashSet<BindableProperty> sizePropertyGroup = new HashSet<BindableProperty>();
33         private static HashSet<BindableProperty> scalePropertyGroup = new HashSet<BindableProperty>();
34
35         internal BackgroundExtraData backgroundExtraData;
36
37         private bool layoutSet = false;
38         private LayoutItem layout; // Exclusive layout assigned to this View.
39
40         // List of transitions paired with the condition that uses the transition.
41         private Dictionary<TransitionCondition, TransitionList> layoutTransitions;
42         private int widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
43         private int heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
44         private float weight = 0.0f; // Weighting of child View in a Layout
45         private bool backgroundImageSynchronousLoading = false;
46         private bool excludeLayouting = false;
47         private LayoutTransition layoutTransition;
48         private TransitionOptions transitionOptions = null;
49         private ThemeData themeData;
50
51         // List of constraints
52         private Constraint widthConstraint = null;
53         private Constraint heightConstraint = null;
54
55         private Size2D internalMaximumSize = null;
56         private Size2D internalMinimumSize = null;
57         private Extents internalMargin = null;
58         private Extents internalPadding = null;
59         private Vector3 internalSizeModeFactor = null;
60         private Vector2 internalCellIndex = null;
61         private Color internalBackgroundColor = null;
62         private Color internalColor = null;
63         private Position internalPivotPoint = null;
64         private Position internalPosition = null;
65         private Position2D internalPosition2D = null;
66         private Vector3 internalScale = null;
67         private Size internalSize = null;
68         private Size2D internalSize2D = null;
69         private int layoutCount = 0;
70
71         static View()
72         {
73             RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
74             RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
75             RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
76             RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
77
78             RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
79             RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
80             RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
81             RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
82
83             RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
84             RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
85             RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
86             RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
87         }
88
89         /// <summary>
90         /// Creates a new instance of a view.
91         /// </summary>
92         /// <since_tizen> 3 </since_tizen>
93         public View() : this(Interop.View.New(), true)
94         {
95             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
96         }
97
98         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
99         [EditorBrowsable(EditorBrowsableState.Never)]
100         public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
101         {
102         }
103
104         /// <summary>
105         /// Create a new instance of a View with setting the status of shown or hidden.
106         /// </summary>
107         /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
108         /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
109         [EditorBrowsable(EditorBrowsableState.Never)]
110         public View(bool shown) : this(Interop.View.New(), true)
111         {
112             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113             SetVisible(shown);
114         }
115
116         internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
117         {
118             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119             if (!shown)
120             {
121                 SetVisible(false);
122             }
123
124             backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
125         }
126
127         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
128         {
129             InitializeStyle(viewStyle);
130         }
131
132         internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
133         {
134             if (HasBody())
135             {
136                 PositionUsesPivotPoint = false;
137             }
138
139             onWindowSendEventCallback = SendViewAddedEventToWindow;
140             using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
141             signal?.Connect(onWindowSendEventCallback);
142
143             if (!shown)
144             {
145                 SetVisible(false);
146             }
147         }
148
149         internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
150         {
151             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
152
153             if (!shown)
154             {
155                 SetVisible(false);
156             }
157         }
158
159         /// <summary>
160         /// The event that is triggered when the View's ControlState is changed.
161         /// </summary>
162         [EditorBrowsable(EditorBrowsableState.Never)]
163         public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
164
165         internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
166
167
168         /// <summary>
169         /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
170         /// </summary>
171         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
172         [EditorBrowsable(EditorBrowsableState.Never)]
173         public bool LayoutSet
174         {
175             get
176             {
177                 return layoutSet;
178             }
179         }
180
181         /// <summary>
182         /// Flag to allow Layouting to be disabled for Views.
183         /// Once a View has a Layout set then any children added to Views from then on will receive
184         /// automatic Layouts.
185         /// </summary>
186         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
187         [EditorBrowsable(EditorBrowsableState.Never)]
188         public static bool LayoutingDisabled { get; set; } = true;
189
190         /// <summary>
191         /// Deprecate. Please do not use this.
192         /// The style instance applied to this view.
193         /// Note that please do not modify the ViewStyle.
194         /// Modifying ViewStyle will affect other views with same ViewStyle.
195         /// </summary>
196         [EditorBrowsable(EditorBrowsableState.Never)]
197         protected ViewStyle ViewStyle
198         {
199             get
200             {
201                 if (themeData == null) themeData = new ThemeData();
202
203                 if (themeData.viewStyle == null)
204                 {
205                     ApplyStyle(CreateViewStyle());
206                 }
207                 return themeData.viewStyle;
208             }
209         }
210
211         /// <summary>
212         /// Get/Set the control state.
213         /// Note that the ControlState only available for the classes derived from Control.
214         /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
215         /// please set <see cref="EnableControlState"/> to true.
216         /// </summary>
217         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
218         [EditorBrowsable(EditorBrowsableState.Never)]
219         public ControlState ControlState
220         {
221             get
222             {
223                 return themeData == null ? ControlState.Normal : themeData.controlStates;
224             }
225             protected set
226             {
227                 if (ControlState == value)
228                 {
229                     return;
230                 }
231
232                 var prevState = ControlState;
233
234                 if (themeData == null) themeData = new ThemeData();
235                 themeData.controlStates = value;
236
237                 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
238
239                 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
240
241                 if (themeData.ControlStatePropagation)
242                 {
243                     foreach (View child in Children)
244                     {
245                         child.ControlState = value;
246                     }
247                 }
248
249                 OnControlStateChanged(changeInfo);
250
251                 ControlStateChangedEvent?.Invoke(this, changeInfo);
252             }
253         }
254
255         /// <summary>
256         /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
257         /// </summary>
258         /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
259         [EditorBrowsable(EditorBrowsableState.Never)]
260         public bool ExcludeLayouting
261         {
262             get
263             {
264                 return (bool)GetValue(ExcludeLayoutingProperty);
265             }
266             set
267             {
268                 SetValue(ExcludeLayoutingProperty, value);
269                 NotifyPropertyChanged();
270             }
271         }
272
273         private bool InternalExcludeLayouting
274         {
275             get
276             {
277                 return excludeLayouting;
278             }
279             set
280             {
281                 excludeLayouting = value;
282                 if (Layout != null && Layout.SetPositionByLayout == value)
283                 {
284                     Layout.SetPositionByLayout = !value;
285                     Layout.RequestLayout();
286                 }
287             }
288         }
289
290         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
291         [EditorBrowsable(EditorBrowsableState.Never)]
292         public bool IsResourcesCreated
293         {
294             get
295             {
296                 return Application.Current.IsResourcesCreated;
297             }
298         }
299
300         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
301         [EditorBrowsable(EditorBrowsableState.Never)]
302         public ResourceDictionary XamlResources
303         {
304             get
305             {
306                 return Application.Current.XamlResources;
307             }
308             set
309             {
310                 Application.Current.XamlResources = value;
311             }
312         }
313
314         /// <summary>
315         /// The StyleName, type string.
316         /// The value indicates DALi style name defined in json theme file.
317         /// </summary>
318         /// <since_tizen> 3 </since_tizen>
319         public string StyleName
320         {
321             get
322             {
323                 return (string)GetValue(StyleNameProperty);
324             }
325             set
326             {
327                 SetValue(StyleNameProperty, value);
328                 NotifyPropertyChanged();
329             }
330         }
331
332         /// <summary>
333         /// The KeyInputFocus, type bool.
334         /// </summary>
335         [EditorBrowsable(EditorBrowsableState.Never)]
336         public bool KeyInputFocus
337         {
338             get
339             {
340                 return (bool)GetValue(KeyInputFocusProperty);
341             }
342             set
343             {
344                 SetValue(KeyInputFocusProperty, value);
345                 NotifyPropertyChanged();
346             }
347         }
348
349         /// <summary>
350         /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
351         /// </summary>
352         /// <remarks>
353         /// <para>
354         /// The property cascade chaining set is not recommended.
355         /// </para>
356         /// <para>
357         /// Animatable - This property can be animated using <c>Animation</c> class.
358         /// <code>
359         /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
360         /// </code>
361         /// </para>
362         /// </remarks>
363         /// <example>
364         /// This way is recommended for setting the property
365         /// <code>
366         /// var view = new View();
367         /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
368         /// </code>
369         /// This way to set the property is prohibited
370         /// <code>
371         /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
372         /// </code>
373         /// </example>
374         /// <since_tizen> 3 </since_tizen>
375         public Color BackgroundColor
376         {
377             get
378             {
379                 return (Color)GetValue(BackgroundColorProperty);
380             }
381             set
382             {
383                 SetValue(BackgroundColorProperty, value);
384                 NotifyPropertyChanged();
385             }
386         }
387
388         /// <summary>
389         /// The mutually exclusive with "backgroundColor" and "background" type Map.
390         /// </summary>
391         /// <since_tizen> 3 </since_tizen>
392         public string BackgroundImage
393         {
394             get
395             {
396                 return (string)GetValue(BackgroundImageProperty);
397             }
398             set
399             {
400                 SetValue(BackgroundImageProperty, value);
401                 NotifyPropertyChanged();
402             }
403         }
404
405         /// <summary>
406         /// Get or set the border of background image.
407         /// </summary>
408         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
409         [EditorBrowsable(EditorBrowsableState.Never)]
410         public Rectangle BackgroundImageBorder
411         {
412             get
413             {
414                 return (Rectangle)GetValue(BackgroundImageBorderProperty);
415             }
416             set
417             {
418                 SetValue(BackgroundImageBorderProperty, value);
419                 NotifyPropertyChanged();
420             }
421         }
422
423         /// <summary>
424         /// The background of view.
425         /// </summary>
426         /// <since_tizen> 3 </since_tizen>
427         public Tizen.NUI.PropertyMap Background
428         {
429             get
430             {
431                 return (PropertyMap)GetValue(BackgroundProperty);
432             }
433             set
434             {
435                 SetValue(BackgroundProperty, value);
436                 NotifyPropertyChanged();
437             }
438         }
439
440         /// <summary>
441         /// Describes a shadow as an image for a View.
442         /// It is null by default.
443         /// </summary>
444         /// <remarks>
445         /// Getter returns copied instance of current shadow.
446         /// </remarks>
447         /// <remarks>
448         /// The mutually exclusive with "BoxShadow".
449         /// </remarks>
450         /// <remarks>
451         /// <para>
452         /// Animatable - This property can be animated using <c>Animation</c> class.
453         /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
454         /// <code>
455         /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
456         /// </code>
457         /// Animatable sub-property : Offset.
458         /// </para>
459         /// </remarks>
460         [EditorBrowsable(EditorBrowsableState.Never)]
461         public ImageShadow ImageShadow
462         {
463             get
464             {
465                 return (ImageShadow)GetValue(ImageShadowProperty);
466             }
467             set
468             {
469                 SetValue(ImageShadowProperty, value);
470                 NotifyPropertyChanged();
471             }
472         }
473
474         /// <summary>
475         /// Describes a box shaped shadow drawing for a View.
476         /// It is null by default.
477         /// </summary>
478         /// <remarks>
479         /// The mutually exclusive with "ImageShadow".
480         /// </remarks>
481         /// <remarks>
482         /// <para>
483         /// Animatable - This property can be animated using <c>Animation</c> class.
484         /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
485         /// <code>
486         /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
487         /// </code>
488         /// Animatable sub-property : Offset, Color, BlurRadius.
489         /// </para>
490         /// </remarks>
491         /// <since_tizen> 9 </since_tizen>
492         public Shadow BoxShadow
493         {
494             get
495             {
496                 return (Shadow)GetValue(BoxShadowProperty);
497             }
498             set
499             {
500                 SetValue(BoxShadowProperty, value);
501                 NotifyPropertyChanged();
502             }
503         }
504
505         /// <summary>
506         /// The radius for the rounded corners of the View.
507         /// This will rounds background and shadow edges.
508         /// The values in Vector4 are used in clockwise order from top-left to bottom-left : Vector4(top-left-corner, top-right-corner, bottom-right-corner, bottom-left-corner).
509         /// Each radius will clamp internally to the half of smaller of the view's width or height.
510         /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
511         /// </summary>
512         /// <remarks>
513         /// <para>
514         /// Animatable - This property can be animated using <c>Animation</c> class.
515         /// <code>
516         /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
517         /// </code>
518         /// </para>
519         /// </remarks>
520         /// <since_tizen> 9 </since_tizen>
521         public Vector4 CornerRadius
522         {
523             get
524             {
525                 return (Vector4)GetValue(CornerRadiusProperty);
526             }
527             set
528             {
529                 SetValue(CornerRadiusProperty, value);
530                 NotifyPropertyChanged();
531             }
532         }
533
534         /// <summary>
535         /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
536         /// It is absolute by default.
537         /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
538         /// </summary>
539         /// <since_tizen> 9 </since_tizen>
540         public VisualTransformPolicyType CornerRadiusPolicy
541         {
542             get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
543             set => SetValue(CornerRadiusPolicyProperty, value);
544         }
545
546         /// <summary>
547         /// The width for the borderline of the View.
548         /// </summary>
549         /// <remarks>
550         /// <para>
551         /// Animatable - This property can be animated using <c>Animation</c> class.
552         /// <code>
553         /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
554         /// </code>
555         /// </para>
556         /// Note that, an image background may not have borderline if it uses the Border property.
557         /// </remarks>
558         /// <since_tizen> 9 </since_tizen>
559         public float BorderlineWidth
560         {
561             get
562             {
563                 return (float)GetValue(BorderlineWidthProperty);
564             }
565             set
566             {
567                 SetValue(BorderlineWidthProperty, value);
568                 NotifyPropertyChanged();
569             }
570         }
571
572         /// <summary>
573         /// The color for the borderline of the View.
574         /// It is Color.Black by default.
575         /// </summary>
576         /// <remarks>
577         /// <para>
578         /// Animatable - This property can be animated using <c>Animation</c> class.
579         /// <code>
580         /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
581         /// </code>
582         /// </para>
583         /// </remarks>
584         /// <since_tizen> 9 </since_tizen>
585         public Color BorderlineColor
586         {
587             get
588             {
589                 return (Color)GetValue(BorderlineColorProperty);
590             }
591             set
592             {
593                 SetValue(BorderlineColorProperty, value);
594                 NotifyPropertyChanged();
595             }
596         }
597
598         /// <summary>
599         /// The Relative offset for the borderline of the View.
600         /// Recommended range : [-1.0f to 1.0f].
601         /// If -1.0f, draw borderline inside of the View.
602         /// If 1.0f, draw borderline outside of the View.
603         /// If 0.0f, draw borderline half inside and half outside.
604         /// It is 0.0f by default.
605         /// </summary>
606         /// <remarks>
607         /// <para>
608         /// Animatable - This property can be animated using <c>Animation</c> class.
609         /// <code>
610         /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
611         /// </code>
612         /// </para>
613         /// </remarks>
614         /// <since_tizen> 9 </since_tizen>
615         public float BorderlineOffset
616         {
617             get
618             {
619                 return (float)GetValue(BorderlineOffsetProperty);
620             }
621             set
622             {
623                 SetValue(BorderlineOffsetProperty, value);
624                 NotifyPropertyChanged();
625             }
626         }
627
628         /// <summary>
629         /// The current state of the view.
630         /// </summary>
631         /// <since_tizen> 3 </since_tizen>
632         public States State
633         {
634             get
635             {
636                 return (States)GetValue(StateProperty);
637             }
638             set
639             {
640                 SetValue(StateProperty, value);
641                 NotifyPropertyChanged();
642             }
643         }
644
645         /// <summary>
646         /// The current sub state of the view.
647         /// </summary>
648         /// <since_tizen> 3 </since_tizen>
649         public States SubState
650         {
651             get
652             {
653                 return (States)GetValue(SubStateProperty);
654             }
655             set
656             {
657                 SetValue(SubStateProperty, value);
658                 NotifyPropertyChanged();
659             }
660         }
661
662         /// <summary>
663         /// Displays a tooltip
664         /// </summary>
665         /// <since_tizen> 3 </since_tizen>
666         public Tizen.NUI.PropertyMap Tooltip
667         {
668             get
669             {
670                 return (PropertyMap)GetValue(TooltipProperty);
671             }
672             set
673             {
674                 SetValue(TooltipProperty, value);
675                 NotifyPropertyChanged();
676             }
677         }
678
679         /// <summary>
680         /// Displays a tooltip as a text.
681         /// </summary>
682         /// <since_tizen> 3 </since_tizen>
683         public string TooltipText
684         {
685             get
686             {
687                 return GetValue(TooltipTextProperty) as string;
688             }
689             set
690             {
691                 SetValue(TooltipTextProperty, value);
692             }
693         }
694
695         private string InternalTooltipText
696         {
697             get
698             {
699                 using (var propertyValue = GetProperty(Property.TOOLTIP))
700                 {
701                     if (propertyValue != null && propertyValue.Get(out string retrivedValue))
702                     {
703                         return retrivedValue;
704                     }
705                     NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
706                     return "error to get TooltipText";
707                 }
708             }
709             set
710             {
711                 var temp = new Tizen.NUI.PropertyValue(value);
712                 SetProperty(View.Property.TOOLTIP, temp);
713                 temp.Dispose();
714                 NotifyPropertyChanged();
715             }
716         }
717
718         /// <summary>
719         /// The Child property of FlexContainer.<br />
720         /// The proportion of the free space in the container, the flex item will receive.<br />
721         /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
722         /// </summary>
723         /// <since_tizen> 3 </since_tizen>
724         [Obsolete("Deprecated in API8, will be removed in API10.")]
725         public float Flex
726         {
727             get
728             {
729                 return (float)GetValue(FlexProperty);
730             }
731             set
732             {
733                 SetValue(FlexProperty, value);
734                 NotifyPropertyChanged();
735             }
736         }
737
738         /// <summary>
739         /// The Child property of FlexContainer.<br />
740         /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
741         /// </summary>
742         /// <since_tizen> 3 </since_tizen>
743         [Obsolete("Deprecated in API8, will be removed in API10.")]
744         public int AlignSelf
745         {
746             get
747             {
748                 return (int)GetValue(AlignSelfProperty);
749             }
750             set
751             {
752                 SetValue(AlignSelfProperty, value);
753                 NotifyPropertyChanged();
754             }
755         }
756
757         /// <summary>
758         /// The Child property of FlexContainer.<br />
759         /// The space around the flex item.<br />
760         /// </summary>
761         /// <remarks>
762         /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
763         /// </remarks>
764         /// <since_tizen> 3 </since_tizen>
765         [Obsolete("Deprecated in API8, will be removed in API10.")]
766         public Vector4 FlexMargin
767         {
768             get
769             {
770                 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
771                 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
772             }
773             set
774             {
775                 SetValue(FlexMarginProperty, value);
776                 NotifyPropertyChanged();
777             }
778         }
779
780         /// <summary>
781         /// The top-left cell this child occupies, if not set, the first available cell is used.
782         /// </summary>
783         /// <remarks>
784         /// The property cascade chaining set is not recommended.
785         /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
786         /// </remarks>
787         /// <example>
788         /// This way is recommended for setting the property
789         /// <code>
790         /// var view = new View();
791         /// view.CellIndex = new Vector2(1, 3);
792         /// </code>
793         /// This way to set the property is prohibited
794         /// <code>
795         /// view.CellIndex.X = 1; //This does not guarantee a proper operation
796         /// </code>
797         /// </example>
798         /// <since_tizen> 3 </since_tizen>
799         public Vector2 CellIndex
800         {
801             get
802             {
803                 return (Vector2)GetValue(CellIndexProperty);
804             }
805             set
806             {
807                 SetValue(CellIndexProperty, value);
808                 NotifyPropertyChanged();
809             }
810         }
811
812         /// <summary>
813         /// The number of rows this child occupies, if not set, the default value is 1.
814         /// </summary>
815         /// <remarks>
816         /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
817         /// </remarks>
818         /// <since_tizen> 3 </since_tizen>
819         public float RowSpan
820         {
821             get
822             {
823                 return (float)GetValue(RowSpanProperty);
824             }
825             set
826             {
827                 SetValue(RowSpanProperty, value);
828                 NotifyPropertyChanged();
829             }
830         }
831
832         /// <summary>
833         /// The number of columns this child occupies, if not set, the default value is 1.
834         /// </summary>
835         /// <remarks>
836         /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
837         /// </remarks>
838         /// <since_tizen> 3 </since_tizen>
839         public float ColumnSpan
840         {
841             get
842             {
843                 return (float)GetValue(ColumnSpanProperty);
844             }
845             set
846             {
847                 SetValue(ColumnSpanProperty, value);
848                 NotifyPropertyChanged();
849             }
850         }
851
852         /// <summary>
853         /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
854         /// </summary>
855         /// <remarks>
856         /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
857         /// </remarks>
858         /// <since_tizen> 3 </since_tizen>
859         public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
860         {
861             get
862             {
863                 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
864             }
865             set
866             {
867                 SetValue(CellHorizontalAlignmentProperty, value);
868                 NotifyPropertyChanged();
869             }
870         }
871
872         /// <summary>
873         /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
874         /// </summary>
875         /// <remarks>
876         /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
877         /// </remarks>
878         /// <since_tizen> 3 </since_tizen>
879         public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
880         {
881             get
882             {
883                 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
884             }
885             set
886             {
887                 SetValue(CellVerticalAlignmentProperty, value);
888                 NotifyPropertyChanged();
889             }
890         }
891
892         /// <summary>
893         /// The left focusable view.<br />
894         /// This will return null if not set.<br />
895         /// This will also return null if the specified left focusable view is not on a window.<br />
896         /// </summary>
897         /// <since_tizen> 3 </since_tizen>
898         public View LeftFocusableView
899         {
900             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
901             get
902             {
903                 return (View)GetValue(LeftFocusableViewProperty);
904             }
905             set
906             {
907                 SetValue(LeftFocusableViewProperty, value);
908                 NotifyPropertyChanged();
909             }
910         }
911
912         /// <summary>
913         /// The right focusable view.<br />
914         /// This will return null if not set.<br />
915         /// This will also return null if the specified right focusable view is not on a window.<br />
916         /// </summary>
917         /// <since_tizen> 3 </since_tizen>
918         public View RightFocusableView
919         {
920             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
921             get
922             {
923                 return (View)GetValue(RightFocusableViewProperty);
924             }
925             set
926             {
927                 SetValue(RightFocusableViewProperty, value);
928                 NotifyPropertyChanged();
929             }
930         }
931
932         /// <summary>
933         /// The up focusable view.<br />
934         /// This will return null if not set.<br />
935         /// This will also return null if the specified up focusable view is not on a window.<br />
936         /// </summary>
937         /// <since_tizen> 3 </since_tizen>
938         public View UpFocusableView
939         {
940             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
941             get
942             {
943                 return (View)GetValue(UpFocusableViewProperty);
944             }
945             set
946             {
947                 SetValue(UpFocusableViewProperty, value);
948                 NotifyPropertyChanged();
949             }
950         }
951
952         /// <summary>
953         /// The down focusable view.<br />
954         /// This will return null if not set.<br />
955         /// This will also return null if the specified down focusable view is not on a window.<br />
956         /// </summary>
957         /// <since_tizen> 3 </since_tizen>
958         public View DownFocusableView
959         {
960             // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
961             get
962             {
963                 return (View)GetValue(DownFocusableViewProperty);
964             }
965             set
966             {
967                 SetValue(DownFocusableViewProperty, value);
968                 NotifyPropertyChanged();
969             }
970         }
971
972         /// <summary>
973         /// Whether the view should be focusable by keyboard navigation.
974         /// </summary>
975         /// <since_tizen> 3 </since_tizen>
976         public bool Focusable
977         {
978             set
979             {
980                 SetValue(FocusableProperty, value);
981                 NotifyPropertyChanged();
982             }
983             get
984             {
985                 return (bool)GetValue(FocusableProperty);
986             }
987         }
988
989         /// <summary>
990         /// Whether the children of this view can be focusable by keyboard navigation. If user sets this to false, the children of this actor view will not be focused.
991         /// Note : Default value is true.
992         /// </summary>
993         [EditorBrowsable(EditorBrowsableState.Never)]
994         public bool FocusableChildren
995         {
996             set
997             {
998                 SetValue(FocusableChildrenProperty, value);
999                 NotifyPropertyChanged();
1000             }
1001             get
1002             {
1003                 return (bool)GetValue(FocusableChildrenProperty);
1004             }
1005         }
1006
1007         /// <summary>
1008         /// Whether this view can focus by touch.
1009         /// If Focusable is false, FocusableInTouch is disabled.
1010         /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1011         /// </summary>
1012         [EditorBrowsable(EditorBrowsableState.Never)]
1013         public bool FocusableInTouch
1014         {
1015             set
1016             {
1017                 SetValue(FocusableInTouchProperty, value);
1018                 NotifyPropertyChanged();
1019             }
1020             get
1021             {
1022                 return (bool)GetValue(FocusableInTouchProperty);
1023             }
1024         }
1025
1026         /// <summary>
1027         ///  Retrieves the position of the view.<br />
1028         ///  The coordinates are relative to the view's parent.<br />
1029         /// </summary>
1030         /// <since_tizen> 3 </since_tizen>
1031         public Position CurrentPosition
1032         {
1033             get
1034             {
1035                 return GetCurrentPosition();
1036             }
1037         }
1038
1039         /// <summary>
1040         /// Sets the size of a view for the width and the height.<br />
1041         /// Geometry can be scaled to fit within this area.<br />
1042         /// This does not interfere with the view's scale factor.<br />
1043         /// The views default depth is the minimum of width and height.<br />
1044         /// </summary>
1045         /// <remarks>
1046         /// The property cascade chaining set is not recommended.
1047         /// </remarks>
1048         /// <example>
1049         /// This way is recommended for setting the property
1050         /// <code>
1051         /// var view = new View();
1052         /// view.Size2D = new Size2D(100, 200);
1053         /// </code>
1054         /// This way to set the property is prohibited
1055         /// <code>
1056         /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1057         /// </code>
1058         /// </example>
1059         /// <since_tizen> 3 </since_tizen>
1060         public Size2D Size2D
1061         {
1062             get
1063             {
1064                 var temp = (Size2D)GetValue(Size2DProperty);
1065
1066                 if (this.Layout == null)
1067                 {
1068                     if (temp.Width < 0) { temp.Width = 0; }
1069                     if (temp.Height < 0) { temp.Height = 0; }
1070                 }
1071
1072                 return temp;
1073             }
1074             set
1075             {
1076                 SetValue(Size2DProperty, value);
1077
1078                 NotifyPropertyChanged();
1079             }
1080         }
1081
1082         /// <summary>
1083         ///  Retrieves the size of the view.<br />
1084         ///  The coordinates are relative to the view's parent.<br />
1085         /// </summary>
1086         /// <since_tizen> 3 </since_tizen>
1087         public Size2D CurrentSize
1088         {
1089             get
1090             {
1091                 return GetCurrentSize();
1092             }
1093         }
1094
1095         /// <summary>
1096         /// Retrieves and sets the view's opacity.<br />
1097         /// </summary>
1098         /// <remarks>
1099         /// <para>
1100         /// Animatable - This property can be animated using <c>Animation</c> class.
1101         /// <code>
1102         /// animation.AnimateTo(view, "Opacity", 0.5f);
1103         /// </code>
1104         /// </para>
1105         /// </remarks>
1106         /// <since_tizen> 3 </since_tizen>
1107         public float Opacity
1108         {
1109             get
1110             {
1111                 return (float)GetValue(OpacityProperty);
1112             }
1113             set
1114             {
1115                 SetValue(OpacityProperty, value);
1116                 NotifyPropertyChanged();
1117             }
1118         }
1119
1120         /// <summary>
1121         /// Sets the position of the view for X and Y.<br />
1122         /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1123         /// If the position inheritance is disabled, sets the world position.<br />
1124         /// </summary>
1125         /// <remarks>
1126         /// The property cascade chaining set is not recommended.
1127         ///</remarks>
1128         /// <example>
1129         /// This way is recommended for setting the property
1130         /// <code>
1131         /// var view = new View();
1132         /// view.Position2D = new Position2D(100, 200);
1133         /// </code>
1134         /// This way to set the property is prohibited
1135         /// <code>
1136         /// view.Position2D.X = 100; //This does not guarantee a proper operation
1137         /// </code>
1138         /// </example>
1139         /// <since_tizen> 3 </since_tizen>
1140         public Position2D Position2D
1141         {
1142             get
1143             {
1144                 return (Position2D)GetValue(Position2DProperty);
1145             }
1146             set
1147             {
1148                 SetValue(Position2DProperty, value);
1149                 NotifyPropertyChanged();
1150             }
1151         }
1152
1153         /// <summary>
1154         /// Retrieves the screen position of the view.<br />
1155         /// </summary>
1156         /// <since_tizen> 3 </since_tizen>
1157         public Vector2 ScreenPosition
1158         {
1159             get
1160             {
1161                 Vector2 temp = new Vector2(0.0f, 0.0f);
1162                 var pValue = GetProperty(View.Property.ScreenPosition);
1163                 pValue.Get(temp);
1164                 pValue.Dispose();
1165                 return temp;
1166             }
1167         }
1168
1169         /// <summary>
1170         /// Determines whether the pivot point should be used to determine the position of the view.
1171         /// This is false by default.
1172         /// </summary>
1173         /// <remarks>If false, then the top-left of the view is used for the position.
1174         /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1175         /// </remarks>
1176         /// <since_tizen> 3 </since_tizen>
1177         public bool PositionUsesPivotPoint
1178         {
1179             get
1180             {
1181                 return (bool)GetValue(PositionUsesPivotPointProperty);
1182             }
1183             set
1184             {
1185                 SetValue(PositionUsesPivotPointProperty, value);
1186                 NotifyPropertyChanged();
1187             }
1188         }
1189
1190         /// <summary>
1191         /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead!
1192         /// </summary>
1193         /// <since_tizen> 3 </since_tizen>
1194         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " +
1195             "Like: " +
1196             "View view = new View(); " +
1197             "view.PivotPoint = PivotPoint.Center; " +
1198             "view.PositionUsesPivotPoint = true;" +
1199             " Deprecated in API5: Will be removed in API8")]
1200         [EditorBrowsable(EditorBrowsableState.Never)]
1201         public bool PositionUsesAnchorPoint
1202         {
1203             get
1204             {
1205                 return (bool)GetValue(PositionUsesAnchorPointProperty);
1206             }
1207             set
1208             {
1209                 SetValue(PositionUsesAnchorPointProperty, value);
1210             }
1211         }
1212
1213         private bool InternalPositionUsesAnchorPoint
1214         {
1215             get
1216             {
1217                 bool temp = false;
1218                 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1219                 pValue.Get(out temp);
1220                 pValue.Dispose();
1221                 return temp;
1222             }
1223             set
1224             {
1225                 var temp = new Tizen.NUI.PropertyValue(value);
1226                 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1227                 temp.Dispose();
1228                 NotifyPropertyChanged();
1229             }
1230         }
1231
1232         /// <summary>
1233         /// Queries whether the view is connected to the stage.<br />
1234         /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1235         /// </summary>
1236         /// <since_tizen> 3 </since_tizen>
1237         public bool IsOnWindow
1238         {
1239             get
1240             {
1241                 return OnWindow();
1242             }
1243         }
1244
1245         /// <summary>
1246         /// Gets the depth in the hierarchy for the view.
1247         /// </summary>
1248         /// <since_tizen> 3 </since_tizen>
1249         public int HierarchyDepth
1250         {
1251             get
1252             {
1253                 return GetHierarchyDepth();
1254             }
1255         }
1256
1257         /// <summary>
1258         /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1259         /// </summary>
1260         /// <remarks>
1261         /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1262         /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1263         /// The values set by this property will likely change.
1264         /// </remarks>
1265         /// <since_tizen> 3 </since_tizen>
1266         public int SiblingOrder
1267         {
1268             get
1269             {
1270                 return (int)GetValue(SiblingOrderProperty);
1271             }
1272             set
1273             {
1274                 SetValue(SiblingOrderProperty, value);
1275
1276                 Layout?.ChangeLayoutSiblingOrder(value);
1277
1278                 NotifyPropertyChanged();
1279             }
1280         }
1281
1282         /// <summary>
1283         /// Returns the natural size of the view.
1284         /// </summary>
1285         /// <remarks>
1286         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1287         /// </remarks>
1288         /// <since_tizen> 5 </since_tizen>
1289         public Vector3 NaturalSize
1290         {
1291             get
1292             {
1293                 Vector3 ret = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
1294                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1295                 return ret;
1296             }
1297         }
1298
1299         /// <summary>
1300         /// Returns the natural size (Size2D) of the view.
1301         /// </summary>
1302         /// <remarks>
1303         /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1304         /// </remarks>
1305         /// <since_tizen> 4 </since_tizen>
1306         public Size2D NaturalSize2D
1307         {
1308             get
1309             {
1310                 Vector3 temp = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
1311                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1312
1313                 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1314                 temp.Dispose();
1315                 return sz;
1316             }
1317         }
1318
1319         /// <summary>
1320         /// Gets or sets the origin of a view within its parent's area.<br />
1321         /// 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 />
1322         /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1323         /// A view's position is the distance between this origin and the view's anchor-point.<br />
1324         /// </summary>
1325         /// <pre>The view has been initialized.</pre>
1326         /// <since_tizen> 3 </since_tizen>
1327         public Position ParentOrigin
1328         {
1329             get
1330             {
1331                 Position tmp = (Position)GetValue(ParentOriginProperty);
1332                 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1333             }
1334             set
1335             {
1336                 SetValue(ParentOriginProperty, value);
1337                 NotifyPropertyChanged();
1338             }
1339         }
1340
1341         /// <summary>
1342         /// Gets or sets the anchor-point of a view.<br />
1343         /// 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 />
1344         /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1345         /// A view position is the distance between its parent-origin and this anchor-point.<br />
1346         /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1347         /// <pre>The view has been initialized.</pre>
1348         /// </summary>
1349         /// <remarks>
1350         /// The property cascade chaining set is not recommended.
1351         ///</remarks>
1352         /// <example>
1353         /// This way is recommended for setting the property
1354         /// <code>
1355         /// var view = new View();
1356         /// view.PivotPoint = PivotPoint.Center;
1357         /// </code>
1358         /// This way to set the property is prohibited
1359         /// <code>
1360         /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1361         /// </code>
1362         /// </example>
1363         /// <since_tizen> 3 </since_tizen>
1364         public Position PivotPoint
1365         {
1366             get
1367             {
1368                 return (Position)GetValue(PivotPointProperty);
1369             }
1370             set
1371             {
1372                 SetValue(PivotPointProperty, value);
1373                 NotifyPropertyChanged();
1374             }
1375         }
1376
1377         /// <summary>
1378         /// Gets or sets the size width of the view.
1379         /// </summary>
1380         /// <remarks>
1381         /// <para>
1382         /// Animatable - This property can be animated using <c>Animation</c> class.
1383         /// <code>
1384         /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1385         /// </code>
1386         /// </para>
1387         /// </remarks>
1388         /// <since_tizen> 3 </since_tizen>
1389         public float SizeWidth
1390         {
1391             get
1392             {
1393                 return (float)GetValue(SizeWidthProperty);
1394             }
1395             set
1396             {
1397                 SetValue(SizeWidthProperty, value);
1398                 NotifyPropertyChanged();
1399             }
1400         }
1401
1402         /// <summary>
1403         /// Gets or sets the size height of the view.
1404         /// </summary>
1405         /// <remarks>
1406         /// <para>
1407         /// Animatable - This property can be animated using <c>Animation</c> class.
1408         /// </para>
1409         /// <code>
1410         /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1411         /// </code>
1412         /// </remarks>
1413         /// <since_tizen> 3 </since_tizen>
1414         public float SizeHeight
1415         {
1416             get
1417             {
1418                 return (float)GetValue(SizeHeightProperty);
1419             }
1420             set
1421             {
1422                 SetValue(SizeHeightProperty, value);
1423                 NotifyPropertyChanged();
1424             }
1425         }
1426
1427         /// <summary>
1428         /// Gets or sets the position of the view.<br />
1429         /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1430         /// If the position inheritance is disabled, sets the world position.<br />
1431         /// </summary>
1432         /// <remarks>
1433         /// <para>
1434         /// Animatable - This property can be animated using <c>Animation</c> class.
1435         /// <code>
1436         /// animation.AnimateTo(view, "Position", new Position(50, 0));
1437         /// </code>
1438         /// </para>
1439         /// The property cascade chaining set is not recommended.
1440         /// </remarks>
1441         /// <example>
1442         /// This way is recommended for setting the property
1443         /// <code>
1444         /// var view = new View();
1445         /// view.Position = new Position(100, 200.5f, 0);
1446         /// </code>
1447         /// This way to set the property is prohibited
1448         /// <code>
1449         /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1450         /// </code>
1451         /// </example>
1452         /// <since_tizen> 3 </since_tizen>
1453         public Position Position
1454         {
1455             get
1456             {
1457                 return (Position)GetValue(PositionProperty);
1458             }
1459             set
1460             {
1461                 SetValue(PositionProperty, value);
1462                 NotifyPropertyChanged();
1463             }
1464         }
1465
1466         /// <summary>
1467         /// Gets or sets the position X of the view.
1468         /// </summary>
1469         /// <remarks>
1470         /// <para>
1471         /// Animatable - This property can be animated using <c>Animation</c> class.
1472         /// <code>
1473         /// animation.AnimateTo(view, "PositionX", 50.0f);
1474         /// </code>
1475         /// </para>
1476         /// </remarks>
1477         /// <since_tizen> 3 </since_tizen>
1478         public float PositionX
1479         {
1480             get
1481             {
1482                 return (float)GetValue(PositionXProperty);
1483             }
1484             set
1485             {
1486                 SetValue(PositionXProperty, value);
1487                 NotifyPropertyChanged();
1488             }
1489         }
1490
1491         /// <summary>
1492         /// Gets or sets the position Y of the view.
1493         /// </summary>
1494         /// <remarks>
1495         /// <para>
1496         /// Animatable - This property can be animated using <c>Animation</c> class.
1497         /// <code>
1498         /// animation.AnimateTo(view, "PositionY", 50.0f);
1499         /// </code>
1500         /// </para>
1501         /// </remarks>
1502         /// <since_tizen> 3 </since_tizen>
1503         public float PositionY
1504         {
1505             get
1506             {
1507                 return (float)GetValue(PositionYProperty);
1508             }
1509             set
1510             {
1511                 SetValue(PositionYProperty, value);
1512                 NotifyPropertyChanged();
1513             }
1514         }
1515
1516         /// <summary>
1517         /// Gets or sets the position Z of the view.
1518         /// </summary>
1519         /// <remarks>
1520         /// <para>
1521         /// Animatable - This property can be animated using <c>Animation</c> class.
1522         /// <code>
1523         /// animation.AnimateTo(view, "PositionZ", 50.0f);
1524         /// </code>
1525         /// </para>
1526         /// </remarks>
1527         /// <since_tizen> 3 </since_tizen>
1528         public float PositionZ
1529         {
1530             get
1531             {
1532                 return (float)GetValue(PositionZProperty);
1533             }
1534             set
1535             {
1536                 SetValue(PositionZProperty, value);
1537                 NotifyPropertyChanged();
1538             }
1539         }
1540
1541         /// <summary>
1542         /// Gets or sets the world position of the view.
1543         /// </summary>
1544         /// <since_tizen> 3 </since_tizen>
1545         public Vector3 WorldPosition
1546         {
1547             get
1548             {
1549                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1550                 var pValue = GetProperty(View.Property.WorldPosition);
1551                 pValue.Get(temp);
1552                 pValue.Dispose();
1553                 return temp;
1554             }
1555         }
1556
1557         /// <summary>
1558         /// Gets or sets the orientation of the view.<br />
1559         /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1560         /// </summary>
1561         /// <remarks>
1562         /// <para>
1563         /// This is an asynchronous method.
1564         /// </para>
1565         /// <para>
1566         /// Animatable - This property can be animated using <c>Animation</c> class.
1567         /// <code>
1568         /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1569         /// </code>
1570         /// </para>
1571         /// </remarks>
1572         /// <since_tizen> 3 </since_tizen>
1573         public Rotation Orientation
1574         {
1575             get
1576             {
1577                 return (Rotation)GetValue(OrientationProperty);
1578             }
1579             set
1580             {
1581                 SetValue(OrientationProperty, value);
1582                 NotifyPropertyChanged();
1583             }
1584         }
1585
1586         /// <summary>
1587         /// Gets or sets the world orientation of the view.<br />
1588         /// </summary>
1589         /// <since_tizen> 3 </since_tizen>
1590         public Rotation WorldOrientation
1591         {
1592             get
1593             {
1594                 Rotation temp = new Rotation();
1595                 var pValue = GetProperty(View.Property.WorldOrientation);
1596                 pValue.Get(temp);
1597                 pValue.Dispose();
1598                 return temp;
1599             }
1600         }
1601
1602         /// <summary>
1603         /// Gets or sets the scale factor applied to the view.<br />
1604         /// </summary>
1605         /// <remarks>
1606         /// <para>
1607         /// Animatable - This property can be animated using <c>Animation</c> class.
1608         /// <code>
1609         /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1610         /// </code>
1611         /// </para>
1612         /// The property cascade chaining set is not recommended.
1613         /// </remarks>
1614         /// <example>
1615         /// This way is recommended for setting the property
1616         /// <code>
1617         /// var view = new View();
1618         /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1619         /// </code>
1620         /// This way to set the property is prohibited
1621         /// <code>
1622         /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1623         /// </code>
1624         /// </example>
1625         /// <since_tizen> 3 </since_tizen>
1626         public Vector3 Scale
1627         {
1628             get
1629             {
1630                 return (Vector3)GetValue(ScaleProperty);
1631             }
1632             set
1633             {
1634                 SetValue(ScaleProperty, value);
1635                 NotifyPropertyChanged();
1636             }
1637         }
1638
1639         /// <summary>
1640         /// Gets or sets the scale X factor applied to the view.
1641         /// </summary>
1642         /// <remarks>
1643         /// <para>
1644         /// Animatable - This property can be animated using <c>Animation</c> class.
1645         /// <code>
1646         /// animation.AnimateTo(view, "ScaleX", 1.5f);
1647         /// </code>
1648         /// </para>
1649         /// </remarks>
1650         /// <since_tizen> 3 </since_tizen>
1651         public float ScaleX
1652         {
1653             get
1654             {
1655                 return (float)GetValue(ScaleXProperty);
1656             }
1657             set
1658             {
1659                 SetValue(ScaleXProperty, value);
1660                 NotifyPropertyChanged();
1661             }
1662         }
1663
1664         /// <summary>
1665         /// Gets or sets the scale Y factor applied to the view.
1666         /// </summary>
1667         /// <remarks>
1668         /// <para>
1669         /// Animatable - This property can be animated using <c>Animation</c> class.
1670         /// <code>
1671         /// animation.AnimateTo(view, "ScaleY", 1.5f);
1672         /// </code>
1673         /// </para>
1674         /// </remarks>
1675         /// <since_tizen> 3 </since_tizen>
1676         public float ScaleY
1677         {
1678             get
1679             {
1680                 return (float)GetValue(ScaleYProperty);
1681             }
1682             set
1683             {
1684                 SetValue(ScaleYProperty, value);
1685                 NotifyPropertyChanged();
1686             }
1687         }
1688
1689         /// <summary>
1690         /// Gets or sets the scale Z factor applied to the view.
1691         /// </summary>
1692         /// <remarks>
1693         /// <para>
1694         /// Animatable - This property can be animated using <c>Animation</c> class.
1695         /// <code>
1696         /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1697         /// </code>
1698         /// </para>
1699         /// </remarks>
1700         /// <since_tizen> 3 </since_tizen>
1701         public float ScaleZ
1702         {
1703             get
1704             {
1705                 return (float)GetValue(ScaleZProperty);
1706             }
1707             set
1708             {
1709                 SetValue(ScaleZProperty, value);
1710                 NotifyPropertyChanged();
1711             }
1712         }
1713
1714         /// <summary>
1715         /// Gets the world scale of the view.
1716         /// </summary>
1717         /// <since_tizen> 3 </since_tizen>
1718         public Vector3 WorldScale
1719         {
1720             get
1721             {
1722                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1723                 var pValue = GetProperty(View.Property.WorldScale);
1724                 pValue.Get(temp);
1725                 pValue.Dispose();
1726                 return temp;
1727             }
1728         }
1729
1730         /// <summary>
1731         /// Retrieves the visibility flag of the view.
1732         /// </summary>
1733         /// <remarks>
1734         /// <para>
1735         /// If the view is not visible, then the view and its children will not be rendered.
1736         /// 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.
1737         /// </para>
1738         /// <para>
1739         /// Animatable - This property can be animated using <c>Animation</c> class.
1740         /// <code>
1741         /// animation.AnimateTo(view, "Visibility", false);
1742         /// </code>
1743         /// </para>
1744         /// </remarks>
1745         /// <since_tizen> 3 </since_tizen>
1746         public bool Visibility
1747         {
1748             get
1749             {
1750                 bool temp = false;
1751                 var pValue = GetProperty(View.Property.VISIBLE);
1752                 pValue.Get(out temp);
1753                 pValue.Dispose();
1754                 return temp;
1755             }
1756         }
1757
1758         /// <summary>
1759         /// Gets the view's world color.
1760         /// </summary>
1761         /// <since_tizen> 3 </since_tizen>
1762         public Vector4 WorldColor
1763         {
1764             get
1765             {
1766                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1767                 var pValue = GetProperty(View.Property.WorldColor);
1768                 pValue.Get(temp);
1769                 pValue.Dispose();
1770                 return temp;
1771             }
1772         }
1773
1774         /// <summary>
1775         /// Gets or sets the view's name.
1776         /// </summary>
1777         /// <since_tizen> 3 </since_tizen>
1778         public string Name
1779         {
1780             get
1781             {
1782                 return (string)GetValue(NameProperty);
1783             }
1784             set
1785             {
1786                 SetValue(NameProperty, value);
1787                 NotifyPropertyChanged();
1788             }
1789         }
1790
1791         /// <summary>
1792         /// Get the number of children held by the view.
1793         /// </summary>
1794         /// <since_tizen> 3 </since_tizen>
1795         public new uint ChildCount
1796         {
1797             get
1798             {
1799                 return Convert.ToUInt32(Children.Count);
1800             }
1801         }
1802
1803         /// <summary>
1804         /// Gets the view's ID.
1805         /// Read-only
1806         /// </summary>
1807         /// <since_tizen> 3 </since_tizen>
1808         public uint ID
1809         {
1810             get
1811             {
1812                 return GetId();
1813             }
1814         }
1815
1816         /// <summary>
1817         /// Gets or sets the status of whether the view should emit touch or hover signals.
1818         /// If a View is made insensitive, then the View and its children are not hittable.
1819         /// </summary>
1820         /// <since_tizen> 3 </since_tizen>
1821         public bool Sensitive
1822         {
1823             get
1824             {
1825                 return (bool)GetValue(SensitiveProperty);
1826             }
1827             set
1828             {
1829                 SetValue(SensitiveProperty, value);
1830                 NotifyPropertyChanged();
1831             }
1832         }
1833
1834         /// <summary>
1835         /// 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.
1836         /// </summary>
1837         /// <since_tizen> 3 </since_tizen>
1838         public bool LeaveRequired
1839         {
1840             get
1841             {
1842                 return (bool)GetValue(LeaveRequiredProperty);
1843             }
1844             set
1845             {
1846                 SetValue(LeaveRequiredProperty, value);
1847                 NotifyPropertyChanged();
1848             }
1849         }
1850
1851         /// <summary>
1852         /// Gets or sets the status of whether a child view inherits it's parent's orientation.
1853         /// </summary>
1854         /// <since_tizen> 3 </since_tizen>
1855         public bool InheritOrientation
1856         {
1857             get
1858             {
1859                 return (bool)GetValue(InheritOrientationProperty);
1860             }
1861             set
1862             {
1863                 SetValue(InheritOrientationProperty, value);
1864                 NotifyPropertyChanged();
1865             }
1866         }
1867
1868         /// <summary>
1869         /// Gets or sets the status of whether a child view inherits it's parent's scale.
1870         /// </summary>
1871         /// <since_tizen> 3 </since_tizen>
1872         public bool InheritScale
1873         {
1874             get
1875             {
1876                 return (bool)GetValue(InheritScaleProperty);
1877             }
1878             set
1879             {
1880                 SetValue(InheritScaleProperty, value);
1881                 NotifyPropertyChanged();
1882             }
1883         }
1884
1885         /// <summary>
1886         /// Gets or sets the status of how the view and its children should be drawn.<br />
1887         /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
1888         /// 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 />
1889         /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
1890         /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
1891         /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
1892         /// </summary>
1893         /// <since_tizen> 3 </since_tizen>
1894         public DrawModeType DrawMode
1895         {
1896             get
1897             {
1898                 return (DrawModeType)GetValue(DrawModeProperty);
1899             }
1900             set
1901             {
1902                 SetValue(DrawModeProperty, value);
1903                 NotifyPropertyChanged();
1904             }
1905         }
1906
1907         /// <summary>
1908         /// Gets or sets the relative to parent size factor of the view.<br />
1909         /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
1910         /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
1911         /// </summary>
1912         /// <remarks>
1913         /// The property cascade chaining set is not recommended.
1914         /// </remarks>
1915         /// <example>
1916         /// This way is recommended for setting the property
1917         /// <code>
1918         /// var text = new TextField();
1919         /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
1920         /// </code>
1921         /// This way to set the property is prohibited
1922         /// <code>
1923         /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
1924         /// </code>
1925         /// </example>
1926         /// <since_tizen> 3 </since_tizen>
1927         public Vector3 SizeModeFactor
1928         {
1929             get
1930             {
1931                 return (Vector3)GetValue(SizeModeFactorProperty);
1932             }
1933             set
1934             {
1935                 SetValue(SizeModeFactorProperty, value);
1936                 NotifyPropertyChanged();
1937             }
1938         }
1939
1940         /// <summary>
1941         /// Gets or sets the width resize policy to be used.
1942         /// </summary>
1943         /// <since_tizen> 3 </since_tizen>
1944         public ResizePolicyType WidthResizePolicy
1945         {
1946             get
1947             {
1948                 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
1949             }
1950             set
1951             {
1952                 SetValue(WidthResizePolicyProperty, value);
1953                 NotifyPropertyChanged();
1954             }
1955         }
1956
1957         /// <summary>
1958         /// Gets or sets the height resize policy to be used.
1959         /// </summary>
1960         /// <since_tizen> 3 </since_tizen>
1961         public ResizePolicyType HeightResizePolicy
1962         {
1963             get
1964             {
1965                 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
1966             }
1967             set
1968             {
1969                 SetValue(HeightResizePolicyProperty, value);
1970                 NotifyPropertyChanged();
1971             }
1972         }
1973
1974         /// <summary>
1975         /// Gets or sets the policy to use when setting size with size negotiation.<br />
1976         /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
1977         /// </summary>
1978         /// <since_tizen> 3 </since_tizen>
1979         public SizeScalePolicyType SizeScalePolicy
1980         {
1981             get
1982             {
1983                 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
1984             }
1985             set
1986             {
1987                 SetValue(SizeScalePolicyProperty, value);
1988                 NotifyPropertyChanged();
1989             }
1990         }
1991
1992         /// <summary>
1993         ///  Gets or sets the status of whether the width size is dependent on the height size.
1994         /// </summary>
1995         /// <since_tizen> 3 </since_tizen>
1996         public bool WidthForHeight
1997         {
1998             get
1999             {
2000                 return (bool)GetValue(WidthForHeightProperty);
2001             }
2002             set
2003             {
2004                 SetValue(WidthForHeightProperty, value);
2005                 NotifyPropertyChanged();
2006             }
2007         }
2008
2009         /// <summary>
2010         /// Gets or sets the status of whether the height size is dependent on the width size.
2011         /// </summary>
2012         /// <since_tizen> 3 </since_tizen>
2013         public bool HeightForWidth
2014         {
2015             get
2016             {
2017                 return (bool)GetValue(HeightForWidthProperty);
2018             }
2019             set
2020             {
2021                 SetValue(HeightForWidthProperty, value);
2022                 NotifyPropertyChanged();
2023             }
2024         }
2025
2026         /// <summary>
2027         /// Gets or sets the padding for use in layout.
2028         /// </summary>
2029         /// <remarks>
2030         /// The property cascade chaining set is not recommended.
2031         /// </remarks>
2032         /// <example>
2033         /// This way is recommended for setting the property
2034         /// <code>
2035         /// var view = new View();
2036         /// view.Padding = new Extents(5, 5, 5, 5);
2037         /// </code>
2038         /// This way to set the property is prohibited
2039         /// <code>
2040         /// view.Padding.Start = 5; //This does not guarantee a proper operation
2041         /// </code>
2042         /// </example>
2043         /// <since_tizen> 5 </since_tizen>
2044         public Extents Padding
2045         {
2046             get
2047             {
2048                 // If View has a Layout then padding in stored in the base Layout class
2049                 if (Layout != null)
2050                 {
2051                     return Layout.Padding;
2052                 }
2053                 else
2054                 {
2055                     return (Extents)GetValue(PaddingProperty);
2056                 }
2057                 // Two return points to prevent creating a zeroed Extent native object before assignment
2058             }
2059             set
2060             {
2061                 Extents padding = value;
2062                 if (Layout != null)
2063                 {
2064                     // Layout set so store Padding in LayoutItem instead of in View.
2065                     // If View stores the Padding value then Legacy Size Negotiation will overwrite
2066                     // the position and sizes measure in the Layouting.
2067                     Layout.Padding = value;
2068                     // If Layout is a LayoutItem then it could be a View that handles it's own padding.
2069                     // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
2070                     if (typeof(LayoutGroup).IsAssignableFrom(Layout.GetType())) // If a Layout container of some kind.
2071                     {
2072                         padding = new Extents(0, 0, 0, 0); // Reset value stored in View.
2073                     }
2074                 }
2075
2076                 SetValue(PaddingProperty, padding);
2077                 NotifyPropertyChanged();
2078             }
2079         }
2080
2081         /// <summary>
2082         /// Gets or sets the minimum size the view can be assigned in size negotiation.
2083         /// </summary>
2084         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2085         /// <remarks>
2086         /// The property cascade chaining set is not recommended.
2087         /// </remarks>
2088         /// <example>
2089         /// This way is recommended for setting the property
2090         /// <code>
2091         /// var view = new View();
2092         /// view.MinimumSize = new Size2D(100, 200);
2093         /// </code>
2094         /// This way to set the property is prohibited
2095         /// <code>
2096         /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2097         /// </code>
2098         /// </example>
2099         /// <since_tizen> 3 </since_tizen>
2100         public Size2D MinimumSize
2101         {
2102             get
2103             {
2104                 return (Size2D)GetValue(MinimumSizeProperty);
2105             }
2106             set
2107             {
2108                 if (value == null)
2109                 {
2110                     throw new ArgumentNullException(nameof(value));
2111                 }
2112                 if (layout != null)
2113                 {
2114                     // Note: it only works if minimum size is >= than natural size.
2115                     // To force the size it should be done through the width&height spec or Size2D.
2116                     layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2117                     layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2118                     layout.RequestLayout();
2119                 }
2120                 SetValue(MinimumSizeProperty, value);
2121                 NotifyPropertyChanged();
2122             }
2123         }
2124
2125         /// <summary>
2126         /// Gets or sets the maximum size the view can be assigned in size negotiation.
2127         /// </summary>
2128         /// <example>
2129         /// This way is recommended for setting the property
2130         /// <code>
2131         /// var view = new View();
2132         /// view.MaximumSize = new Size2D(100, 200);
2133         /// </code>
2134         /// This way to set the property is prohibited
2135         /// <code>
2136         /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2137         /// </code>
2138         /// </example>
2139         /// <since_tizen> 3 </since_tizen>
2140         public Size2D MaximumSize
2141         {
2142             get
2143             {
2144                 return (Size2D)GetValue(MaximumSizeProperty);
2145             }
2146             set
2147             {
2148                 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2149                 // MATCH_PARENT spec + parent container size can be used to limit
2150                 if (layout != null)
2151                 {
2152                     layout.RequestLayout();
2153                 }
2154                 SetValue(MaximumSizeProperty, value);
2155                 NotifyPropertyChanged();
2156             }
2157         }
2158
2159         /// <summary>
2160         /// Gets or sets whether a child view inherits it's parent's position.<br />
2161         /// Default is to inherit.<br />
2162         /// 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 />
2163         /// </summary>
2164         /// <since_tizen> 3 </since_tizen>
2165         public bool InheritPosition
2166         {
2167             get
2168             {
2169                 return (bool)GetValue(InheritPositionProperty);
2170             }
2171             set
2172             {
2173                 SetValue(InheritPositionProperty, value);
2174                 NotifyPropertyChanged();
2175             }
2176         }
2177
2178         /// <summary>
2179         /// Gets or sets the clipping behavior (mode) of it's children.
2180         /// </summary>
2181         /// <since_tizen> 3 </since_tizen>
2182         public ClippingModeType ClippingMode
2183         {
2184             get
2185             {
2186                 return (ClippingModeType)GetValue(ClippingModeProperty);
2187             }
2188             set
2189             {
2190                 SetValue(ClippingModeProperty, value);
2191                 NotifyPropertyChanged();
2192             }
2193         }
2194
2195         /// <summary>
2196         /// Gets the number of renderers held by the view.
2197         /// </summary>
2198         /// <since_tizen> 3 </since_tizen>
2199         public uint RendererCount
2200         {
2201             get
2202             {
2203                 return GetRendererCount();
2204             }
2205         }
2206
2207         /// <summary>
2208         /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
2209         /// </summary>
2210         /// <remarks>
2211         /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2212         /// </remarks>
2213         /// <since_tizen> 3 </since_tizen>
2214         [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
2215             "Like: " +
2216             "View view = new View(); " +
2217             "view.PivotPoint = PivotPoint.Center; " +
2218             "view.PositionUsesPivotPoint = true;")]
2219         [EditorBrowsable(EditorBrowsableState.Never)]
2220         public Position AnchorPoint
2221         {
2222             get
2223             {
2224                 return GetValue(AnchorPointProperty) as Position;
2225             }
2226             set
2227             {
2228                 SetValue(AnchorPointProperty, value);
2229             }
2230         }
2231
2232         private Position InternalAnchorPoint
2233         {
2234             get
2235             {
2236                 Position temp = new Position(0.0f, 0.0f, 0.0f);
2237                 var pValue = GetProperty(View.Property.AnchorPoint);
2238                 pValue.Get(temp);
2239                 pValue.Dispose();
2240                 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2241                 temp.Dispose();
2242                 return ret;
2243             }
2244             set
2245             {
2246                 var temp = new Tizen.NUI.PropertyValue(value);
2247                 SetProperty(View.Property.AnchorPoint, temp);
2248                 temp.Dispose();
2249                 NotifyPropertyChanged();
2250             }
2251         }
2252
2253         /// <summary>
2254         /// Sets the size of a view for the width, the height and the depth.<br />
2255         /// Geometry can be scaled to fit within this area.<br />
2256         /// This does not interfere with the view's scale factor.<br />
2257         /// The views default depth is the minimum of width and height.<br />
2258         /// </summary>
2259         /// <remarks>
2260         /// <para>
2261         /// Animatable - This property can be animated using <c>Animation</c> class.
2262         /// <code>
2263         /// animation.AnimateTo(view, "Size", new Size(100, 100));
2264         /// </code>
2265         /// </para>
2266         /// The property cascade chaining set is not recommended.
2267         /// </remarks>
2268         /// <example>
2269         /// This way is recommended for setting the property
2270         /// <code>
2271         /// var view = new View();
2272         /// view.Size = new Size(100.5f, 200, 0);
2273         /// </code>
2274         /// This way to set the property is prohibited
2275         /// <code>
2276         /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2277         /// </code>
2278         /// </example>
2279         /// <since_tizen> 5 </since_tizen>
2280         public Size Size
2281         {
2282             get
2283             {
2284                 return (Size)GetValue(SizeProperty);
2285             }
2286             set
2287             {
2288                 SetValue(SizeProperty, value);
2289                 NotifyPropertyChanged();
2290             }
2291         }
2292
2293         /// <summary>
2294         /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
2295         /// </summary>
2296         /// <since_tizen> 3 </since_tizen>
2297         [Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
2298             "Like: " +
2299             "Container parent =  view.GetParent(); " +
2300             "View view = parent as View;")]
2301         [EditorBrowsable(EditorBrowsableState.Never)]
2302         public new View Parent
2303         {
2304             get
2305             {
2306                 View ret;
2307                 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2308                 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2309                 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2310
2311                 if (basehandle is Layer layer)
2312                 {
2313                     ret = new View(Layer.getCPtr(layer).Handle, false);
2314                     NUILog.Error("This Parent property is deprecated, should do not be used");
2315                 }
2316                 else
2317                 {
2318                     ret = basehandle as View;
2319                 }
2320
2321                 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2322                 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2323
2324                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2325                 return ret;
2326             }
2327         }
2328
2329         /// <summary>
2330         /// Gets/Sets whether inherit parent's the layout Direction.
2331         /// </summary>
2332         /// <since_tizen> 4 </since_tizen>
2333         public bool InheritLayoutDirection
2334         {
2335             get
2336             {
2337                 return (bool)GetValue(InheritLayoutDirectionProperty);
2338             }
2339             set
2340             {
2341                 SetValue(InheritLayoutDirectionProperty, value);
2342                 NotifyPropertyChanged();
2343             }
2344         }
2345
2346         /// <summary>
2347         /// Gets/Sets the layout Direction.
2348         /// </summary>
2349         /// <since_tizen> 4 </since_tizen>
2350         public ViewLayoutDirectionType LayoutDirection
2351         {
2352             get
2353             {
2354                 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2355             }
2356             set
2357             {
2358                 SetValue(LayoutDirectionProperty, value);
2359                 NotifyPropertyChanged();
2360                 layout?.RequestLayout();
2361             }
2362         }
2363
2364         /// <summary>
2365         /// Gets or sets the Margin for use in layout.
2366         /// </summary>
2367         /// <remarks>
2368         /// Margin property is supported by Layout algorithms and containers.
2369         /// Please Set Layout if you want to use Margin property.
2370         /// The property cascade chaining set is not recommended.
2371         /// </remarks>
2372         /// <example>
2373         /// This way is recommended for setting the property
2374         /// <code>
2375         /// var view = new View();
2376         /// view.Margin = new Extents(10, 5, 15, 20);
2377         /// </code>
2378         /// This way to set the property is prohibited
2379         /// <code>
2380         /// view.Margin.Top = 15; //This does not guarantee a proper operation
2381         /// </code>
2382         /// </example>
2383         /// <since_tizen> 4 </since_tizen>
2384         public Extents Margin
2385         {
2386             get
2387             {
2388                 // If View has a Layout then margin is stored in Layout.
2389                 if (Layout != null)
2390                 {
2391                     return Layout.Margin;
2392                 }
2393                 else
2394                 {
2395                     // If Layout not set then return margin stored in View.
2396                     return (Extents)GetValue(MarginProperty);
2397                 }
2398                 // Two return points to prevent creating a zeroed Extent native object before assignment
2399             }
2400             set
2401             {
2402                 if (Layout != null)
2403                 {
2404                     // Layout set so store Margin in LayoutItem instead of View.
2405                     // If View stores the Margin too then the Legacy Size Negotiation will
2406                     // overwrite the position and size values measured in the Layouting.
2407                     Layout.Margin = value;
2408                     SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2409                     layout?.RequestLayout();
2410                 }
2411                 else
2412                 {
2413                     SetValue(MarginProperty, value);
2414                 }
2415                 NotifyPropertyChanged();
2416                 layout?.RequestLayout();
2417             }
2418         }
2419
2420         ///<summary>
2421         /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2422         ///</summary>
2423         /// <example>
2424         /// <code>
2425         /// // matchParentView matches its size to its parent size.
2426         /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2427         /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2428         ///
2429         /// // wrapContentView wraps its children with their desired size.
2430         /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2431         /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2432         ///
2433         /// // exactSizeView shows itself with an exact size.
2434         /// exactSizeView.WidthSpecification = 100;
2435         /// exactSizeView.HeightSpecification = 100;
2436         /// </code>
2437         /// </example>
2438         /// <since_tizen> 6 </since_tizen>
2439         [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2440         public int WidthSpecification
2441         {
2442             get
2443             {
2444                 return (int)GetValue(WidthSpecificationProperty);
2445             }
2446             set
2447             {
2448                 SetValue(WidthSpecificationProperty, value);
2449                 NotifyPropertyChanged();
2450             }
2451         }
2452
2453         private int InternalWidthSpecification
2454         {
2455             get
2456             {
2457                 return widthPolicy;
2458             }
2459             set
2460             {
2461                 if (value == widthPolicy)
2462                     return;
2463
2464                 widthPolicy = value;
2465                 if (widthPolicy >= 0)
2466                 {
2467                     if (heightPolicy >= 0) // Policy an exact value
2468                     {
2469                         // Create Size2D only both _widthPolicy and _heightPolicy are set.
2470                         Size2D = new Size2D(widthPolicy, heightPolicy);
2471                     }
2472                 }
2473                 layout?.RequestLayout();
2474             }
2475         }
2476
2477         ///<summary>
2478         /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2479         ///</summary>
2480         /// <example>
2481         /// <code>
2482         /// // matchParentView matches its size to its parent size.
2483         /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2484         /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2485         ///
2486         /// // wrapContentView wraps its children with their desired size.
2487         /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2488         /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2489         ///
2490         /// // exactSizeView shows itself with an exact size.
2491         /// exactSizeView.WidthSpecification = 100;
2492         /// exactSizeView.HeightSpecification = 100;
2493         /// </code>
2494         /// </example>
2495         /// <since_tizen> 6 </since_tizen>
2496         [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2497         public int HeightSpecification
2498         {
2499             get
2500             {
2501                 return (int)GetValue(HeightSpecificationProperty);
2502             }
2503             set
2504             {
2505                 SetValue(HeightSpecificationProperty, value);
2506                 NotifyPropertyChanged();
2507             }
2508         }
2509
2510         private int InternalHeightSpecification
2511         {
2512             get
2513             {
2514                 return heightPolicy;
2515             }
2516             set
2517             {
2518                 if (value == heightPolicy)
2519                     return;
2520
2521                 heightPolicy = value;
2522                 if (heightPolicy >= 0)
2523                 {
2524                     if (widthPolicy >= 0) // Policy an exact value
2525                     {
2526                         // Create Size2D only both _widthPolicy and _heightPolicy are set.
2527                         Size2D = new Size2D(widthPolicy, heightPolicy);
2528                     }
2529                 }
2530                 layout?.RequestLayout();
2531             }
2532         }
2533
2534         ///<summary>
2535         /// Gets the List of transitions for this View.
2536         ///</summary>
2537         /// <since_tizen> 6 </since_tizen>
2538         public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2539         {
2540             get
2541             {
2542                 if (layoutTransitions == null)
2543                 {
2544                     layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2545                 }
2546                 return layoutTransitions;
2547             }
2548         }
2549
2550         ///<summary>
2551         /// Sets a layout transitions for this View.
2552         ///</summary>
2553         /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2554         /// <remarks>
2555         /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2556         /// </remarks>
2557         /// <since_tizen> 6 </since_tizen>
2558         public LayoutTransition LayoutTransition
2559         {
2560             get
2561             {
2562                 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2563             }
2564             set
2565             {
2566                 SetValue(LayoutTransitionProperty, value);
2567                 NotifyPropertyChanged();
2568             }
2569         }
2570
2571         private LayoutTransition InternalLayoutTransition
2572         {
2573             get
2574             {
2575                 return layoutTransition;
2576             }
2577             set
2578             {
2579                 if (value == null)
2580                 {
2581                     throw new global::System.ArgumentNullException(nameof(value));
2582                 }
2583                 if (layoutTransitions == null)
2584                 {
2585                     layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2586                 }
2587
2588                 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2589
2590                 AttachTransitionsToChildren(value);
2591
2592                 layoutTransition = value;
2593             }
2594         }
2595
2596         /// <summary>
2597         /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
2598         /// </summary>
2599         /// <remarks>
2600         /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2601         /// </remarks>
2602         /// <since_tizen> 4 </since_tizen>
2603         [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
2604         [EditorBrowsable(EditorBrowsableState.Never)]
2605         public Extents PaddingEX
2606         {
2607             get
2608             {
2609                 return GetValue(PaddingEXProperty) as Extents;
2610             }
2611             set
2612             {
2613                 SetValue(PaddingEXProperty, value);
2614             }
2615         }
2616
2617         private Extents InternalPaddingEX
2618         {
2619             get
2620             {
2621                 Extents temp = new Extents(0, 0, 0, 0);
2622                 var pValue = GetProperty(View.Property.PADDING);
2623                 pValue.Get(temp);
2624                 pValue.Dispose();
2625                 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2626                 temp.Dispose();
2627                 return ret;
2628             }
2629             set
2630             {
2631                 var temp = new Tizen.NUI.PropertyValue(value);
2632                 SetProperty(View.Property.PADDING, temp);
2633                 temp.Dispose();
2634                 NotifyPropertyChanged();
2635                 layout?.RequestLayout();
2636             }
2637         }
2638
2639         [EditorBrowsable(EditorBrowsableState.Never)]
2640         public XamlStyle XamlStyle
2641         {
2642             get
2643             {
2644                 return (XamlStyle)GetValue(XamlStyleProperty);
2645             }
2646             set
2647             {
2648                 SetValue(XamlStyleProperty, value);
2649             }
2650         }
2651
2652         /// <summary>
2653         /// The Color of View. This is an RGBA value.
2654         /// </summary>
2655         /// <remarks>
2656         /// <para>
2657         /// Animatable - This property can be animated using <c>Animation</c> class.
2658         /// </para>
2659         /// The property cascade chaining set is not recommended.
2660         /// </remarks>
2661         /// <example>
2662         /// This way is recommended for setting the property
2663         /// <code>
2664         /// var view = new View();
2665         /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2666         /// </code>
2667         /// This way to set the property is prohibited
2668         /// <code>
2669         /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2670         /// </code>
2671         /// </example>
2672         [EditorBrowsable(EditorBrowsableState.Never)]
2673         public Color Color
2674         {
2675             get
2676             {
2677                 return (Color)GetValue(ColorProperty);
2678             }
2679             set
2680             {
2681                 SetValue(ColorProperty, value);
2682                 NotifyPropertyChanged();
2683             }
2684         }
2685
2686         /// <summary>
2687         /// Set the layout on this View. Replaces any existing Layout.
2688         /// </summary>
2689         /// <remarks>
2690         /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2691         /// </remarks>
2692         /// <since_tizen> 6 </since_tizen>
2693         public LayoutItem Layout
2694         {
2695             get
2696             {
2697                 return GetValue(LayoutProperty) as LayoutItem;
2698             }
2699             set
2700             {
2701                 SetValue(LayoutProperty, value);
2702             }
2703         }
2704
2705         private LayoutItem InternalLayout
2706         {
2707             get
2708             {
2709                 return layout;
2710             }
2711             set
2712             {
2713                 // Do nothing if layout provided is already set on this View.
2714                 if (value == layout)
2715                 {
2716                     return;
2717                 }
2718
2719                 LayoutingDisabled = false;
2720                 layoutSet = true;
2721
2722                 // If new layout being set already has a owner then that owner receives a replacement default layout.
2723                 // First check if the layout to be set already has a owner.
2724                 if (value?.Owner != null)
2725                 {
2726                     // Previous owner of the layout gets a default layout as a replacement.
2727                     value.Owner.Layout = new AbsoluteLayout()
2728                     {
2729                         // Copy Margin and Padding to replacement LayoutGroup.
2730                         Margin = value.Margin,
2731                         Padding = value.Padding,
2732                     };
2733                 }
2734
2735                 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2736                 // View if no replacement. Previously margin and padding values would have been moved from
2737                 // the View to the layout.
2738                 if (layout != null) // Existing layout
2739                 {
2740                     if (value != null)
2741                     {
2742                         // Existing layout being replaced so copy over margin and padding values.
2743                         value.Margin = layout.Margin;
2744                         value.Padding = layout.Padding;
2745                         value.SetPositionByLayout = !excludeLayouting;
2746                     }
2747                     else
2748                     {
2749                         // Layout not being replaced so restore margin and padding to View.
2750                         SetValue(MarginProperty, layout.Margin);
2751                         SetValue(PaddingProperty, layout.Padding);
2752                         NotifyPropertyChanged();
2753                     }
2754                 }
2755                 else
2756                 {
2757                     // First Layout to be added to the View hence copy
2758
2759                     // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2760                     if (value != null)
2761                     {
2762                         Extents margin = Margin;
2763                         Extents padding = Padding;
2764                         if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2765                         {
2766                             // If View already has a margin set then store it in Layout instead.
2767                             value.Margin = margin;
2768                             SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2769                             NotifyPropertyChanged();
2770                         }
2771
2772                         if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
2773                         {
2774                             // If View already has a padding set then store it in Layout instead.
2775                             value.Padding = padding;
2776
2777                             // If Layout is a LayoutItem then it could be a View that handles it's own padding.
2778                             // Let the View keeps it's padding.  Still store Padding in Layout to reduce code paths.
2779                             if (typeof(LayoutGroup).IsAssignableFrom(value.GetType()))
2780                             {
2781                                 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
2782                                 NotifyPropertyChanged();
2783                             }
2784                         }
2785
2786                         value.SetPositionByLayout = !excludeLayouting;
2787                     }
2788                 }
2789
2790                 // Remove existing layout from it's parent layout group.
2791                 layout?.Unparent();
2792
2793                 // Set layout to this view
2794                 SetLayout(value);
2795             }
2796         }
2797
2798         /// <summary>
2799         /// The weight of the View, used to share available space in a layout with siblings.
2800         /// </summary>
2801         /// <since_tizen> 6 </since_tizen>
2802         public float Weight
2803         {
2804             get
2805             {
2806                 return weight;
2807             }
2808             set
2809             {
2810                 weight = value;
2811                 layout?.RequestLayout();
2812             }
2813         }
2814
2815         /// <summary>
2816         ///  Whether to load the BackgroundImage synchronously.
2817         ///  If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2818         ///  Note: For Normal Quad images only.
2819         /// </summary>
2820         /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2821         [EditorBrowsable(EditorBrowsableState.Never)]
2822         public bool BackgroundImageSynchronosLoading
2823         {
2824             get
2825             {
2826                 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
2827             }
2828             set
2829             {
2830                 SetValue(BackgroundImageSynchronosLoadingProperty, value);
2831                 NotifyPropertyChanged();
2832             }
2833         }
2834
2835         private bool InternalBackgroundImageSynchronosLoading
2836         {
2837             get
2838             {
2839                 return BackgroundImageSynchronousLoading;
2840             }
2841             set
2842             {
2843                 BackgroundImageSynchronousLoading = value;
2844             }
2845         }
2846
2847         /// <summary>
2848         ///  Whether to load the BackgroundImage synchronously.
2849         ///  If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2850         ///  Note: For Normal Quad images only.
2851         /// </summary>
2852         /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2853         [EditorBrowsable(EditorBrowsableState.Never)]
2854         public bool BackgroundImageSynchronousLoading
2855         {
2856             get
2857             {
2858                 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
2859             }
2860             set
2861             {
2862                 SetValue(BackgroundImageSynchronousLoadingProperty, value);
2863                 NotifyPropertyChanged();
2864             }
2865         }
2866
2867         private bool InternalBackgroundImageSynchronousLoading
2868         {
2869             get
2870             {
2871                 return backgroundImageSynchronousLoading;
2872             }
2873             set
2874             {
2875                 backgroundImageSynchronousLoading = value;
2876
2877                 string bgUrl = null;
2878                 var pValue = Background.Find(ImageVisualProperty.URL);
2879                 pValue?.Get(out bgUrl);
2880                 pValue?.Dispose();
2881
2882                 if (!string.IsNullOrEmpty(bgUrl))
2883                 {
2884                     PropertyMap bgMap = this.Background;
2885                     var temp = new PropertyValue(backgroundImageSynchronousLoading);
2886                     bgMap[ImageVisualProperty.SynchronousLoading] = temp;
2887                     temp.Dispose();
2888                     Background = bgMap;
2889                 }
2890             }
2891         }
2892
2893         /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2894         [EditorBrowsable(EditorBrowsableState.Never)]
2895         public Vector2 UpdateSizeHint
2896         {
2897             get
2898             {
2899                 return (Vector2)GetValue(UpdateSizeHintProperty);
2900             }
2901             set
2902             {
2903                 SetValue(UpdateSizeHintProperty, value);
2904                 NotifyPropertyChanged();
2905             }
2906         }
2907
2908         /// <summary>
2909         /// Enable/Disable ControlState propagation for children.
2910         /// It is false by default.
2911         /// If the View needs to share ControlState with descendants, please set it true.
2912         /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
2913         /// </summary>
2914         [EditorBrowsable(EditorBrowsableState.Never)]
2915         public bool EnableControlStatePropagation
2916         {
2917             get
2918             {
2919                 return (bool)GetValue(EnableControlStatePropagationProperty);
2920             }
2921             set
2922             {
2923                 SetValue(EnableControlStatePropagationProperty, value);
2924                 NotifyPropertyChanged();
2925             }
2926         }
2927
2928         private bool InternalEnableControlStatePropagation
2929         {
2930             get => themeData?.ControlStatePropagation ?? false;
2931             set
2932             {
2933                 if (InternalEnableControlStatePropagation == value) return;
2934
2935                 if (themeData == null) themeData = new ThemeData();
2936
2937                 themeData.ControlStatePropagation = value;
2938
2939                 foreach (View child in Children)
2940                 {
2941                     child.EnableControlStatePropagation = value;
2942                 }
2943             }
2944         }
2945
2946         /// <summary>
2947         /// By default, it is false in View, true in Control.
2948         /// Note that if the value is true, the View will be a touch receptor.
2949         /// </summary>
2950         [EditorBrowsable(EditorBrowsableState.Never)]
2951         public bool EnableControlState
2952         {
2953             get
2954             {
2955                 return (bool)GetValue(EnableControlStateProperty);
2956             }
2957             set
2958             {
2959                 SetValue(EnableControlStateProperty, value);
2960             }
2961         }
2962
2963         /// <summary>
2964         /// Whether the actor grab all touches even if touch leaves its boundary.
2965         /// </summary>
2966         /// <returns>true, if it grab all touch after start</returns>
2967         [EditorBrowsable(EditorBrowsableState.Never)]
2968         public bool GrabTouchAfterLeave
2969         {
2970             get
2971             {
2972                 return (bool)GetValue(GrabTouchAfterLeaveProperty);
2973             }
2974             set
2975             {
2976                 SetValue(GrabTouchAfterLeaveProperty, value);
2977             }
2978         }
2979
2980         private bool InternalGrabTouchAfterLeave
2981         {
2982             get
2983             {
2984                 bool temp = false;
2985                 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
2986                 pValue.Get(out temp);
2987                 pValue.Dispose();
2988                 return temp;
2989             }
2990             set
2991             {
2992                 var temp = new Tizen.NUI.PropertyValue(value);
2993                 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
2994                 temp.Dispose();
2995                 NotifyPropertyChanged();
2996             }
2997         }
2998
2999         /// <summary>
3000         /// Determines which blend equation will be used to render renderers of this actor.
3001         /// </summary>
3002         /// <returns>blend equation enum currently assigned</returns>
3003         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3004         [EditorBrowsable(EditorBrowsableState.Never)]
3005         public BlendEquationType BlendEquation
3006         {
3007             get
3008             {
3009                 return (BlendEquationType)GetValue(BlendEquationProperty);
3010             }
3011             set
3012             {
3013                 SetValue(BlendEquationProperty, value);
3014             }
3015         }
3016
3017         private BlendEquationType InternalBlendEquation
3018         {
3019             get
3020             {
3021                 int temp = 0;
3022                 var pValue = GetProperty(View.Property.BlendEquation);
3023                 pValue.Get(out temp);
3024                 pValue.Dispose();
3025                 return (BlendEquationType)temp;
3026             }
3027             set
3028             {
3029                 var temp = new Tizen.NUI.PropertyValue((int)value);
3030                 SetProperty(View.Property.BlendEquation, temp);
3031                 temp.Dispose();
3032                 NotifyPropertyChanged();
3033             }
3034         }
3035
3036         /// <summary>
3037         /// If the value is true, the View will change its style as the theme changes.
3038         /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3039         /// </summary>
3040         /// <since_tizen> 9 </since_tizen>
3041         public bool ThemeChangeSensitive
3042         {
3043             get => (bool)GetValue(ThemeChangeSensitiveProperty);
3044             set => SetValue(ThemeChangeSensitiveProperty, value);
3045         }
3046
3047         /// <summary>
3048         /// Create Style, it is abstract function and must be override.
3049         /// </summary>
3050         [EditorBrowsable(EditorBrowsableState.Never)]
3051         protected virtual ViewStyle CreateViewStyle()
3052         {
3053             return new ViewStyle();
3054         }
3055
3056         /// <summary>
3057         /// Called after the View's ControlStates changed.
3058         /// </summary>
3059         /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3060         [EditorBrowsable(EditorBrowsableState.Never)]
3061         protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3062         {
3063         }
3064
3065         /// <summary>
3066         /// </summary>
3067         [EditorBrowsable(EditorBrowsableState.Never)]
3068         protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3069         {
3070             if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3071             else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3072         }
3073
3074         /// <summary>
3075         /// Apply style instance to the view.
3076         /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3077         /// </summary>
3078         /// <since_tizen> 9 </since_tizen>
3079         public virtual void ApplyStyle(ViewStyle viewStyle)
3080         {
3081             if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3082
3083             if (themeData == null) themeData = new ThemeData();
3084
3085             themeData.viewStyle = viewStyle;
3086
3087             if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3088             {
3089                 // Nothing to apply
3090                 return;
3091             }
3092
3093             BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3094
3095             if (bindablePropertyOfView == null)
3096             {
3097                 return;
3098             }
3099
3100             var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3101             viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3102
3103             foreach (var sourceProperty in dirtyStyleProperties)
3104             {
3105                 var sourceValue = viewStyle.GetValue(sourceProperty);
3106
3107                 if (sourceValue == null)
3108                 {
3109                     continue;
3110                 }
3111
3112                 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3113
3114                 if (destinationProperty != null)
3115                 {
3116                     SetValue(destinationProperty, sourceValue);
3117                 }
3118             }
3119         }
3120
3121         /// <summary>
3122         /// Get whether the View is culled or not.
3123         /// True means that the View is out of the view frustum.
3124         /// </summary>
3125         /// <remarks>
3126         /// Hidden-API (Inhouse-API).
3127         /// </remarks>
3128         [EditorBrowsable(EditorBrowsableState.Never)]
3129         public bool Culled
3130         {
3131             get
3132             {
3133                 bool temp = false;
3134                 var pValue = GetProperty(View.Property.Culled);
3135                 pValue.Get(out temp);
3136                 pValue.Dispose();
3137                 return temp;
3138             }
3139         }
3140
3141         /// <summary>
3142         /// Set or Get TransitionOptions for the page transition.
3143         /// This property is used to define how this view will be transitioned during Page switching.
3144         /// </summary>
3145         /// <since_tizen> 9 </since_tizen>
3146         public TransitionOptions TransitionOptions
3147         {
3148             get
3149             {
3150                 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3151             }
3152             set
3153             {
3154                 SetValue(TransitionOptionsProperty, value);
3155                 NotifyPropertyChanged();
3156             }
3157         }
3158
3159         private TransitionOptions InternalTransitionOptions
3160         {
3161             set
3162             {
3163                 transitionOptions = value;
3164             }
3165             get
3166             {
3167                 return transitionOptions;
3168             }
3169         }
3170
3171         /// <summary>
3172         /// Gets or sets the status of whether the view should emit key event signals.
3173         /// If a View's DispatchKeyEvents is set to false, then it's children will not emit a key event signal either.
3174         /// </summary>
3175         [EditorBrowsable(EditorBrowsableState.Never)]
3176         public bool DispatchKeyEvents
3177         {
3178             get
3179             {
3180                 return (bool)GetValue(DispatchKeyEventsProperty);
3181             }
3182             set
3183             {
3184                 SetValue(DispatchKeyEventsProperty, value);
3185                 NotifyPropertyChanged();
3186             }
3187         }
3188
3189
3190
3191
3192     }
3193 }