2 * Copyright(c) 2022 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 using System.Collections.Generic;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.Binding;
23 namespace Tizen.NUI.BaseComponents
26 /// View is the base class for all views.
28 /// <since_tizen> 3 </since_tizen>
29 public partial class View : Container, IResourcesProvider
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 private static bool defaultGrabTouchAfterLeave = false;
35 private static bool defaultAllowOnlyOwnTouch = false;
37 internal BackgroundExtraData backgroundExtraData;
39 private bool layoutSet = false;
40 private LayoutItem layout; // Exclusive layout assigned to this View.
42 // List of transitions paired with the condition that uses the transition.
43 private Dictionary<TransitionCondition, TransitionList> layoutTransitions;
44 private int widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
45 private int heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
46 private float weight = 0.0f; // Weighting of child View in a Layout
47 private bool backgroundImageSynchronousLoading = false;
48 private bool excludeLayouting = false;
49 private LayoutTransition layoutTransition;
50 private TransitionOptions transitionOptions = null;
51 private ThemeData themeData;
52 private bool isThemeChanged = false;
54 // List of constraints
55 private Constraint widthConstraint = null;
56 private Constraint heightConstraint = null;
58 private Size2D internalMaximumSize = null;
59 private Size2D internalMinimumSize = null;
60 private Extents internalMargin = null;
61 private Extents internalPadding = null;
62 private Vector3 internalSizeModeFactor = null;
63 private Vector2 internalCellIndex = null;
64 private Color internalBackgroundColor = null;
65 private Color internalColor = null;
66 private Position internalPivotPoint = null;
67 private Position internalPosition = null;
68 private Position2D internalPosition2D = null;
69 private Vector3 internalScale = null;
70 private Size internalSize = null;
71 private Size2D internalSize2D = null;
72 private int layoutCount = 0;
73 private ControlState propagatableControlStates = ControlState.All;
75 private string internalName = string.Empty;
76 private Position internalCurrentParentOrigin = null;
77 private Position internalCurrentAnchorPoint = null;
78 private Vector3 internalTargetSize = null;
79 private Size2D internalCurrentSize = null;
80 private Position internalCurrentPosition = null;
81 private Vector3 internalCurrentWorldPosition = null;
82 private Vector3 internalCurrentScale = null;
83 private Vector3 internalCurrentWorldScale = null;
84 private Vector4 internalCurrentColor = null;
85 private Vector4 internalCurrentWorldColor = null;
86 private Vector2 internalCurrentScreenPosition = null;
88 private static int aliveCount = 0;
92 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
93 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
94 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
95 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
97 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
98 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
99 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
100 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
102 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
103 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
104 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
105 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
107 RegisterAccessibilityDelegate();
110 static internal new void Preload()
114 // Do nothing. Just call for load static values.
115 var temporalPositionPropertyGroup = positionPropertyGroup;
116 var temporalSizePropertyGroup = sizePropertyGroup;
117 var temporalScalePropertyGroup = scalePropertyGroup;
121 /// Accessibility mode for controlling View's Accessible implementation.
122 /// It is only relevant when deriving custom controls from View directly,
123 /// as classes derived from CustomView (or any of its subclasses) get the
124 /// Custom mode by default.
126 [EditorBrowsable(EditorBrowsableState.Never)]
127 public enum ViewAccessibilityMode
130 /// Default accessibility implementation. Overriding View.Accessibility...()
131 /// virtual methods will have no effect.
133 [EditorBrowsable(EditorBrowsableState.Never)]
136 /// Custom accessibility implementation. Overriding View.Accessibility...()
137 /// will be necessary to provide accessibility support for the View.
139 [EditorBrowsable(EditorBrowsableState.Never)]
143 private static IntPtr NewWithAccessibilityMode(ViewAccessibilityMode accessibilityMode)
145 switch (accessibilityMode)
147 case ViewAccessibilityMode.Custom:
149 return Interop.View.NewCustom();
151 case ViewAccessibilityMode.Default:
154 return Interop.View.New();
160 /// Creates a new instance of a view.
162 /// <since_tizen> 3 </since_tizen>
163 public View() : this(ViewAccessibilityMode.Default)
167 [EditorBrowsable(EditorBrowsableState.Never)]
168 public View(ViewAccessibilityMode accessibilityMode) : this(NewWithAccessibilityMode(accessibilityMode), true)
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
174 [EditorBrowsable(EditorBrowsableState.Never)]
175 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
180 /// Create a new instance of a View with setting the status of shown or hidden.
182 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
183 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
184 [EditorBrowsable(EditorBrowsableState.Never)]
185 public View(bool shown) : this(Interop.View.New(), true)
187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
193 InitializeStyle(viewStyle);
196 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : this(cPtr, cMemoryOwn, shown, cMemoryOwn)
200 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
204 PositionUsesPivotPoint = false;
205 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
206 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
217 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
219 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 /// The event that is triggered when the View's ControlState is changed.
230 [EditorBrowsable(EditorBrowsableState.Never)]
231 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
233 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
237 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
239 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
240 [EditorBrowsable(EditorBrowsableState.Never)]
241 public bool LayoutSet
250 /// Flag to allow Layouting to be disabled for Views.
251 /// Once a View has a Layout set then any children added to Views from then on will receive
252 /// automatic Layouts.
254 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
255 [EditorBrowsable(EditorBrowsableState.Never)]
256 public static bool LayoutingDisabled { get; set; } = true;
259 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
261 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
262 [EditorBrowsable(EditorBrowsableState.Never)]
263 public static void SetDefaultGrabTouchAfterLeave(bool enable)
265 defaultGrabTouchAfterLeave = enable;
269 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
271 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
272 [EditorBrowsable(EditorBrowsableState.Never)]
273 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
275 defaultAllowOnlyOwnTouch = enable;
279 /// Deprecate. Do not use this.
280 /// The style instance applied to this view.
281 /// Note that do not modify the ViewStyle.
282 /// Modifying ViewStyle will affect other views with same ViewStyle.
284 [EditorBrowsable(EditorBrowsableState.Never)]
285 protected ViewStyle ViewStyle
289 if (themeData == null) themeData = new ThemeData();
291 if (themeData.viewStyle == null)
293 ApplyStyle(CreateViewStyle());
295 return themeData.viewStyle;
300 /// Get/Set the control state.
301 /// Note that the ControlState only available for the classes derived from Control.
302 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
303 /// please set <see cref="EnableControlState"/> to true.
305 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
306 [EditorBrowsable(EditorBrowsableState.Never)]
307 public ControlState ControlState
311 return themeData == null ? ControlState.Normal : themeData.controlStates;
315 if (ControlState == value)
320 var prevState = ControlState;
322 if (themeData == null) themeData = new ThemeData();
323 themeData.controlStates = value;
325 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
327 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
329 if (themeData.ControlStatePropagation)
331 foreach (View child in Children)
333 ControlState allowed = child.PropagatableControlStates;
334 if (allowed.Contains(ControlState.All))
336 child.ControlState = value;
340 ControlState newControlState = child.ControlState;
342 if (allowed.Contains(ControlState.Normal))
344 if (value.Contains(ControlState.Normal))
346 newControlState += ControlState.Normal;
350 newControlState -= ControlState.Normal;
354 if (allowed.Contains(ControlState.Disabled))
356 if (value.Contains(ControlState.Disabled))
358 newControlState += ControlState.Disabled;
362 newControlState -= ControlState.Disabled;
366 if (allowed.Contains(ControlState.Selected))
368 if (value.Contains(ControlState.Selected))
370 newControlState += ControlState.Selected;
374 newControlState -= ControlState.Selected;
378 if (allowed.Contains(ControlState.Pressed))
380 if (value.Contains(ControlState.Pressed))
382 newControlState += ControlState.Pressed;
386 newControlState -= ControlState.Pressed;
390 if (allowed.Contains(ControlState.Focused))
392 if (value.Contains(ControlState.Focused))
394 newControlState += ControlState.Focused;
398 newControlState -= ControlState.Focused;
402 if (allowed.Contains(ControlState.Other))
404 if (value.Contains(ControlState.Other))
406 newControlState += ControlState.Other;
410 newControlState -= ControlState.Other;
414 if (child.ControlState != newControlState)
415 child.ControlState = newControlState;
420 OnControlStateChanged(changeInfo);
422 ControlStateChangedEvent?.Invoke(this, changeInfo);
427 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
429 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
430 [EditorBrowsable(EditorBrowsableState.Never)]
431 public bool ExcludeLayouting
435 return (bool)GetValue(ExcludeLayoutingProperty);
439 SetValue(ExcludeLayoutingProperty, value);
440 NotifyPropertyChanged();
444 private bool InternalExcludeLayouting
448 return excludeLayouting;
452 excludeLayouting = value;
453 if (Layout != null && Layout.SetPositionByLayout == value)
455 Layout.SetPositionByLayout = !value;
456 Layout.RequestLayout();
462 /// The StyleName, type string.
463 /// The value indicates DALi style name defined in json theme file.
465 /// <since_tizen> 3 </since_tizen>
466 public string StyleName
470 return (string)GetValue(StyleNameProperty);
474 SetValue(StyleNameProperty, value);
475 NotifyPropertyChanged();
480 /// The KeyInputFocus, type bool.
482 [EditorBrowsable(EditorBrowsableState.Never)]
483 public bool KeyInputFocus
487 return (bool)GetValue(KeyInputFocusProperty);
491 SetValue(KeyInputFocusProperty, value);
492 NotifyPropertyChanged();
497 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
501 /// The property cascade chaining set is not recommended.
504 /// Animatable - This property can be animated using <c>Animation</c> class.
506 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
511 /// This way is recommended for setting the property
513 /// var view = new View();
514 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
516 /// This way to set the property is prohibited
518 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
521 /// <since_tizen> 3 </since_tizen>
522 public Color BackgroundColor
526 return (Color)GetValue(BackgroundColorProperty);
530 SetValue(BackgroundColorProperty, value);
531 NotifyPropertyChanged();
536 /// The mutually exclusive with "backgroundColor" and "background" type Map.
538 /// <since_tizen> 3 </since_tizen>
539 public string BackgroundImage
543 return (string)GetValue(BackgroundImageProperty);
547 SetValue(BackgroundImageProperty, value);
548 NotifyPropertyChanged();
553 /// Get or set the border of background image.
555 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
556 [EditorBrowsable(EditorBrowsableState.Never)]
557 public Rectangle BackgroundImageBorder
561 return (Rectangle)GetValue(BackgroundImageBorderProperty);
565 SetValue(BackgroundImageBorderProperty, value);
566 NotifyPropertyChanged();
571 /// The background of view.
573 /// <since_tizen> 3 </since_tizen>
574 public Tizen.NUI.PropertyMap Background
578 return (PropertyMap)GetValue(BackgroundProperty);
582 SetValue(BackgroundProperty, value);
583 NotifyPropertyChanged();
588 /// Describes a shadow as an image for a View.
589 /// It is null by default.
592 /// Getter returns copied instance of current shadow.
595 /// The mutually exclusive with "BoxShadow".
599 /// Animatable - This property can be animated using <c>Animation</c> class.
600 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
602 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
604 /// Animatable sub-property : Offset.
607 [EditorBrowsable(EditorBrowsableState.Never)]
608 public ImageShadow ImageShadow
612 return (ImageShadow)GetValue(ImageShadowProperty);
616 SetValue(ImageShadowProperty, value);
617 NotifyPropertyChanged();
622 /// Describes a box shaped shadow drawing for a View.
623 /// It is null by default.
626 /// The mutually exclusive with "ImageShadow".
630 /// Animatable - This property can be animated using <c>Animation</c> class.
631 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
633 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
635 /// Animatable sub-property : Offset, Color, BlurRadius.
638 /// <since_tizen> 9 </since_tizen>
639 public Shadow BoxShadow
643 return (Shadow)GetValue(BoxShadowProperty);
647 SetValue(BoxShadowProperty, value);
648 NotifyPropertyChanged();
653 /// The radius for the rounded corners of the View.
654 /// This will rounds background and shadow edges.
655 /// 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).
656 /// Each radius will clamp internally to the half of smaller of the view's width or height.
657 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
661 /// Animatable - This property can be animated using <c>Animation</c> class.
663 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
667 /// <since_tizen> 9 </since_tizen>
668 public Vector4 CornerRadius
672 return (Vector4)GetValue(CornerRadiusProperty);
676 SetValue(CornerRadiusProperty, value);
677 NotifyPropertyChanged();
682 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
683 /// It is absolute by default.
684 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
686 /// <since_tizen> 9 </since_tizen>
687 public VisualTransformPolicyType CornerRadiusPolicy
689 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
690 set => SetValue(CornerRadiusPolicyProperty, value);
694 /// The width for the borderline of the View.
698 /// Animatable - This property can be animated using <c>Animation</c> class.
700 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
703 /// Note that, an image background may not have borderline if it uses the Border property.
705 /// <since_tizen> 9 </since_tizen>
706 public float BorderlineWidth
710 return (float)GetValue(BorderlineWidthProperty);
714 SetValue(BorderlineWidthProperty, value);
715 NotifyPropertyChanged();
720 /// The color for the borderline of the View.
721 /// It is Color.Black by default.
725 /// Animatable - This property can be animated using <c>Animation</c> class.
727 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
731 /// <since_tizen> 9 </since_tizen>
732 public Color BorderlineColor
736 return (Color)GetValue(BorderlineColorProperty);
740 SetValue(BorderlineColorProperty, value);
741 NotifyPropertyChanged();
746 /// The color selector for the borderline of the View.
747 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
748 /// So this API is internally used only.
750 internal Selector<Color> BorderlineColorSelector
754 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
758 SetValue(BorderlineColorSelectorProperty, value);
759 NotifyPropertyChanged();
764 /// The Relative offset for the borderline of the View.
765 /// Recommended range : [-1.0f to 1.0f].
766 /// If -1.0f, draw borderline inside of the View.
767 /// If 1.0f, draw borderline outside of the View.
768 /// If 0.0f, draw borderline half inside and half outside.
769 /// It is 0.0f by default.
773 /// Animatable - This property can be animated using <c>Animation</c> class.
775 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
779 /// <since_tizen> 9 </since_tizen>
780 public float BorderlineOffset
784 return (float)GetValue(BorderlineOffsetProperty);
788 SetValue(BorderlineOffsetProperty, value);
789 NotifyPropertyChanged();
794 /// The current state of the view.
796 /// <since_tizen> 3 </since_tizen>
801 return (States)GetValue(StateProperty);
805 SetValue(StateProperty, value);
806 NotifyPropertyChanged();
811 /// The current sub state of the view.
813 /// <since_tizen> 3 </since_tizen>
814 public States SubState
818 return (States)GetValue(SubStateProperty);
822 SetValue(SubStateProperty, value);
823 NotifyPropertyChanged();
828 /// Displays a tooltip
830 /// <since_tizen> 3 </since_tizen>
831 public Tizen.NUI.PropertyMap Tooltip
835 return (PropertyMap)GetValue(TooltipProperty);
839 SetValue(TooltipProperty, value);
840 NotifyPropertyChanged();
845 /// Displays a tooltip as a text.
847 /// <since_tizen> 3 </since_tizen>
848 public string TooltipText
852 return GetValue(TooltipTextProperty) as string;
856 SetValue(TooltipTextProperty, value);
860 private string InternalTooltipText
864 using (var propertyValue = GetProperty(Property.TOOLTIP))
866 using var propertyMap = new PropertyMap();
867 if (propertyValue != null && propertyValue.Get(propertyMap))
869 using var retrivedContentValue = propertyMap?.Find(NDalic.TooltipContent);
870 if (retrivedContentValue != null)
872 using var contextPropertyMap = new PropertyMap();
873 if (retrivedContentValue.Get(contextPropertyMap))
875 using var retrivedTextValue = contextPropertyMap?.Find(NDalic.TextVisualText);
876 if (retrivedTextValue != null && retrivedTextValue.Get(out string retrivedValue))
878 return retrivedValue;
888 var temp = new Tizen.NUI.PropertyValue(value);
889 SetProperty(View.Property.TOOLTIP, temp);
891 NotifyPropertyChanged();
896 /// The Child property of FlexContainer.<br />
897 /// The proportion of the free space in the container, the flex item will receive.<br />
898 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
900 /// <since_tizen> 3 </since_tizen>
901 [Obsolete("Deprecated in API8, will be removed in API10.")]
906 return (float)GetValue(FlexProperty);
910 SetValue(FlexProperty, value);
911 NotifyPropertyChanged();
916 /// The Child property of FlexContainer.<br />
917 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
919 /// <since_tizen> 3 </since_tizen>
920 [Obsolete("Deprecated in API8, will be removed in API10.")]
925 return (int)GetValue(AlignSelfProperty);
929 SetValue(AlignSelfProperty, value);
930 NotifyPropertyChanged();
935 /// The Child property of FlexContainer.<br />
936 /// The space around the flex item.<br />
939 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
941 /// <since_tizen> 3 </since_tizen>
942 [Obsolete("Deprecated in API8, will be removed in API10.")]
943 public Vector4 FlexMargin
947 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
948 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
952 SetValue(FlexMarginProperty, value);
953 NotifyPropertyChanged();
958 /// The top-left cell this child occupies, if not set, the first available cell is used.
961 /// The property cascade chaining set is not recommended.
962 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
965 /// This way is recommended for setting the property
967 /// var view = new View();
968 /// view.CellIndex = new Vector2(1, 3);
970 /// This way to set the property is prohibited
972 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
975 /// <since_tizen> 3 </since_tizen>
976 public Vector2 CellIndex
980 return (Vector2)GetValue(CellIndexProperty);
984 SetValue(CellIndexProperty, value);
985 NotifyPropertyChanged();
990 /// The number of rows this child occupies, if not set, the default value is 1.
993 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
995 /// <since_tizen> 3 </since_tizen>
1000 return (float)GetValue(RowSpanProperty);
1004 SetValue(RowSpanProperty, value);
1005 NotifyPropertyChanged();
1010 /// The number of columns this child occupies, if not set, the default value is 1.
1013 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1015 /// <since_tizen> 3 </since_tizen>
1016 public float ColumnSpan
1020 return (float)GetValue(ColumnSpanProperty);
1024 SetValue(ColumnSpanProperty, value);
1025 NotifyPropertyChanged();
1030 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
1033 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1035 /// <since_tizen> 3 </since_tizen>
1036 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1040 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1044 SetValue(CellHorizontalAlignmentProperty, value);
1045 NotifyPropertyChanged();
1050 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1053 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1055 /// <since_tizen> 3 </since_tizen>
1056 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1060 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1064 SetValue(CellVerticalAlignmentProperty, value);
1065 NotifyPropertyChanged();
1070 /// The left focusable view.<br />
1071 /// This will return null if not set.<br />
1072 /// This will also return null if the specified left focusable view is not on a window.<br />
1074 /// <since_tizen> 3 </since_tizen>
1075 public View LeftFocusableView
1077 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1080 return (View)GetValue(LeftFocusableViewProperty);
1084 SetValue(LeftFocusableViewProperty, value);
1085 NotifyPropertyChanged();
1090 /// The right focusable view.<br />
1091 /// This will return null if not set.<br />
1092 /// This will also return null if the specified right focusable view is not on a window.<br />
1094 /// <since_tizen> 3 </since_tizen>
1095 public View RightFocusableView
1097 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1100 return (View)GetValue(RightFocusableViewProperty);
1104 SetValue(RightFocusableViewProperty, value);
1105 NotifyPropertyChanged();
1110 /// The up focusable view.<br />
1111 /// This will return null if not set.<br />
1112 /// This will also return null if the specified up focusable view is not on a window.<br />
1114 /// <since_tizen> 3 </since_tizen>
1115 public View UpFocusableView
1117 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1120 return (View)GetValue(UpFocusableViewProperty);
1124 SetValue(UpFocusableViewProperty, value);
1125 NotifyPropertyChanged();
1130 /// The down focusable view.<br />
1131 /// This will return null if not set.<br />
1132 /// This will also return null if the specified down focusable view is not on a window.<br />
1134 /// <since_tizen> 3 </since_tizen>
1135 public View DownFocusableView
1137 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1140 return (View)GetValue(DownFocusableViewProperty);
1144 SetValue(DownFocusableViewProperty, value);
1145 NotifyPropertyChanged();
1150 /// The clockwise focusable view by rotary wheel.<br />
1151 /// This will return null if not set.<br />
1152 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1154 [EditorBrowsable(EditorBrowsableState.Never)]
1155 public View ClockwiseFocusableView
1157 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1160 return (View)GetValue(ClockwiseFocusableViewProperty);
1164 SetValue(ClockwiseFocusableViewProperty, value);
1165 NotifyPropertyChanged();
1170 /// The counter clockwise focusable view by rotary wheel.<br />
1171 /// This will return null if not set.<br />
1172 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1174 [EditorBrowsable(EditorBrowsableState.Never)]
1175 public View CounterClockwiseFocusableView
1177 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1180 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1184 SetValue(CounterClockwiseFocusableViewProperty, value);
1185 NotifyPropertyChanged();
1190 /// Whether the view should be focusable by keyboard navigation.
1192 /// <since_tizen> 3 </since_tizen>
1193 public bool Focusable
1197 SetValue(FocusableProperty, value);
1198 NotifyPropertyChanged();
1202 return (bool)GetValue(FocusableProperty);
1207 /// 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.
1208 /// Note : Default value is true.
1210 [EditorBrowsable(EditorBrowsableState.Never)]
1211 public bool FocusableChildren
1215 SetValue(FocusableChildrenProperty, value);
1216 NotifyPropertyChanged();
1220 return (bool)GetValue(FocusableChildrenProperty);
1225 /// Whether this view can focus by touch.
1226 /// If Focusable is false, FocusableInTouch is disabled.
1227 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1229 [EditorBrowsable(EditorBrowsableState.Never)]
1230 public bool FocusableInTouch
1234 SetValue(FocusableInTouchProperty, value);
1235 NotifyPropertyChanged();
1239 return (bool)GetValue(FocusableInTouchProperty);
1244 /// Retrieves the position of the view.
1245 /// The coordinates are relative to the view's parent.
1248 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1249 /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
1250 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1251 /// and users can get the current actual values through them.
1253 /// <since_tizen> 3 </since_tizen>
1254 public Position CurrentPosition
1258 return GetCurrentPosition();
1263 /// Sets the size of a view for the width and the height.<br />
1264 /// Geometry can be scaled to fit within this area.<br />
1265 /// This does not interfere with the view's scale factor.<br />
1266 /// The views default depth is the minimum of width and height.<br />
1269 /// The property cascade chaining set is not recommended.
1272 /// This way is recommended for setting the property
1274 /// var view = new View();
1275 /// view.Size2D = new Size2D(100, 200);
1277 /// This way to set the property is prohibited
1279 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1282 /// <since_tizen> 3 </since_tizen>
1283 public Size2D Size2D
1287 var temp = (Size2D)GetValue(Size2DProperty);
1289 if (this.Layout == null)
1291 if (temp.Width < 0) { temp.Width = 0; }
1292 if (temp.Height < 0) { temp.Height = 0; }
1299 SetValue(Size2DProperty, value);
1301 NotifyPropertyChanged();
1306 /// Retrieves the size of the view.
1307 /// The coordinates are relative to the view's parent.
1310 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1311 /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
1312 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1313 /// and users can get the current actual values through them.
1315 /// <since_tizen> 3 </since_tizen>
1316 public Size2D CurrentSize
1320 return GetCurrentSize();
1325 /// Retrieves and sets the view's opacity.<br />
1329 /// Animatable - This property can be animated using <c>Animation</c> class.
1331 /// animation.AnimateTo(view, "Opacity", 0.5f);
1335 /// <since_tizen> 3 </since_tizen>
1336 public float Opacity
1340 return (float)GetValue(OpacityProperty);
1344 SetValue(OpacityProperty, value);
1345 NotifyPropertyChanged();
1350 /// Sets the position of the view for X and Y.<br />
1351 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1352 /// If the position inheritance is disabled, sets the world position.<br />
1355 /// The property cascade chaining set is not recommended.
1358 /// This way is recommended for setting the property
1360 /// var view = new View();
1361 /// view.Position2D = new Position2D(100, 200);
1363 /// This way to set the property is prohibited
1365 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1368 /// <since_tizen> 3 </since_tizen>
1369 public Position2D Position2D
1373 return (Position2D)GetValue(Position2DProperty);
1377 SetValue(Position2DProperty, value);
1378 NotifyPropertyChanged();
1383 /// Retrieves the screen position of the view.<br />
1385 /// <since_tizen> 3 </since_tizen>
1386 public Vector2 ScreenPosition
1390 return GetCurrentScreenPosition();
1395 /// Retrieves the screen position and size of the view.<br />
1398 /// The float type Rectangle class is not ready yet.
1399 /// Therefore, it transmits data in Vector4 class.
1400 /// This type should later be changed to the appropriate data type.
1402 [EditorBrowsable(EditorBrowsableState.Never)]
1403 public Vector4 ScreenPositionSize
1407 return GetCurrentScreenPositionSize();
1412 /// Determines whether the pivot point should be used to determine the position of the view.
1413 /// This is false by default.
1415 /// <remarks>If false, then the top-left of the view is used for the position.
1416 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1418 /// <since_tizen> 3 </since_tizen>
1419 public bool PositionUsesPivotPoint
1423 return (bool)GetValue(PositionUsesPivotPointProperty);
1427 SetValue(PositionUsesPivotPointProperty, value);
1428 NotifyPropertyChanged();
1433 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1435 /// <since_tizen> 3 </since_tizen>
1436 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1438 "View view = new View(); " +
1439 "view.PivotPoint = PivotPoint.Center; " +
1440 "view.PositionUsesPivotPoint = true;" +
1441 " This has been deprecated in API5 and will be removed in API8")]
1442 [EditorBrowsable(EditorBrowsableState.Never)]
1443 public bool PositionUsesAnchorPoint
1447 return (bool)GetValue(PositionUsesAnchorPointProperty);
1451 SetValue(PositionUsesAnchorPointProperty, value);
1455 private bool InternalPositionUsesAnchorPoint
1459 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
1463 Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
1464 NotifyPropertyChanged();
1469 /// Queries whether the view is connected to the stage.<br />
1470 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1472 /// <since_tizen> 3 </since_tizen>
1473 public bool IsOnWindow
1482 /// Gets the depth in the hierarchy for the view.
1484 /// <since_tizen> 3 </since_tizen>
1485 public int HierarchyDepth
1489 return GetHierarchyDepth();
1494 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1497 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1498 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1499 /// The values set by this property will likely change.
1501 /// <since_tizen> 3 </since_tizen>
1502 public int SiblingOrder
1506 return (int)GetValue(SiblingOrderProperty);
1510 SetValue(SiblingOrderProperty, value);
1512 Layout?.ChangeLayoutSiblingOrder(value);
1514 NotifyPropertyChanged();
1519 /// Returns the natural size of the view.
1522 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1524 /// <since_tizen> 5 </since_tizen>
1525 public Vector3 NaturalSize
1529 Vector3 ret = GetNaturalSize();
1530 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1536 /// Returns the natural size (Size2D) of the view.
1539 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1541 /// <since_tizen> 4 </since_tizen>
1542 public Size2D NaturalSize2D
1546 Vector3 temp = GetNaturalSize();
1547 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1551 sz = new Size2D((int)temp.Width, (int)temp.Height);
1559 /// Gets or sets the origin of a view within its parent's area.<br />
1560 /// 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 />
1561 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1562 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1564 /// <pre>The view has been initialized.</pre>
1565 /// <since_tizen> 3 </since_tizen>
1566 public Position ParentOrigin
1570 Position tmp = (Position)GetValue(ParentOriginProperty);
1571 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1575 SetValue(ParentOriginProperty, value);
1576 NotifyPropertyChanged();
1581 /// Gets or sets the anchor-point of a view.<br />
1582 /// 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 />
1583 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1584 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1585 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1586 /// <pre>The view has been initialized.</pre>
1589 /// The property cascade chaining set is not recommended.
1592 /// This way is recommended for setting the property
1594 /// var view = new View();
1595 /// view.PivotPoint = PivotPoint.Center;
1597 /// This way to set the property is prohibited
1599 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1602 /// <since_tizen> 3 </since_tizen>
1603 public Position PivotPoint
1607 return (Position)GetValue(PivotPointProperty);
1611 SetValue(PivotPointProperty, value);
1612 NotifyPropertyChanged();
1617 /// Gets or sets the size width of the view.
1621 /// Animatable - This property can be animated using <c>Animation</c> class.
1623 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1627 /// <since_tizen> 3 </since_tizen>
1628 public float SizeWidth
1632 return (float)GetValue(SizeWidthProperty);
1636 SetValue(SizeWidthProperty, value);
1637 NotifyPropertyChanged();
1642 /// Gets or sets the size height of the view.
1646 /// Animatable - This property can be animated using <c>Animation</c> class.
1649 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1652 /// <since_tizen> 3 </since_tizen>
1653 public float SizeHeight
1657 return (float)GetValue(SizeHeightProperty);
1661 SetValue(SizeHeightProperty, value);
1662 NotifyPropertyChanged();
1667 /// Gets or sets the position of the view.<br />
1668 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1669 /// If the position inheritance is disabled, sets the world position.<br />
1673 /// Animatable - This property can be animated using <c>Animation</c> class.
1675 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1678 /// The property cascade chaining set is not recommended.
1681 /// This way is recommended for setting the property
1683 /// var view = new View();
1684 /// view.Position = new Position(100, 200.5f, 0);
1686 /// This way to set the property is prohibited
1688 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1691 /// <since_tizen> 3 </since_tizen>
1692 public Position Position
1696 return (Position)GetValue(PositionProperty);
1700 SetValue(PositionProperty, value);
1701 NotifyPropertyChanged();
1706 /// Gets or sets the position X of the view.
1710 /// Animatable - This property can be animated using <c>Animation</c> class.
1712 /// animation.AnimateTo(view, "PositionX", 50.0f);
1716 /// <since_tizen> 3 </since_tizen>
1717 public float PositionX
1721 return (float)GetValue(PositionXProperty);
1725 SetValue(PositionXProperty, value);
1726 NotifyPropertyChanged();
1731 /// Gets or sets the position Y of the view.
1735 /// Animatable - This property can be animated using <c>Animation</c> class.
1737 /// animation.AnimateTo(view, "PositionY", 50.0f);
1741 /// <since_tizen> 3 </since_tizen>
1742 public float PositionY
1746 return (float)GetValue(PositionYProperty);
1750 SetValue(PositionYProperty, value);
1751 NotifyPropertyChanged();
1756 /// Gets or sets the position Z of the view.
1760 /// Animatable - This property can be animated using <c>Animation</c> class.
1762 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1766 /// <since_tizen> 3 </since_tizen>
1767 public float PositionZ
1771 return (float)GetValue(PositionZProperty);
1775 SetValue(PositionZProperty, value);
1776 NotifyPropertyChanged();
1781 /// Gets or sets the world position of the view.
1783 /// <since_tizen> 3 </since_tizen>
1784 public Vector3 WorldPosition
1788 return GetCurrentWorldPosition();
1793 /// Gets or sets the orientation of the view.<br />
1794 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1798 /// This is an asynchronous method.
1801 /// Animatable - This property can be animated using <c>Animation</c> class.
1803 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1807 /// <since_tizen> 3 </since_tizen>
1808 public Rotation Orientation
1812 return (Rotation)GetValue(OrientationProperty);
1816 SetValue(OrientationProperty, value);
1817 NotifyPropertyChanged();
1822 /// Gets or sets the world orientation of the view.<br />
1824 /// <since_tizen> 3 </since_tizen>
1825 public Rotation WorldOrientation
1829 Rotation temp = new Rotation();
1830 var pValue = GetProperty(View.Property.WorldOrientation);
1838 /// Gets or sets the scale factor applied to the view.<br />
1842 /// Animatable - This property can be animated using <c>Animation</c> class.
1844 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1847 /// The property cascade chaining set is not recommended.
1850 /// This way is recommended for setting the property
1852 /// var view = new View();
1853 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1855 /// This way to set the property is prohibited
1857 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1860 /// <since_tizen> 3 </since_tizen>
1861 public Vector3 Scale
1865 return (Vector3)GetValue(ScaleProperty);
1869 SetValue(ScaleProperty, value);
1870 NotifyPropertyChanged();
1875 /// Gets or sets the scale X factor applied to the view.
1879 /// Animatable - This property can be animated using <c>Animation</c> class.
1881 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1885 /// <since_tizen> 3 </since_tizen>
1890 return (float)GetValue(ScaleXProperty);
1894 SetValue(ScaleXProperty, value);
1895 NotifyPropertyChanged();
1900 /// Gets or sets the scale Y factor applied to the view.
1904 /// Animatable - This property can be animated using <c>Animation</c> class.
1906 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1910 /// <since_tizen> 3 </since_tizen>
1915 return (float)GetValue(ScaleYProperty);
1919 SetValue(ScaleYProperty, value);
1920 NotifyPropertyChanged();
1925 /// Gets or sets the scale Z factor applied to the view.
1929 /// Animatable - This property can be animated using <c>Animation</c> class.
1931 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1935 /// <since_tizen> 3 </since_tizen>
1940 return (float)GetValue(ScaleZProperty);
1944 SetValue(ScaleZProperty, value);
1945 NotifyPropertyChanged();
1950 /// Gets the world scale of the view.
1952 /// <since_tizen> 3 </since_tizen>
1953 public Vector3 WorldScale
1957 return GetCurrentWorldScale();
1962 /// Retrieves the visibility flag of the view.
1966 /// If the view is not visible, then the view and its children will not be rendered.
1967 /// 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.
1970 /// Animatable - This property can be animated using <c>Animation</c> class.
1972 /// animation.AnimateTo(view, "Visibility", false);
1976 /// <since_tizen> 3 </since_tizen>
1977 public bool Visibility
1981 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
1986 /// Gets the view's world color.
1988 /// <since_tizen> 3 </since_tizen>
1989 public Vector4 WorldColor
1993 return GetCurrentWorldColor();
1998 /// Gets or sets the view's name.
2000 /// <since_tizen> 3 </since_tizen>
2005 return (string)GetValue(NameProperty);
2009 SetValue(NameProperty, value);
2010 NotifyPropertyChanged();
2015 /// Get the number of children held by the view.
2017 /// <since_tizen> 3 </since_tizen>
2018 public new uint ChildCount
2022 return Convert.ToUInt32(Children.Count);
2027 /// Gets the view's ID.
2030 /// <since_tizen> 3 </since_tizen>
2040 /// Gets or sets the status of whether the view should emit touch or hover signals.
2041 /// If a View is made insensitive, then the View and its children are not hittable.
2043 /// <since_tizen> 3 </since_tizen>
2044 public bool Sensitive
2048 return (bool)GetValue(SensitiveProperty);
2052 SetValue(SensitiveProperty, value);
2053 NotifyPropertyChanged();
2058 /// Gets or sets the status of whether the view should be enabled user interactions.
2059 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2061 /// <since_tizen> tizen_next </since_tizen>
2062 [EditorBrowsable(EditorBrowsableState.Never)]
2063 public bool IsEnabled
2067 return (bool)GetValue(IsEnabledProperty);
2071 SetValue(IsEnabledProperty, value);
2072 NotifyPropertyChanged();
2077 /// 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.
2079 /// <since_tizen> 3 </since_tizen>
2080 public bool LeaveRequired
2084 return (bool)GetValue(LeaveRequiredProperty);
2088 SetValue(LeaveRequiredProperty, value);
2089 NotifyPropertyChanged();
2094 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2096 /// <since_tizen> 3 </since_tizen>
2097 public bool InheritOrientation
2101 return (bool)GetValue(InheritOrientationProperty);
2105 SetValue(InheritOrientationProperty, value);
2106 NotifyPropertyChanged();
2111 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2113 /// <since_tizen> 3 </since_tizen>
2114 public bool InheritScale
2118 return (bool)GetValue(InheritScaleProperty);
2122 SetValue(InheritScaleProperty, value);
2123 NotifyPropertyChanged();
2128 /// Gets or sets the status of how the view and its children should be drawn.<br />
2129 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2130 /// 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 />
2131 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2132 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2133 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2135 /// <since_tizen> 3 </since_tizen>
2136 public DrawModeType DrawMode
2140 return (DrawModeType)GetValue(DrawModeProperty);
2144 SetValue(DrawModeProperty, value);
2145 NotifyPropertyChanged();
2150 /// Gets or sets the relative to parent size factor of the view.<br />
2151 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2152 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2155 /// The property cascade chaining set is not recommended.
2158 /// This way is recommended for setting the property
2160 /// var text = new TextField();
2161 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2163 /// This way to set the property is prohibited
2165 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2168 /// <since_tizen> 3 </since_tizen>
2169 public Vector3 SizeModeFactor
2173 return (Vector3)GetValue(SizeModeFactorProperty);
2177 SetValue(SizeModeFactorProperty, value);
2178 NotifyPropertyChanged();
2183 /// Gets or sets the width resize policy to be used.
2185 /// <since_tizen> 3 </since_tizen>
2186 public ResizePolicyType WidthResizePolicy
2190 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2194 SetValue(WidthResizePolicyProperty, value);
2195 NotifyPropertyChanged();
2200 /// Gets or sets the height resize policy to be used.
2202 /// <since_tizen> 3 </since_tizen>
2203 public ResizePolicyType HeightResizePolicy
2207 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2211 SetValue(HeightResizePolicyProperty, value);
2212 NotifyPropertyChanged();
2217 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2218 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2220 /// <since_tizen> 3 </since_tizen>
2221 public SizeScalePolicyType SizeScalePolicy
2225 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2229 SetValue(SizeScalePolicyProperty, value);
2230 NotifyPropertyChanged();
2235 /// Gets or sets the status of whether the width size is dependent on the height size.
2237 /// <since_tizen> 3 </since_tizen>
2238 public bool WidthForHeight
2242 return (bool)GetValue(WidthForHeightProperty);
2246 SetValue(WidthForHeightProperty, value);
2247 NotifyPropertyChanged();
2252 /// Gets or sets the status of whether the height size is dependent on the width size.
2254 /// <since_tizen> 3 </since_tizen>
2255 public bool HeightForWidth
2259 return (bool)GetValue(HeightForWidthProperty);
2263 SetValue(HeightForWidthProperty, value);
2264 NotifyPropertyChanged();
2269 /// Gets or sets the padding for use in layout.
2272 /// The property cascade chaining set is not recommended.
2275 /// This way is recommended for setting the property
2277 /// var view = new View();
2278 /// view.Padding = new Extents(5, 5, 5, 5);
2280 /// This way to set the property is prohibited
2282 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2285 /// <since_tizen> 5 </since_tizen>
2286 public Extents Padding
2290 return (Extents)GetValue(PaddingProperty);
2294 SetValue(PaddingProperty, value);
2295 NotifyPropertyChanged();
2300 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2302 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2304 /// The property cascade chaining set is not recommended.
2307 /// This way is recommended for setting the property
2309 /// var view = new View();
2310 /// view.MinimumSize = new Size2D(100, 200);
2312 /// This way to set the property is prohibited
2314 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2317 /// <since_tizen> 3 </since_tizen>
2318 public Size2D MinimumSize
2322 return (Size2D)GetValue(MinimumSizeProperty);
2328 throw new ArgumentNullException(nameof(value));
2332 // Note: it only works if minimum size is >= than natural size.
2333 // To force the size it should be done through the width&height spec or Size2D.
2334 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2335 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2336 layout.RequestLayout();
2338 SetValue(MinimumSizeProperty, value);
2339 NotifyPropertyChanged();
2344 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2347 /// This way is recommended for setting the property
2349 /// var view = new View();
2350 /// view.MaximumSize = new Size2D(100, 200);
2352 /// This way to set the property is prohibited
2354 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2357 /// <since_tizen> 3 </since_tizen>
2358 public Size2D MaximumSize
2362 return (Size2D)GetValue(MaximumSizeProperty);
2366 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2367 // MATCH_PARENT spec + parent container size can be used to limit
2370 layout.RequestLayout();
2372 SetValue(MaximumSizeProperty, value);
2373 NotifyPropertyChanged();
2378 /// Gets or sets whether a child view inherits it's parent's position.<br />
2379 /// Default is to inherit.<br />
2380 /// 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 />
2382 /// <since_tizen> 3 </since_tizen>
2383 public bool InheritPosition
2387 return (bool)GetValue(InheritPositionProperty);
2391 SetValue(InheritPositionProperty, value);
2392 NotifyPropertyChanged();
2397 /// Gets or sets the clipping behavior (mode) of it's children.
2399 /// <since_tizen> 3 </since_tizen>
2400 public ClippingModeType ClippingMode
2404 return (ClippingModeType)GetValue(ClippingModeProperty);
2408 SetValue(ClippingModeProperty, value);
2409 NotifyPropertyChanged();
2414 /// Gets the number of renderers held by the view.
2416 /// <since_tizen> 3 </since_tizen>
2417 public uint RendererCount
2421 return GetRendererCount();
2426 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2429 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2431 /// <since_tizen> 3 </since_tizen>
2432 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2434 "View view = new View(); " +
2435 "view.PivotPoint = PivotPoint.Center; " +
2436 "view.PositionUsesPivotPoint = true;")]
2437 [EditorBrowsable(EditorBrowsableState.Never)]
2438 public Position AnchorPoint
2442 return GetValue(AnchorPointProperty) as Position;
2446 SetValue(AnchorPointProperty, value);
2450 private Position InternalAnchorPoint
2454 return GetCurrentAnchorPoint();
2458 SetAnchorPoint(value);
2459 NotifyPropertyChanged();
2464 /// Sets the size of a view for the width, the height and the depth.<br />
2465 /// Geometry can be scaled to fit within this area.<br />
2466 /// This does not interfere with the view's scale factor.<br />
2467 /// The views default depth is the minimum of width and height.<br />
2471 /// Animatable - This property can be animated using <c>Animation</c> class.
2473 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2476 /// The property cascade chaining set is not recommended.
2479 /// This way is recommended for setting the property
2481 /// var view = new View();
2482 /// view.Size = new Size(100.5f, 200, 0);
2484 /// This way to set the property is prohibited
2486 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2489 /// <since_tizen> 5 </since_tizen>
2494 return (Size)GetValue(SizeProperty);
2498 SetValue(SizeProperty, value);
2499 NotifyPropertyChanged();
2504 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2506 /// <since_tizen> 3 </since_tizen>
2507 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2509 "Container parent = view.GetParent(); " +
2510 "View view = parent as View;")]
2511 [EditorBrowsable(EditorBrowsableState.Never)]
2512 public new View Parent
2517 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2518 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2519 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2521 if (basehandle is Layer layer)
2523 ret = new View(Layer.getCPtr(layer).Handle, false);
2524 NUILog.Error("This Parent property is deprecated, should do not be used");
2528 ret = basehandle as View;
2531 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2532 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2534 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2540 /// Gets/Sets whether inherit parent's the layout Direction.
2542 /// <since_tizen> 4 </since_tizen>
2543 public bool InheritLayoutDirection
2547 return (bool)GetValue(InheritLayoutDirectionProperty);
2551 SetValue(InheritLayoutDirectionProperty, value);
2552 NotifyPropertyChanged();
2557 /// Gets/Sets the layout Direction.
2559 /// <since_tizen> 4 </since_tizen>
2560 public ViewLayoutDirectionType LayoutDirection
2564 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2568 SetValue(LayoutDirectionProperty, value);
2569 NotifyPropertyChanged();
2570 layout?.RequestLayout();
2575 /// Gets or sets the Margin for use in layout.
2578 /// Margin property is supported by Layout algorithms and containers.
2579 /// Please Set Layout if you want to use Margin property.
2580 /// The property cascade chaining set is not recommended.
2583 /// This way is recommended for setting the property
2585 /// var view = new View();
2586 /// view.Margin = new Extents(10, 5, 15, 20);
2588 /// This way to set the property is prohibited
2590 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2593 /// <since_tizen> 4 </since_tizen>
2594 public Extents Margin
2598 return (Extents)GetValue(MarginProperty);
2602 SetValue(MarginProperty, value);
2603 NotifyPropertyChanged();
2608 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2612 /// // matchParentView matches its size to its parent size.
2613 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2614 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2616 /// // wrapContentView wraps its children with their desired size.
2617 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2618 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2620 /// // exactSizeView shows itself with an exact size.
2621 /// exactSizeView.WidthSpecification = 100;
2622 /// exactSizeView.HeightSpecification = 100;
2625 /// <since_tizen> 6 </since_tizen>
2626 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2627 public int WidthSpecification
2631 return (int)GetValue(WidthSpecificationProperty);
2635 SetValue(WidthSpecificationProperty, value);
2636 NotifyPropertyChanged();
2640 private int InternalWidthSpecification
2648 if (value == widthPolicy)
2651 widthPolicy = value;
2652 if (widthPolicy >= 0)
2654 SizeWidth = widthPolicy;
2656 layout?.RequestLayout();
2661 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2665 /// // matchParentView matches its size to its parent size.
2666 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2667 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2669 /// // wrapContentView wraps its children with their desired size.
2670 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2671 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2673 /// // exactSizeView shows itself with an exact size.
2674 /// exactSizeView.WidthSpecification = 100;
2675 /// exactSizeView.HeightSpecification = 100;
2678 /// <since_tizen> 6 </since_tizen>
2679 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2680 public int HeightSpecification
2684 return (int)GetValue(HeightSpecificationProperty);
2688 SetValue(HeightSpecificationProperty, value);
2689 NotifyPropertyChanged();
2693 private int InternalHeightSpecification
2697 return heightPolicy;
2701 if (value == heightPolicy)
2704 heightPolicy = value;
2705 if (heightPolicy >= 0)
2707 SizeHeight = heightPolicy;
2709 layout?.RequestLayout();
2714 /// Gets the List of transitions for this View.
2716 /// <since_tizen> 6 </since_tizen>
2717 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2721 if (layoutTransitions == null)
2723 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2725 return layoutTransitions;
2730 /// Sets a layout transitions for this View.
2732 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2734 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2736 /// <since_tizen> 6 </since_tizen>
2737 public LayoutTransition LayoutTransition
2741 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2745 SetValue(LayoutTransitionProperty, value);
2746 NotifyPropertyChanged();
2750 private LayoutTransition InternalLayoutTransition
2754 return layoutTransition;
2760 throw new global::System.ArgumentNullException(nameof(value));
2762 if (layoutTransitions == null)
2764 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2767 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2769 AttachTransitionsToChildren(value);
2771 layoutTransition = value;
2776 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2779 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2781 /// <since_tizen> 4 </since_tizen>
2782 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2783 [EditorBrowsable(EditorBrowsableState.Never)]
2784 public Extents PaddingEX
2788 return GetValue(PaddingEXProperty) as Extents;
2792 SetValue(PaddingEXProperty, value);
2796 private Extents InternalPaddingEX
2800 Extents temp = new Extents(0, 0, 0, 0);
2801 var pValue = GetProperty(View.Property.PADDING);
2804 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2810 var temp = new Tizen.NUI.PropertyValue(value);
2811 SetProperty(View.Property.PADDING, temp);
2813 NotifyPropertyChanged();
2814 layout?.RequestLayout();
2819 /// The Color of View. This is an RGBA value.
2820 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2821 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2822 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2823 /// Inherient of color value depend on <see cref="ColorMode"/>.
2827 /// Animatable - This property can be animated using <c>Animation</c> class.
2829 /// The property cascade chaining set is not recommended.
2832 /// This way is recommended for setting the property
2834 /// var view = new View();
2835 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2837 /// This way to set the property is prohibited
2839 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2842 [EditorBrowsable(EditorBrowsableState.Never)]
2847 return (Color)GetValue(ColorProperty);
2851 SetValue(ColorProperty, value);
2852 NotifyPropertyChanged();
2857 /// The Red component of View.Color.
2861 /// Animatable - This property can be animated using <c>Animation</c> class.
2864 [EditorBrowsable(EditorBrowsableState.Never)]
2865 public float ColorRed
2869 return (float)GetValue(ColorRedProperty);
2873 SetValue(ColorRedProperty, value);
2874 NotifyPropertyChanged();
2879 /// The Green component of View.Color.
2883 /// Animatable - This property can be animated using <c>Animation</c> class.
2886 [EditorBrowsable(EditorBrowsableState.Never)]
2887 public float ColorGreen
2891 return (float)GetValue(ColorGreenProperty);
2895 SetValue(ColorGreenProperty, value);
2896 NotifyPropertyChanged();
2901 /// The Blue component of View.Color.
2905 /// Animatable - This property can be animated using <c>Animation</c> class.
2908 [EditorBrowsable(EditorBrowsableState.Never)]
2909 public float ColorBlue
2913 return (float)GetValue(ColorBlueProperty);
2917 SetValue(ColorBlueProperty, value);
2918 NotifyPropertyChanged();
2923 /// Set the layout on this View. Replaces any existing Layout.
2926 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2928 /// <since_tizen> 6 </since_tizen>
2929 public LayoutItem Layout
2933 return GetValue(LayoutProperty) as LayoutItem;
2937 SetValue(LayoutProperty, value);
2941 private LayoutItem InternalLayout
2949 // Do nothing if layout provided is already set on this View.
2950 if (value == layout)
2955 LayoutingDisabled = false;
2958 // If new layout being set already has a owner then that owner receives a replacement default layout.
2959 // First check if the layout to be set already has a owner.
2960 if (value?.Owner != null)
2962 // Previous owner of the layout gets a default layout as a replacement.
2963 value.Owner.Layout = new AbsoluteLayout()
2965 // Copy Margin and Padding to replacement LayoutGroup.
2966 Margin = value.Margin,
2967 Padding = value.Padding,
2971 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2972 // View if no replacement. Previously margin and padding values would have been moved from
2973 // the View to the layout.
2974 if (layout != null) // Existing layout
2978 // Existing layout being replaced so copy over margin and padding values.
2979 value.Margin = layout.Margin;
2980 value.Padding = layout.Padding;
2981 value.SetPositionByLayout = !excludeLayouting;
2985 // Layout not being replaced so restore margin and padding to View.
2986 SetValue(MarginProperty, layout.Margin);
2987 SetValue(PaddingProperty, layout.Padding);
2988 NotifyPropertyChanged();
2993 // First Layout to be added to the View hence copy
2995 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2998 Extents margin = Margin;
2999 Extents padding = Padding;
3000 bool setMargin = false;
3001 bool setPadding = false;
3003 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
3005 // If View already has a margin set then store it in Layout instead.
3006 value.Margin = margin;
3007 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
3011 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
3013 // If View already has a padding set then store it in Layout instead.
3014 value.Padding = padding;
3015 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
3019 if (setMargin || setPadding)
3021 NotifyPropertyChanged();
3024 value.SetPositionByLayout = !excludeLayouting;
3028 // Remove existing layout from it's parent layout group.
3031 // Set layout to this view
3037 /// The weight of the View, used to share available space in a layout with siblings.
3039 /// <since_tizen> 6 </since_tizen>
3049 layout?.RequestLayout();
3054 /// Whether to load the BackgroundImage synchronously.
3055 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3056 /// Note: For Normal Quad images only.
3058 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3059 [EditorBrowsable(EditorBrowsableState.Never)]
3060 public bool BackgroundImageSynchronosLoading
3064 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3068 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3069 NotifyPropertyChanged();
3073 private bool InternalBackgroundImageSynchronosLoading
3077 return BackgroundImageSynchronousLoading;
3081 BackgroundImageSynchronousLoading = value;
3086 /// Whether to load the BackgroundImage synchronously.
3087 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3088 /// Note: For Normal Quad images only.
3090 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3091 [EditorBrowsable(EditorBrowsableState.Never)]
3092 public bool BackgroundImageSynchronousLoading
3096 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3100 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3101 NotifyPropertyChanged();
3105 private bool InternalBackgroundImageSynchronousLoading
3109 return backgroundImageSynchronousLoading;
3113 backgroundImageSynchronousLoading = value;
3115 if (!string.IsNullOrEmpty(BackgroundImage))
3117 PropertyMap bgMap = this.Background;
3118 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3119 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3126 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3127 [EditorBrowsable(EditorBrowsableState.Never)]
3128 public Vector4 UpdateAreaHint
3132 return (Vector4)GetValue(UpdateAreaHintProperty);
3136 SetValue(UpdateAreaHintProperty, value);
3137 NotifyPropertyChanged();
3142 /// Enable/Disable ControlState propagation for children.
3143 /// It is false by default.
3144 /// If the View needs to share ControlState with descendants, please set it true.
3145 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3147 [EditorBrowsable(EditorBrowsableState.Never)]
3148 public bool EnableControlStatePropagation
3152 return (bool)GetValue(EnableControlStatePropagationProperty);
3156 SetValue(EnableControlStatePropagationProperty, value);
3157 NotifyPropertyChanged();
3161 private bool InternalEnableControlStatePropagation
3163 get => themeData?.ControlStatePropagation ?? false;
3166 if (InternalEnableControlStatePropagation == value) return;
3168 if (themeData == null) themeData = new ThemeData();
3170 themeData.ControlStatePropagation = value;
3172 foreach (View child in Children)
3174 child.EnableControlStatePropagation = value;
3180 /// The ControlStates can propagate from the parent.
3181 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3182 /// if parent view EnableControlState is true.
3183 /// <see cref="EnableControlState"/>.
3184 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3186 [EditorBrowsable(EditorBrowsableState.Never)]
3187 public ControlState PropagatableControlStates
3191 return (ControlState)GetValue(PropagatableControlStatesProperty);
3195 SetValue(PropagatableControlStatesProperty, value);
3196 NotifyPropertyChanged();
3200 private ControlState InternalPropagatableControlStates
3202 get => propagatableControlStates;
3203 set => propagatableControlStates = value;
3207 /// By default, it is false in View, true in Control.
3208 /// Note that if the value is true, the View will be a touch receptor.
3210 [EditorBrowsable(EditorBrowsableState.Never)]
3211 public bool EnableControlState
3215 return (bool)GetValue(EnableControlStateProperty);
3219 SetValue(EnableControlStateProperty, value);
3224 /// Whether the actor grab all touches even if touch leaves its boundary.
3226 /// <returns>true, if it grab all touch after start</returns>
3227 [EditorBrowsable(EditorBrowsableState.Never)]
3228 public bool GrabTouchAfterLeave
3232 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3236 SetValue(GrabTouchAfterLeaveProperty, value);
3240 private bool InternalGrabTouchAfterLeave
3244 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
3248 Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
3250 // Use custom HitTest callback only if GrabTouchAfterLeave is true.
3253 RegisterHitTestCallback();
3257 UnregisterHitTestCallback();
3260 NotifyPropertyChanged();
3265 /// Whether the view will only receive own touch.
3267 /// <returns>true, if it only receives touches that started from itself.</returns>
3268 [EditorBrowsable(EditorBrowsableState.Never)]
3269 public bool AllowOnlyOwnTouch
3273 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3277 SetValue(AllowOnlyOwnTouchProperty, value);
3281 private bool InternalAllowOnlyOwnTouch
3285 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
3289 Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
3290 NotifyPropertyChanged();
3295 /// Determines which blend equation will be used to render renderers of this actor.
3297 /// <returns>blend equation enum currently assigned</returns>
3298 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3299 [EditorBrowsable(EditorBrowsableState.Never)]
3300 public BlendEquationType BlendEquation
3304 return (BlendEquationType)GetValue(BlendEquationProperty);
3308 SetValue(BlendEquationProperty, value);
3312 private BlendEquationType InternalBlendEquation
3316 return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
3320 Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
3321 NotifyPropertyChanged();
3326 /// If the value is true, the View will change its style as the theme changes.
3327 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3329 /// <since_tizen> 9 </since_tizen>
3330 public bool ThemeChangeSensitive
3332 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3333 set => SetValue(ThemeChangeSensitiveProperty, value);
3337 /// Create Style, it is abstract function and must be override.
3339 [EditorBrowsable(EditorBrowsableState.Never)]
3340 protected virtual ViewStyle CreateViewStyle()
3342 return new ViewStyle();
3346 /// Called after the View's ControlStates changed.
3348 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3349 [EditorBrowsable(EditorBrowsableState.Never)]
3350 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3356 [EditorBrowsable(EditorBrowsableState.Never)]
3357 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3359 isThemeChanged = true;
3360 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3361 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3362 isThemeChanged = false;
3366 /// Apply style instance to the view.
3367 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3369 /// <since_tizen> 9 </since_tizen>
3370 public virtual void ApplyStyle(ViewStyle viewStyle)
3372 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3374 if (themeData == null) themeData = new ThemeData();
3376 themeData.viewStyle = viewStyle;
3378 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3384 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3386 if (bindablePropertyOfView == null)
3391 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3392 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3394 foreach (var sourceProperty in dirtyStyleProperties)
3396 var sourceValue = viewStyle.GetValue(sourceProperty);
3398 if (sourceValue == null)
3403 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3405 // Do not set value again when theme is changed and the value has been set already.
3406 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3411 if (destinationProperty != null)
3413 InternalSetValue(destinationProperty, sourceValue);
3419 /// Get whether the View is culled or not.
3420 /// True means that the View is out of the view frustum.
3423 /// Hidden-API (Inhouse-API).
3425 [EditorBrowsable(EditorBrowsableState.Never)]
3430 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
3435 /// Set or Get TransitionOptions for the page transition.
3436 /// This property is used to define how this view will be transitioned during Page switching.
3438 /// <since_tizen> 9 </since_tizen>
3439 public TransitionOptions TransitionOptions
3443 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3447 SetValue(TransitionOptionsProperty, value);
3448 NotifyPropertyChanged();
3452 private TransitionOptions InternalTransitionOptions
3456 transitionOptions = value;
3460 return transitionOptions;
3465 /// Called when the view is hit through TouchEvent or GestureEvent.
3466 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3467 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3468 /// User can override whether hit or not in HitTest.
3469 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3470 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3472 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3473 [EditorBrowsable(EditorBrowsableState.Never)]
3474 protected virtual bool HitTest(Touch touch)
3480 /// Retrieve the View's current Color.
3483 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3484 /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
3485 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3486 /// and users can get the current actual values through them.
3488 [EditorBrowsable(EditorBrowsableState.Never)]
3489 public Color CurrentColor => GetCurrentColor();
3492 /// Retrieve the current scale factor applied to the View.
3495 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3496 /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
3497 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3498 /// and users can get the current actual values through them.
3500 [EditorBrowsable(EditorBrowsableState.Never)]
3501 public Vector3 CurrentScale => GetCurrentScale();
3504 /// Gets the number of currently alived View object.
3506 [EditorBrowsable(EditorBrowsableState.Never)]
3507 public static int AliveCount => aliveCount;