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;
90 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
91 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
92 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
93 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
95 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
96 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
97 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
98 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
100 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
101 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
102 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
103 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
105 RegisterAccessibilityDelegate();
109 /// Accessibility mode for controlling View's Accessible implementation.
110 /// It is only relevant when deriving custom controls from View directly,
111 /// as classes derived from CustomView (or any of its subclasses) get the
112 /// Custom mode by default.
114 [EditorBrowsable(EditorBrowsableState.Never)]
115 public enum ViewAccessibilityMode
118 /// Default accessibility implementation. Overriding View.Accessibility...()
119 /// virtual methods will have no effect.
121 [EditorBrowsable(EditorBrowsableState.Never)]
124 /// Custom accessibility implementation. Overriding View.Accessibility...()
125 /// will be necessary to provide accessibility support for the View.
127 [EditorBrowsable(EditorBrowsableState.Never)]
131 private static IntPtr NewWithAccessibilityMode(ViewAccessibilityMode accessibilityMode)
133 switch (accessibilityMode)
135 case ViewAccessibilityMode.Custom:
137 return Interop.View.NewCustom();
139 case ViewAccessibilityMode.Default:
142 return Interop.View.New();
148 /// Creates a new instance of a view.
150 /// <since_tizen> 3 </since_tizen>
151 public View() : this(ViewAccessibilityMode.Default)
155 [EditorBrowsable(EditorBrowsableState.Never)]
156 public View(ViewAccessibilityMode accessibilityMode) : this(NewWithAccessibilityMode(accessibilityMode), true)
158 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
162 [EditorBrowsable(EditorBrowsableState.Never)]
163 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
168 /// Create a new instance of a View with setting the status of shown or hidden.
170 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
171 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
172 [EditorBrowsable(EditorBrowsableState.Never)]
173 public View(bool shown) : this(Interop.View.New(), true)
175 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
190 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
192 InitializeStyle(viewStyle);
195 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
199 PositionUsesPivotPoint = false;
200 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
201 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
210 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221 /// The event that is triggered when the View's ControlState is changed.
223 [EditorBrowsable(EditorBrowsableState.Never)]
224 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
226 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
230 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
232 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
233 [EditorBrowsable(EditorBrowsableState.Never)]
234 public bool LayoutSet
243 /// Flag to allow Layouting to be disabled for Views.
244 /// Once a View has a Layout set then any children added to Views from then on will receive
245 /// automatic Layouts.
247 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
248 [EditorBrowsable(EditorBrowsableState.Never)]
249 public static bool LayoutingDisabled { get; set; } = true;
252 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
254 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
255 [EditorBrowsable(EditorBrowsableState.Never)]
256 public static void SetDefaultGrabTouchAfterLeave(bool enable)
258 defaultGrabTouchAfterLeave = enable;
262 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
264 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
265 [EditorBrowsable(EditorBrowsableState.Never)]
266 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
268 defaultAllowOnlyOwnTouch = enable;
272 /// Deprecate. Do not use this.
273 /// The style instance applied to this view.
274 /// Note that do not modify the ViewStyle.
275 /// Modifying ViewStyle will affect other views with same ViewStyle.
277 [EditorBrowsable(EditorBrowsableState.Never)]
278 protected ViewStyle ViewStyle
282 if (themeData == null) themeData = new ThemeData();
284 if (themeData.viewStyle == null)
286 ApplyStyle(CreateViewStyle());
288 return themeData.viewStyle;
293 /// Get/Set the control state.
294 /// Note that the ControlState only available for the classes derived from Control.
295 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
296 /// please set <see cref="EnableControlState"/> to true.
298 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
299 [EditorBrowsable(EditorBrowsableState.Never)]
300 public ControlState ControlState
304 return themeData == null ? ControlState.Normal : themeData.controlStates;
308 if (ControlState == value)
313 var prevState = ControlState;
315 if (themeData == null) themeData = new ThemeData();
316 themeData.controlStates = value;
318 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
320 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
322 if (themeData.ControlStatePropagation)
324 foreach (View child in Children)
326 ControlState allowed = child.PropagatableControlStates;
327 if (allowed.Contains(ControlState.All))
329 child.ControlState = value;
333 ControlState newControlState = child.ControlState;
335 if (allowed.Contains(ControlState.Normal))
337 if (value.Contains(ControlState.Normal))
339 newControlState += ControlState.Normal;
343 newControlState -= ControlState.Normal;
347 if (allowed.Contains(ControlState.Disabled))
349 if (value.Contains(ControlState.Disabled))
351 newControlState += ControlState.Disabled;
355 newControlState -= ControlState.Disabled;
359 if (allowed.Contains(ControlState.Selected))
361 if (value.Contains(ControlState.Selected))
363 newControlState += ControlState.Selected;
367 newControlState -= ControlState.Selected;
371 if (allowed.Contains(ControlState.Pressed))
373 if (value.Contains(ControlState.Pressed))
375 newControlState += ControlState.Pressed;
379 newControlState -= ControlState.Pressed;
383 if (allowed.Contains(ControlState.Focused))
385 if (value.Contains(ControlState.Focused))
387 newControlState += ControlState.Focused;
391 newControlState -= ControlState.Focused;
395 if (allowed.Contains(ControlState.Other))
397 if (value.Contains(ControlState.Other))
399 newControlState += ControlState.Other;
403 newControlState -= ControlState.Other;
407 if (child.ControlState != newControlState)
408 child.ControlState = newControlState;
413 OnControlStateChanged(changeInfo);
415 ControlStateChangedEvent?.Invoke(this, changeInfo);
420 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
422 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
423 [EditorBrowsable(EditorBrowsableState.Never)]
424 public bool ExcludeLayouting
428 return (bool)GetValue(ExcludeLayoutingProperty);
432 SetValue(ExcludeLayoutingProperty, value);
433 NotifyPropertyChanged();
437 private bool InternalExcludeLayouting
441 return excludeLayouting;
445 excludeLayouting = value;
446 if (Layout != null && Layout.SetPositionByLayout == value)
448 Layout.SetPositionByLayout = !value;
449 Layout.RequestLayout();
455 /// The StyleName, type string.
456 /// The value indicates DALi style name defined in json theme file.
458 /// <since_tizen> 3 </since_tizen>
459 public string StyleName
463 return (string)GetValue(StyleNameProperty);
467 SetValue(StyleNameProperty, value);
468 NotifyPropertyChanged();
473 /// The KeyInputFocus, type bool.
475 [EditorBrowsable(EditorBrowsableState.Never)]
476 public bool KeyInputFocus
480 return (bool)GetValue(KeyInputFocusProperty);
484 SetValue(KeyInputFocusProperty, value);
485 NotifyPropertyChanged();
490 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
494 /// The property cascade chaining set is not recommended.
497 /// Animatable - This property can be animated using <c>Animation</c> class.
499 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
504 /// This way is recommended for setting the property
506 /// var view = new View();
507 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
509 /// This way to set the property is prohibited
511 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
514 /// <since_tizen> 3 </since_tizen>
515 public Color BackgroundColor
519 return (Color)GetValue(BackgroundColorProperty);
523 SetValue(BackgroundColorProperty, value);
524 NotifyPropertyChanged();
529 /// The mutually exclusive with "backgroundColor" and "background" type Map.
531 /// <since_tizen> 3 </since_tizen>
532 public string BackgroundImage
536 return (string)GetValue(BackgroundImageProperty);
540 SetValue(BackgroundImageProperty, value);
541 NotifyPropertyChanged();
546 /// Get or set the border of background image.
548 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
549 [EditorBrowsable(EditorBrowsableState.Never)]
550 public Rectangle BackgroundImageBorder
554 return (Rectangle)GetValue(BackgroundImageBorderProperty);
558 SetValue(BackgroundImageBorderProperty, value);
559 NotifyPropertyChanged();
564 /// The background of view.
566 /// <since_tizen> 3 </since_tizen>
567 public Tizen.NUI.PropertyMap Background
571 return (PropertyMap)GetValue(BackgroundProperty);
575 SetValue(BackgroundProperty, value);
576 NotifyPropertyChanged();
581 /// Describes a shadow as an image for a View.
582 /// It is null by default.
585 /// Getter returns copied instance of current shadow.
588 /// The mutually exclusive with "BoxShadow".
592 /// Animatable - This property can be animated using <c>Animation</c> class.
593 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
595 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
597 /// Animatable sub-property : Offset.
600 [EditorBrowsable(EditorBrowsableState.Never)]
601 public ImageShadow ImageShadow
605 return (ImageShadow)GetValue(ImageShadowProperty);
609 SetValue(ImageShadowProperty, value);
610 NotifyPropertyChanged();
615 /// Describes a box shaped shadow drawing for a View.
616 /// It is null by default.
619 /// The mutually exclusive with "ImageShadow".
623 /// Animatable - This property can be animated using <c>Animation</c> class.
624 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
626 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
628 /// Animatable sub-property : Offset, Color, BlurRadius.
631 /// <since_tizen> 9 </since_tizen>
632 public Shadow BoxShadow
636 return (Shadow)GetValue(BoxShadowProperty);
640 SetValue(BoxShadowProperty, value);
641 NotifyPropertyChanged();
646 /// The radius for the rounded corners of the View.
647 /// This will rounds background and shadow edges.
648 /// 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).
649 /// Each radius will clamp internally to the half of smaller of the view's width or height.
650 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
654 /// Animatable - This property can be animated using <c>Animation</c> class.
656 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
660 /// <since_tizen> 9 </since_tizen>
661 public Vector4 CornerRadius
665 return (Vector4)GetValue(CornerRadiusProperty);
669 SetValue(CornerRadiusProperty, value);
670 NotifyPropertyChanged();
675 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
676 /// It is absolute by default.
677 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
679 /// <since_tizen> 9 </since_tizen>
680 public VisualTransformPolicyType CornerRadiusPolicy
682 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
683 set => SetValue(CornerRadiusPolicyProperty, value);
687 /// The width for the borderline of the View.
691 /// Animatable - This property can be animated using <c>Animation</c> class.
693 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
696 /// Note that, an image background may not have borderline if it uses the Border property.
698 /// <since_tizen> 9 </since_tizen>
699 public float BorderlineWidth
703 return (float)GetValue(BorderlineWidthProperty);
707 SetValue(BorderlineWidthProperty, value);
708 NotifyPropertyChanged();
713 /// The color for the borderline of the View.
714 /// It is Color.Black by default.
718 /// Animatable - This property can be animated using <c>Animation</c> class.
720 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
724 /// <since_tizen> 9 </since_tizen>
725 public Color BorderlineColor
729 return (Color)GetValue(BorderlineColorProperty);
733 SetValue(BorderlineColorProperty, value);
734 NotifyPropertyChanged();
739 /// The color selector for the borderline of the View.
740 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
741 /// So this API is internally used only.
743 internal Selector<Color> BorderlineColorSelector
747 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
751 SetValue(BorderlineColorSelectorProperty, value);
752 NotifyPropertyChanged();
757 /// The Relative offset for the borderline of the View.
758 /// Recommended range : [-1.0f to 1.0f].
759 /// If -1.0f, draw borderline inside of the View.
760 /// If 1.0f, draw borderline outside of the View.
761 /// If 0.0f, draw borderline half inside and half outside.
762 /// It is 0.0f by default.
766 /// Animatable - This property can be animated using <c>Animation</c> class.
768 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
772 /// <since_tizen> 9 </since_tizen>
773 public float BorderlineOffset
777 return (float)GetValue(BorderlineOffsetProperty);
781 SetValue(BorderlineOffsetProperty, value);
782 NotifyPropertyChanged();
787 /// The current state of the view.
789 /// <since_tizen> 3 </since_tizen>
794 return (States)GetValue(StateProperty);
798 SetValue(StateProperty, value);
799 NotifyPropertyChanged();
804 /// The current sub state of the view.
806 /// <since_tizen> 3 </since_tizen>
807 public States SubState
811 return (States)GetValue(SubStateProperty);
815 SetValue(SubStateProperty, value);
816 NotifyPropertyChanged();
821 /// Displays a tooltip
823 /// <since_tizen> 3 </since_tizen>
824 public Tizen.NUI.PropertyMap Tooltip
828 return (PropertyMap)GetValue(TooltipProperty);
832 SetValue(TooltipProperty, value);
833 NotifyPropertyChanged();
838 /// Displays a tooltip as a text.
840 /// <since_tizen> 3 </since_tizen>
841 public string TooltipText
845 return GetValue(TooltipTextProperty) as string;
849 SetValue(TooltipTextProperty, value);
853 private string InternalTooltipText
857 using (var propertyValue = GetProperty(Property.TOOLTIP))
859 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
861 return retrivedValue;
863 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
864 return "error to get TooltipText";
869 var temp = new Tizen.NUI.PropertyValue(value);
870 SetProperty(View.Property.TOOLTIP, temp);
872 NotifyPropertyChanged();
877 /// The Child property of FlexContainer.<br />
878 /// The proportion of the free space in the container, the flex item will receive.<br />
879 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
881 /// <since_tizen> 3 </since_tizen>
882 [Obsolete("Deprecated in API8, will be removed in API10.")]
887 return (float)GetValue(FlexProperty);
891 SetValue(FlexProperty, value);
892 NotifyPropertyChanged();
897 /// The Child property of FlexContainer.<br />
898 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
900 /// <since_tizen> 3 </since_tizen>
901 [Obsolete("Deprecated in API8, will be removed in API10.")]
906 return (int)GetValue(AlignSelfProperty);
910 SetValue(AlignSelfProperty, value);
911 NotifyPropertyChanged();
916 /// The Child property of FlexContainer.<br />
917 /// The space around the flex item.<br />
920 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
922 /// <since_tizen> 3 </since_tizen>
923 [Obsolete("Deprecated in API8, will be removed in API10.")]
924 public Vector4 FlexMargin
928 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
929 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
933 SetValue(FlexMarginProperty, value);
934 NotifyPropertyChanged();
939 /// The top-left cell this child occupies, if not set, the first available cell is used.
942 /// The property cascade chaining set is not recommended.
943 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
946 /// This way is recommended for setting the property
948 /// var view = new View();
949 /// view.CellIndex = new Vector2(1, 3);
951 /// This way to set the property is prohibited
953 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
956 /// <since_tizen> 3 </since_tizen>
957 public Vector2 CellIndex
961 return (Vector2)GetValue(CellIndexProperty);
965 SetValue(CellIndexProperty, value);
966 NotifyPropertyChanged();
971 /// The number of rows this child occupies, if not set, the default value is 1.
974 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
976 /// <since_tizen> 3 </since_tizen>
981 return (float)GetValue(RowSpanProperty);
985 SetValue(RowSpanProperty, value);
986 NotifyPropertyChanged();
991 /// The number of columns this child occupies, if not set, the default value is 1.
994 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
996 /// <since_tizen> 3 </since_tizen>
997 public float ColumnSpan
1001 return (float)GetValue(ColumnSpanProperty);
1005 SetValue(ColumnSpanProperty, value);
1006 NotifyPropertyChanged();
1011 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
1014 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1016 /// <since_tizen> 3 </since_tizen>
1017 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1021 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1025 SetValue(CellHorizontalAlignmentProperty, value);
1026 NotifyPropertyChanged();
1031 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1034 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1036 /// <since_tizen> 3 </since_tizen>
1037 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1041 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1045 SetValue(CellVerticalAlignmentProperty, value);
1046 NotifyPropertyChanged();
1051 /// The left focusable view.<br />
1052 /// This will return null if not set.<br />
1053 /// This will also return null if the specified left focusable view is not on a window.<br />
1055 /// <since_tizen> 3 </since_tizen>
1056 public View LeftFocusableView
1058 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1061 return (View)GetValue(LeftFocusableViewProperty);
1065 SetValue(LeftFocusableViewProperty, value);
1066 NotifyPropertyChanged();
1071 /// The right focusable view.<br />
1072 /// This will return null if not set.<br />
1073 /// This will also return null if the specified right focusable view is not on a window.<br />
1075 /// <since_tizen> 3 </since_tizen>
1076 public View RightFocusableView
1078 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1081 return (View)GetValue(RightFocusableViewProperty);
1085 SetValue(RightFocusableViewProperty, value);
1086 NotifyPropertyChanged();
1091 /// The up focusable view.<br />
1092 /// This will return null if not set.<br />
1093 /// This will also return null if the specified up focusable view is not on a window.<br />
1095 /// <since_tizen> 3 </since_tizen>
1096 public View UpFocusableView
1098 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1101 return (View)GetValue(UpFocusableViewProperty);
1105 SetValue(UpFocusableViewProperty, value);
1106 NotifyPropertyChanged();
1111 /// The down focusable view.<br />
1112 /// This will return null if not set.<br />
1113 /// This will also return null if the specified down focusable view is not on a window.<br />
1115 /// <since_tizen> 3 </since_tizen>
1116 public View DownFocusableView
1118 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1121 return (View)GetValue(DownFocusableViewProperty);
1125 SetValue(DownFocusableViewProperty, value);
1126 NotifyPropertyChanged();
1131 /// The clockwise focusable view by rotary wheel.<br />
1132 /// This will return null if not set.<br />
1133 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1135 [EditorBrowsable(EditorBrowsableState.Never)]
1136 public View ClockwiseFocusableView
1138 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1141 return (View)GetValue(ClockwiseFocusableViewProperty);
1145 SetValue(ClockwiseFocusableViewProperty, value);
1146 NotifyPropertyChanged();
1151 /// The counter clockwise focusable view by rotary wheel.<br />
1152 /// This will return null if not set.<br />
1153 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1155 [EditorBrowsable(EditorBrowsableState.Never)]
1156 public View CounterClockwiseFocusableView
1158 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1161 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1165 SetValue(CounterClockwiseFocusableViewProperty, value);
1166 NotifyPropertyChanged();
1171 /// Whether the view should be focusable by keyboard navigation.
1173 /// <since_tizen> 3 </since_tizen>
1174 public bool Focusable
1178 SetValue(FocusableProperty, value);
1179 NotifyPropertyChanged();
1183 return (bool)GetValue(FocusableProperty);
1188 /// 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.
1189 /// Note : Default value is true.
1191 [EditorBrowsable(EditorBrowsableState.Never)]
1192 public bool FocusableChildren
1196 SetValue(FocusableChildrenProperty, value);
1197 NotifyPropertyChanged();
1201 return (bool)GetValue(FocusableChildrenProperty);
1206 /// Whether this view can focus by touch.
1207 /// If Focusable is false, FocusableInTouch is disabled.
1208 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1210 [EditorBrowsable(EditorBrowsableState.Never)]
1211 public bool FocusableInTouch
1215 SetValue(FocusableInTouchProperty, value);
1216 NotifyPropertyChanged();
1220 return (bool)GetValue(FocusableInTouchProperty);
1225 /// Retrieves the position of the view.
1226 /// The coordinates are relative to the view's parent.
1229 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1230 /// 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).
1231 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1232 /// and users can get the current actual values through them.
1234 /// <since_tizen> 3 </since_tizen>
1235 public Position CurrentPosition
1239 return GetCurrentPosition();
1244 /// Sets the size of a view for the width and the height.<br />
1245 /// Geometry can be scaled to fit within this area.<br />
1246 /// This does not interfere with the view's scale factor.<br />
1247 /// The views default depth is the minimum of width and height.<br />
1250 /// The property cascade chaining set is not recommended.
1253 /// This way is recommended for setting the property
1255 /// var view = new View();
1256 /// view.Size2D = new Size2D(100, 200);
1258 /// This way to set the property is prohibited
1260 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1263 /// <since_tizen> 3 </since_tizen>
1264 public Size2D Size2D
1268 var temp = (Size2D)GetValue(Size2DProperty);
1270 if (this.Layout == null)
1272 if (temp.Width < 0) { temp.Width = 0; }
1273 if (temp.Height < 0) { temp.Height = 0; }
1280 SetValue(Size2DProperty, value);
1282 NotifyPropertyChanged();
1287 /// Retrieves the size of the view.
1288 /// The coordinates are relative to the view's parent.
1291 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1292 /// 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).
1293 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1294 /// and users can get the current actual values through them.
1296 /// <since_tizen> 3 </since_tizen>
1297 public Size2D CurrentSize
1301 return GetCurrentSize();
1306 /// Retrieves and sets the view's opacity.<br />
1310 /// Animatable - This property can be animated using <c>Animation</c> class.
1312 /// animation.AnimateTo(view, "Opacity", 0.5f);
1316 /// <since_tizen> 3 </since_tizen>
1317 public float Opacity
1321 return (float)GetValue(OpacityProperty);
1325 SetValue(OpacityProperty, value);
1326 NotifyPropertyChanged();
1331 /// Sets the position of the view for X and Y.<br />
1332 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1333 /// If the position inheritance is disabled, sets the world position.<br />
1336 /// The property cascade chaining set is not recommended.
1339 /// This way is recommended for setting the property
1341 /// var view = new View();
1342 /// view.Position2D = new Position2D(100, 200);
1344 /// This way to set the property is prohibited
1346 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1349 /// <since_tizen> 3 </since_tizen>
1350 public Position2D Position2D
1354 return (Position2D)GetValue(Position2DProperty);
1358 SetValue(Position2DProperty, value);
1359 NotifyPropertyChanged();
1364 /// Retrieves the screen position of the view.<br />
1366 /// <since_tizen> 3 </since_tizen>
1367 public Vector2 ScreenPosition
1371 return GetCurrentScreenPosition();
1376 /// Retrieves the screen position and size of the view.<br />
1379 /// The float type Rectangle class is not ready yet.
1380 /// Therefore, it transmits data in Vector4 class.
1381 /// This type should later be changed to the appropriate data type.
1383 [EditorBrowsable(EditorBrowsableState.Never)]
1384 public Vector4 ScreenPositionSize
1388 return GetCurrentScreenPositionSize();
1393 /// Determines whether the pivot point should be used to determine the position of the view.
1394 /// This is false by default.
1396 /// <remarks>If false, then the top-left of the view is used for the position.
1397 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1399 /// <since_tizen> 3 </since_tizen>
1400 public bool PositionUsesPivotPoint
1404 return (bool)GetValue(PositionUsesPivotPointProperty);
1408 SetValue(PositionUsesPivotPointProperty, value);
1409 NotifyPropertyChanged();
1414 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1416 /// <since_tizen> 3 </since_tizen>
1417 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1419 "View view = new View(); " +
1420 "view.PivotPoint = PivotPoint.Center; " +
1421 "view.PositionUsesPivotPoint = true;" +
1422 " This has been deprecated in API5 and will be removed in API8")]
1423 [EditorBrowsable(EditorBrowsableState.Never)]
1424 public bool PositionUsesAnchorPoint
1428 return (bool)GetValue(PositionUsesAnchorPointProperty);
1432 SetValue(PositionUsesAnchorPointProperty, value);
1436 private bool InternalPositionUsesAnchorPoint
1440 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
1444 Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
1445 NotifyPropertyChanged();
1450 /// Queries whether the view is connected to the stage.<br />
1451 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1453 /// <since_tizen> 3 </since_tizen>
1454 public bool IsOnWindow
1463 /// Gets the depth in the hierarchy for the view.
1465 /// <since_tizen> 3 </since_tizen>
1466 public int HierarchyDepth
1470 return GetHierarchyDepth();
1475 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1478 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1479 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1480 /// The values set by this property will likely change.
1482 /// <since_tizen> 3 </since_tizen>
1483 public int SiblingOrder
1487 return (int)GetValue(SiblingOrderProperty);
1491 SetValue(SiblingOrderProperty, value);
1493 Layout?.ChangeLayoutSiblingOrder(value);
1495 NotifyPropertyChanged();
1500 /// Returns the natural size of the view.
1503 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1505 /// <since_tizen> 5 </since_tizen>
1506 public Vector3 NaturalSize
1510 Vector3 ret = GetNaturalSize();
1511 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1517 /// Returns the natural size (Size2D) of the view.
1520 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1522 /// <since_tizen> 4 </since_tizen>
1523 public Size2D NaturalSize2D
1527 Vector3 temp = GetNaturalSize();
1528 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1532 sz = new Size2D((int)temp.Width, (int)temp.Height);
1540 /// Gets or sets the origin of a view within its parent's area.<br />
1541 /// 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 />
1542 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1543 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1545 /// <pre>The view has been initialized.</pre>
1546 /// <since_tizen> 3 </since_tizen>
1547 public Position ParentOrigin
1551 Position tmp = (Position)GetValue(ParentOriginProperty);
1552 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1556 SetValue(ParentOriginProperty, value);
1557 NotifyPropertyChanged();
1562 /// Gets or sets the anchor-point of a view.<br />
1563 /// 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 />
1564 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1565 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1566 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1567 /// <pre>The view has been initialized.</pre>
1570 /// The property cascade chaining set is not recommended.
1573 /// This way is recommended for setting the property
1575 /// var view = new View();
1576 /// view.PivotPoint = PivotPoint.Center;
1578 /// This way to set the property is prohibited
1580 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1583 /// <since_tizen> 3 </since_tizen>
1584 public Position PivotPoint
1588 return (Position)GetValue(PivotPointProperty);
1592 SetValue(PivotPointProperty, value);
1593 NotifyPropertyChanged();
1598 /// Gets or sets the size width of the view.
1602 /// Animatable - This property can be animated using <c>Animation</c> class.
1604 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1608 /// <since_tizen> 3 </since_tizen>
1609 public float SizeWidth
1613 return (float)GetValue(SizeWidthProperty);
1617 SetValue(SizeWidthProperty, value);
1618 NotifyPropertyChanged();
1623 /// Gets or sets the size height of the view.
1627 /// Animatable - This property can be animated using <c>Animation</c> class.
1630 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1633 /// <since_tizen> 3 </since_tizen>
1634 public float SizeHeight
1638 return (float)GetValue(SizeHeightProperty);
1642 SetValue(SizeHeightProperty, value);
1643 NotifyPropertyChanged();
1648 /// Gets or sets the position of the view.<br />
1649 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1650 /// If the position inheritance is disabled, sets the world position.<br />
1654 /// Animatable - This property can be animated using <c>Animation</c> class.
1656 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1659 /// The property cascade chaining set is not recommended.
1662 /// This way is recommended for setting the property
1664 /// var view = new View();
1665 /// view.Position = new Position(100, 200.5f, 0);
1667 /// This way to set the property is prohibited
1669 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1672 /// <since_tizen> 3 </since_tizen>
1673 public Position Position
1677 return (Position)GetValue(PositionProperty);
1681 SetValue(PositionProperty, value);
1682 NotifyPropertyChanged();
1687 /// Gets or sets the position X of the view.
1691 /// Animatable - This property can be animated using <c>Animation</c> class.
1693 /// animation.AnimateTo(view, "PositionX", 50.0f);
1697 /// <since_tizen> 3 </since_tizen>
1698 public float PositionX
1702 return (float)GetValue(PositionXProperty);
1706 SetValue(PositionXProperty, value);
1707 NotifyPropertyChanged();
1712 /// Gets or sets the position Y of the view.
1716 /// Animatable - This property can be animated using <c>Animation</c> class.
1718 /// animation.AnimateTo(view, "PositionY", 50.0f);
1722 /// <since_tizen> 3 </since_tizen>
1723 public float PositionY
1727 return (float)GetValue(PositionYProperty);
1731 SetValue(PositionYProperty, value);
1732 NotifyPropertyChanged();
1737 /// Gets or sets the position Z of the view.
1741 /// Animatable - This property can be animated using <c>Animation</c> class.
1743 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1747 /// <since_tizen> 3 </since_tizen>
1748 public float PositionZ
1752 return (float)GetValue(PositionZProperty);
1756 SetValue(PositionZProperty, value);
1757 NotifyPropertyChanged();
1762 /// Gets or sets the world position of the view.
1764 /// <since_tizen> 3 </since_tizen>
1765 public Vector3 WorldPosition
1769 return GetCurrentWorldPosition();
1774 /// Gets or sets the orientation of the view.<br />
1775 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1779 /// This is an asynchronous method.
1782 /// Animatable - This property can be animated using <c>Animation</c> class.
1784 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1788 /// <since_tizen> 3 </since_tizen>
1789 public Rotation Orientation
1793 return (Rotation)GetValue(OrientationProperty);
1797 SetValue(OrientationProperty, value);
1798 NotifyPropertyChanged();
1803 /// Gets or sets the world orientation of the view.<br />
1805 /// <since_tizen> 3 </since_tizen>
1806 public Rotation WorldOrientation
1810 Rotation temp = new Rotation();
1811 var pValue = GetProperty(View.Property.WorldOrientation);
1819 /// Gets or sets the scale factor applied to the view.<br />
1823 /// Animatable - This property can be animated using <c>Animation</c> class.
1825 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1828 /// The property cascade chaining set is not recommended.
1831 /// This way is recommended for setting the property
1833 /// var view = new View();
1834 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1836 /// This way to set the property is prohibited
1838 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1841 /// <since_tizen> 3 </since_tizen>
1842 public Vector3 Scale
1846 return (Vector3)GetValue(ScaleProperty);
1850 SetValue(ScaleProperty, value);
1851 NotifyPropertyChanged();
1856 /// Gets or sets the scale X factor applied to the view.
1860 /// Animatable - This property can be animated using <c>Animation</c> class.
1862 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1866 /// <since_tizen> 3 </since_tizen>
1871 return (float)GetValue(ScaleXProperty);
1875 SetValue(ScaleXProperty, value);
1876 NotifyPropertyChanged();
1881 /// Gets or sets the scale Y factor applied to the view.
1885 /// Animatable - This property can be animated using <c>Animation</c> class.
1887 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1891 /// <since_tizen> 3 </since_tizen>
1896 return (float)GetValue(ScaleYProperty);
1900 SetValue(ScaleYProperty, value);
1901 NotifyPropertyChanged();
1906 /// Gets or sets the scale Z factor applied to the view.
1910 /// Animatable - This property can be animated using <c>Animation</c> class.
1912 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1916 /// <since_tizen> 3 </since_tizen>
1921 return (float)GetValue(ScaleZProperty);
1925 SetValue(ScaleZProperty, value);
1926 NotifyPropertyChanged();
1931 /// Gets the world scale of the view.
1933 /// <since_tizen> 3 </since_tizen>
1934 public Vector3 WorldScale
1938 return GetCurrentWorldScale();
1943 /// Retrieves the visibility flag of the view.
1947 /// If the view is not visible, then the view and its children will not be rendered.
1948 /// 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.
1951 /// Animatable - This property can be animated using <c>Animation</c> class.
1953 /// animation.AnimateTo(view, "Visibility", false);
1957 /// <since_tizen> 3 </since_tizen>
1958 public bool Visibility
1962 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
1967 /// Gets the view's world color.
1969 /// <since_tizen> 3 </since_tizen>
1970 public Vector4 WorldColor
1974 return GetCurrentWorldColor();
1979 /// Gets or sets the view's name.
1981 /// <since_tizen> 3 </since_tizen>
1986 return (string)GetValue(NameProperty);
1990 SetValue(NameProperty, value);
1991 NotifyPropertyChanged();
1996 /// Get the number of children held by the view.
1998 /// <since_tizen> 3 </since_tizen>
1999 public new uint ChildCount
2003 return Convert.ToUInt32(Children.Count);
2008 /// Gets the view's ID.
2011 /// <since_tizen> 3 </since_tizen>
2021 /// Gets or sets the status of whether the view should emit touch or hover signals.
2022 /// If a View is made insensitive, then the View and its children are not hittable.
2024 /// <since_tizen> 3 </since_tizen>
2025 public bool Sensitive
2029 return (bool)GetValue(SensitiveProperty);
2033 SetValue(SensitiveProperty, value);
2034 NotifyPropertyChanged();
2039 /// Gets or sets the status of whether the view should be enabled user interactions.
2040 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2042 /// <since_tizen> tizen_next </since_tizen>
2043 [EditorBrowsable(EditorBrowsableState.Never)]
2044 public bool IsEnabled
2048 return (bool)GetValue(IsEnabledProperty);
2052 SetValue(IsEnabledProperty, value);
2053 NotifyPropertyChanged();
2058 /// 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.
2060 /// <since_tizen> 3 </since_tizen>
2061 public bool LeaveRequired
2065 return (bool)GetValue(LeaveRequiredProperty);
2069 SetValue(LeaveRequiredProperty, value);
2070 NotifyPropertyChanged();
2075 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2077 /// <since_tizen> 3 </since_tizen>
2078 public bool InheritOrientation
2082 return (bool)GetValue(InheritOrientationProperty);
2086 SetValue(InheritOrientationProperty, value);
2087 NotifyPropertyChanged();
2092 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2094 /// <since_tizen> 3 </since_tizen>
2095 public bool InheritScale
2099 return (bool)GetValue(InheritScaleProperty);
2103 SetValue(InheritScaleProperty, value);
2104 NotifyPropertyChanged();
2109 /// Gets or sets the status of how the view and its children should be drawn.<br />
2110 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2111 /// 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 />
2112 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2113 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2114 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2116 /// <since_tizen> 3 </since_tizen>
2117 public DrawModeType DrawMode
2121 return (DrawModeType)GetValue(DrawModeProperty);
2125 SetValue(DrawModeProperty, value);
2126 NotifyPropertyChanged();
2131 /// Gets or sets the relative to parent size factor of the view.<br />
2132 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2133 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2136 /// The property cascade chaining set is not recommended.
2139 /// This way is recommended for setting the property
2141 /// var text = new TextField();
2142 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2144 /// This way to set the property is prohibited
2146 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2149 /// <since_tizen> 3 </since_tizen>
2150 public Vector3 SizeModeFactor
2154 return (Vector3)GetValue(SizeModeFactorProperty);
2158 SetValue(SizeModeFactorProperty, value);
2159 NotifyPropertyChanged();
2164 /// Gets or sets the width resize policy to be used.
2166 /// <since_tizen> 3 </since_tizen>
2167 public ResizePolicyType WidthResizePolicy
2171 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2175 SetValue(WidthResizePolicyProperty, value);
2176 NotifyPropertyChanged();
2181 /// Gets or sets the height resize policy to be used.
2183 /// <since_tizen> 3 </since_tizen>
2184 public ResizePolicyType HeightResizePolicy
2188 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2192 SetValue(HeightResizePolicyProperty, value);
2193 NotifyPropertyChanged();
2198 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2199 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2201 /// <since_tizen> 3 </since_tizen>
2202 public SizeScalePolicyType SizeScalePolicy
2206 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2210 SetValue(SizeScalePolicyProperty, value);
2211 NotifyPropertyChanged();
2216 /// Gets or sets the status of whether the width size is dependent on the height size.
2218 /// <since_tizen> 3 </since_tizen>
2219 public bool WidthForHeight
2223 return (bool)GetValue(WidthForHeightProperty);
2227 SetValue(WidthForHeightProperty, value);
2228 NotifyPropertyChanged();
2233 /// Gets or sets the status of whether the height size is dependent on the width size.
2235 /// <since_tizen> 3 </since_tizen>
2236 public bool HeightForWidth
2240 return (bool)GetValue(HeightForWidthProperty);
2244 SetValue(HeightForWidthProperty, value);
2245 NotifyPropertyChanged();
2250 /// Gets or sets the padding for use in layout.
2253 /// The property cascade chaining set is not recommended.
2256 /// This way is recommended for setting the property
2258 /// var view = new View();
2259 /// view.Padding = new Extents(5, 5, 5, 5);
2261 /// This way to set the property is prohibited
2263 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2266 /// <since_tizen> 5 </since_tizen>
2267 public Extents Padding
2271 return (Extents)GetValue(PaddingProperty);
2275 SetValue(PaddingProperty, value);
2276 NotifyPropertyChanged();
2281 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2283 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2285 /// The property cascade chaining set is not recommended.
2288 /// This way is recommended for setting the property
2290 /// var view = new View();
2291 /// view.MinimumSize = new Size2D(100, 200);
2293 /// This way to set the property is prohibited
2295 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2298 /// <since_tizen> 3 </since_tizen>
2299 public Size2D MinimumSize
2303 return (Size2D)GetValue(MinimumSizeProperty);
2309 throw new ArgumentNullException(nameof(value));
2313 // Note: it only works if minimum size is >= than natural size.
2314 // To force the size it should be done through the width&height spec or Size2D.
2315 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2316 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2317 layout.RequestLayout();
2319 SetValue(MinimumSizeProperty, value);
2320 NotifyPropertyChanged();
2325 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2328 /// This way is recommended for setting the property
2330 /// var view = new View();
2331 /// view.MaximumSize = new Size2D(100, 200);
2333 /// This way to set the property is prohibited
2335 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2338 /// <since_tizen> 3 </since_tizen>
2339 public Size2D MaximumSize
2343 return (Size2D)GetValue(MaximumSizeProperty);
2347 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2348 // MATCH_PARENT spec + parent container size can be used to limit
2351 layout.RequestLayout();
2353 SetValue(MaximumSizeProperty, value);
2354 NotifyPropertyChanged();
2359 /// Gets or sets whether a child view inherits it's parent's position.<br />
2360 /// Default is to inherit.<br />
2361 /// 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 />
2363 /// <since_tizen> 3 </since_tizen>
2364 public bool InheritPosition
2368 return (bool)GetValue(InheritPositionProperty);
2372 SetValue(InheritPositionProperty, value);
2373 NotifyPropertyChanged();
2378 /// Gets or sets the clipping behavior (mode) of it's children.
2380 /// <since_tizen> 3 </since_tizen>
2381 public ClippingModeType ClippingMode
2385 return (ClippingModeType)GetValue(ClippingModeProperty);
2389 SetValue(ClippingModeProperty, value);
2390 NotifyPropertyChanged();
2395 /// Gets the number of renderers held by the view.
2397 /// <since_tizen> 3 </since_tizen>
2398 public uint RendererCount
2402 return GetRendererCount();
2407 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2410 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2412 /// <since_tizen> 3 </since_tizen>
2413 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2415 "View view = new View(); " +
2416 "view.PivotPoint = PivotPoint.Center; " +
2417 "view.PositionUsesPivotPoint = true;")]
2418 [EditorBrowsable(EditorBrowsableState.Never)]
2419 public Position AnchorPoint
2423 return GetValue(AnchorPointProperty) as Position;
2427 SetValue(AnchorPointProperty, value);
2431 private Position InternalAnchorPoint
2435 return GetCurrentAnchorPoint();
2439 SetAnchorPoint(value);
2440 NotifyPropertyChanged();
2445 /// Sets the size of a view for the width, the height and the depth.<br />
2446 /// Geometry can be scaled to fit within this area.<br />
2447 /// This does not interfere with the view's scale factor.<br />
2448 /// The views default depth is the minimum of width and height.<br />
2452 /// Animatable - This property can be animated using <c>Animation</c> class.
2454 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2457 /// The property cascade chaining set is not recommended.
2460 /// This way is recommended for setting the property
2462 /// var view = new View();
2463 /// view.Size = new Size(100.5f, 200, 0);
2465 /// This way to set the property is prohibited
2467 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2470 /// <since_tizen> 5 </since_tizen>
2475 return (Size)GetValue(SizeProperty);
2479 SetValue(SizeProperty, value);
2480 NotifyPropertyChanged();
2485 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2487 /// <since_tizen> 3 </since_tizen>
2488 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2490 "Container parent = view.GetParent(); " +
2491 "View view = parent as View;")]
2492 [EditorBrowsable(EditorBrowsableState.Never)]
2493 public new View Parent
2498 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2499 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2500 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2502 if (basehandle is Layer layer)
2504 ret = new View(Layer.getCPtr(layer).Handle, false);
2505 NUILog.Error("This Parent property is deprecated, should do not be used");
2509 ret = basehandle as View;
2512 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2513 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2515 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2521 /// Gets/Sets whether inherit parent's the layout Direction.
2523 /// <since_tizen> 4 </since_tizen>
2524 public bool InheritLayoutDirection
2528 return (bool)GetValue(InheritLayoutDirectionProperty);
2532 SetValue(InheritLayoutDirectionProperty, value);
2533 NotifyPropertyChanged();
2538 /// Gets/Sets the layout Direction.
2540 /// <since_tizen> 4 </since_tizen>
2541 public ViewLayoutDirectionType LayoutDirection
2545 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2549 SetValue(LayoutDirectionProperty, value);
2550 NotifyPropertyChanged();
2551 layout?.RequestLayout();
2556 /// Gets or sets the Margin for use in layout.
2559 /// Margin property is supported by Layout algorithms and containers.
2560 /// Please Set Layout if you want to use Margin property.
2561 /// The property cascade chaining set is not recommended.
2564 /// This way is recommended for setting the property
2566 /// var view = new View();
2567 /// view.Margin = new Extents(10, 5, 15, 20);
2569 /// This way to set the property is prohibited
2571 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2574 /// <since_tizen> 4 </since_tizen>
2575 public Extents Margin
2579 return (Extents)GetValue(MarginProperty);
2583 SetValue(MarginProperty, value);
2584 NotifyPropertyChanged();
2589 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2593 /// // matchParentView matches its size to its parent size.
2594 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2595 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2597 /// // wrapContentView wraps its children with their desired size.
2598 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2599 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2601 /// // exactSizeView shows itself with an exact size.
2602 /// exactSizeView.WidthSpecification = 100;
2603 /// exactSizeView.HeightSpecification = 100;
2606 /// <since_tizen> 6 </since_tizen>
2607 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2608 public int WidthSpecification
2612 return (int)GetValue(WidthSpecificationProperty);
2616 SetValue(WidthSpecificationProperty, value);
2617 NotifyPropertyChanged();
2621 private int InternalWidthSpecification
2629 if (value == widthPolicy)
2632 widthPolicy = value;
2633 if (widthPolicy >= 0)
2635 SizeWidth = widthPolicy;
2637 layout?.RequestLayout();
2642 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2646 /// // matchParentView matches its size to its parent size.
2647 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2648 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2650 /// // wrapContentView wraps its children with their desired size.
2651 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2652 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2654 /// // exactSizeView shows itself with an exact size.
2655 /// exactSizeView.WidthSpecification = 100;
2656 /// exactSizeView.HeightSpecification = 100;
2659 /// <since_tizen> 6 </since_tizen>
2660 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2661 public int HeightSpecification
2665 return (int)GetValue(HeightSpecificationProperty);
2669 SetValue(HeightSpecificationProperty, value);
2670 NotifyPropertyChanged();
2674 private int InternalHeightSpecification
2678 return heightPolicy;
2682 if (value == heightPolicy)
2685 heightPolicy = value;
2686 if (heightPolicy >= 0)
2688 SizeHeight = heightPolicy;
2690 layout?.RequestLayout();
2695 /// Gets the List of transitions for this View.
2697 /// <since_tizen> 6 </since_tizen>
2698 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2702 if (layoutTransitions == null)
2704 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2706 return layoutTransitions;
2711 /// Sets a layout transitions for this View.
2713 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2715 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2717 /// <since_tizen> 6 </since_tizen>
2718 public LayoutTransition LayoutTransition
2722 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2726 SetValue(LayoutTransitionProperty, value);
2727 NotifyPropertyChanged();
2731 private LayoutTransition InternalLayoutTransition
2735 return layoutTransition;
2741 throw new global::System.ArgumentNullException(nameof(value));
2743 if (layoutTransitions == null)
2745 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2748 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2750 AttachTransitionsToChildren(value);
2752 layoutTransition = value;
2757 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2760 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2762 /// <since_tizen> 4 </since_tizen>
2763 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2764 [EditorBrowsable(EditorBrowsableState.Never)]
2765 public Extents PaddingEX
2769 return GetValue(PaddingEXProperty) as Extents;
2773 SetValue(PaddingEXProperty, value);
2777 private Extents InternalPaddingEX
2781 Extents temp = new Extents(0, 0, 0, 0);
2782 var pValue = GetProperty(View.Property.PADDING);
2785 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2791 var temp = new Tizen.NUI.PropertyValue(value);
2792 SetProperty(View.Property.PADDING, temp);
2794 NotifyPropertyChanged();
2795 layout?.RequestLayout();
2800 /// The Color of View. This is an RGBA value.
2801 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2802 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2803 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2804 /// Inherient of color value depend on <see cref="ColorMode"/>.
2808 /// Animatable - This property can be animated using <c>Animation</c> class.
2810 /// The property cascade chaining set is not recommended.
2813 /// This way is recommended for setting the property
2815 /// var view = new View();
2816 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2818 /// This way to set the property is prohibited
2820 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2823 [EditorBrowsable(EditorBrowsableState.Never)]
2828 return (Color)GetValue(ColorProperty);
2832 SetValue(ColorProperty, value);
2833 NotifyPropertyChanged();
2838 /// The Red component of View.Color.
2842 /// Animatable - This property can be animated using <c>Animation</c> class.
2845 [EditorBrowsable(EditorBrowsableState.Never)]
2846 public float ColorRed
2850 return (float)GetValue(ColorRedProperty);
2854 SetValue(ColorRedProperty, value);
2855 NotifyPropertyChanged();
2860 /// The Green component of View.Color.
2864 /// Animatable - This property can be animated using <c>Animation</c> class.
2867 [EditorBrowsable(EditorBrowsableState.Never)]
2868 public float ColorGreen
2872 return (float)GetValue(ColorGreenProperty);
2876 SetValue(ColorGreenProperty, value);
2877 NotifyPropertyChanged();
2882 /// The Blue component of View.Color.
2886 /// Animatable - This property can be animated using <c>Animation</c> class.
2889 [EditorBrowsable(EditorBrowsableState.Never)]
2890 public float ColorBlue
2894 return (float)GetValue(ColorBlueProperty);
2898 SetValue(ColorBlueProperty, value);
2899 NotifyPropertyChanged();
2904 /// Set the layout on this View. Replaces any existing Layout.
2907 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2909 /// <since_tizen> 6 </since_tizen>
2910 public LayoutItem Layout
2914 return GetValue(LayoutProperty) as LayoutItem;
2918 SetValue(LayoutProperty, value);
2922 private LayoutItem InternalLayout
2930 // Do nothing if layout provided is already set on this View.
2931 if (value == layout)
2936 LayoutingDisabled = false;
2939 // If new layout being set already has a owner then that owner receives a replacement default layout.
2940 // First check if the layout to be set already has a owner.
2941 if (value?.Owner != null)
2943 // Previous owner of the layout gets a default layout as a replacement.
2944 value.Owner.Layout = new AbsoluteLayout()
2946 // Copy Margin and Padding to replacement LayoutGroup.
2947 Margin = value.Margin,
2948 Padding = value.Padding,
2952 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2953 // View if no replacement. Previously margin and padding values would have been moved from
2954 // the View to the layout.
2955 if (layout != null) // Existing layout
2959 // Existing layout being replaced so copy over margin and padding values.
2960 value.Margin = layout.Margin;
2961 value.Padding = layout.Padding;
2962 value.SetPositionByLayout = !excludeLayouting;
2966 // Layout not being replaced so restore margin and padding to View.
2967 SetValue(MarginProperty, layout.Margin);
2968 SetValue(PaddingProperty, layout.Padding);
2969 NotifyPropertyChanged();
2974 // First Layout to be added to the View hence copy
2976 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2979 Extents margin = Margin;
2980 Extents padding = Padding;
2981 bool setMargin = false;
2982 bool setPadding = false;
2984 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2986 // If View already has a margin set then store it in Layout instead.
2987 value.Margin = margin;
2988 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2992 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
2994 // If View already has a padding set then store it in Layout instead.
2995 value.Padding = padding;
2996 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
3000 if (setMargin || setPadding)
3002 NotifyPropertyChanged();
3005 value.SetPositionByLayout = !excludeLayouting;
3009 // Remove existing layout from it's parent layout group.
3012 // Set layout to this view
3018 /// The weight of the View, used to share available space in a layout with siblings.
3020 /// <since_tizen> 6 </since_tizen>
3030 layout?.RequestLayout();
3035 /// Whether to load the BackgroundImage synchronously.
3036 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3037 /// Note: For Normal Quad images only.
3039 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3040 [EditorBrowsable(EditorBrowsableState.Never)]
3041 public bool BackgroundImageSynchronosLoading
3045 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3049 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3050 NotifyPropertyChanged();
3054 private bool InternalBackgroundImageSynchronosLoading
3058 return BackgroundImageSynchronousLoading;
3062 BackgroundImageSynchronousLoading = value;
3067 /// Whether to load the BackgroundImage synchronously.
3068 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3069 /// Note: For Normal Quad images only.
3071 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3072 [EditorBrowsable(EditorBrowsableState.Never)]
3073 public bool BackgroundImageSynchronousLoading
3077 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3081 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3082 NotifyPropertyChanged();
3086 private bool InternalBackgroundImageSynchronousLoading
3090 return backgroundImageSynchronousLoading;
3094 backgroundImageSynchronousLoading = value;
3096 if (!string.IsNullOrEmpty(BackgroundImage))
3098 PropertyMap bgMap = this.Background;
3099 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3100 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3107 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3108 [EditorBrowsable(EditorBrowsableState.Never)]
3109 public Vector4 UpdateAreaHint
3113 return (Vector4)GetValue(UpdateAreaHintProperty);
3117 SetValue(UpdateAreaHintProperty, value);
3118 NotifyPropertyChanged();
3123 /// Enable/Disable ControlState propagation for children.
3124 /// It is false by default.
3125 /// If the View needs to share ControlState with descendants, please set it true.
3126 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3128 [EditorBrowsable(EditorBrowsableState.Never)]
3129 public bool EnableControlStatePropagation
3133 return (bool)GetValue(EnableControlStatePropagationProperty);
3137 SetValue(EnableControlStatePropagationProperty, value);
3138 NotifyPropertyChanged();
3142 private bool InternalEnableControlStatePropagation
3144 get => themeData?.ControlStatePropagation ?? false;
3147 if (InternalEnableControlStatePropagation == value) return;
3149 if (themeData == null) themeData = new ThemeData();
3151 themeData.ControlStatePropagation = value;
3153 foreach (View child in Children)
3155 child.EnableControlStatePropagation = value;
3161 /// The ControlStates can propagate from the parent.
3162 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3163 /// if parent view EnableControlState is true.
3164 /// <see cref="EnableControlState"/>.
3165 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3167 [EditorBrowsable(EditorBrowsableState.Never)]
3168 public ControlState PropagatableControlStates
3172 return (ControlState)GetValue(PropagatableControlStatesProperty);
3176 SetValue(PropagatableControlStatesProperty, value);
3177 NotifyPropertyChanged();
3181 private ControlState InternalPropagatableControlStates
3183 get => propagatableControlStates;
3184 set => propagatableControlStates = value;
3188 /// By default, it is false in View, true in Control.
3189 /// Note that if the value is true, the View will be a touch receptor.
3191 [EditorBrowsable(EditorBrowsableState.Never)]
3192 public bool EnableControlState
3196 return (bool)GetValue(EnableControlStateProperty);
3200 SetValue(EnableControlStateProperty, value);
3205 /// Whether the actor grab all touches even if touch leaves its boundary.
3207 /// <returns>true, if it grab all touch after start</returns>
3208 [EditorBrowsable(EditorBrowsableState.Never)]
3209 public bool GrabTouchAfterLeave
3213 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3217 SetValue(GrabTouchAfterLeaveProperty, value);
3221 private bool InternalGrabTouchAfterLeave
3225 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
3229 Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
3231 // Use custom HitTest callback only if GrabTouchAfterLeave is true.
3234 RegisterHitTestCallback();
3238 UnregisterHitTestCallback();
3241 NotifyPropertyChanged();
3246 /// Whether the view will only receive own touch.
3248 /// <returns>true, if it only receives touches that started from itself.</returns>
3249 [EditorBrowsable(EditorBrowsableState.Never)]
3250 public bool AllowOnlyOwnTouch
3254 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3258 SetValue(AllowOnlyOwnTouchProperty, value);
3262 private bool InternalAllowOnlyOwnTouch
3266 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
3270 Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
3271 NotifyPropertyChanged();
3276 /// Determines which blend equation will be used to render renderers of this actor.
3278 /// <returns>blend equation enum currently assigned</returns>
3279 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3280 [EditorBrowsable(EditorBrowsableState.Never)]
3281 public BlendEquationType BlendEquation
3285 return (BlendEquationType)GetValue(BlendEquationProperty);
3289 SetValue(BlendEquationProperty, value);
3293 private BlendEquationType InternalBlendEquation
3297 return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
3301 Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
3302 NotifyPropertyChanged();
3307 /// If the value is true, the View will change its style as the theme changes.
3308 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3310 /// <since_tizen> 9 </since_tizen>
3311 public bool ThemeChangeSensitive
3313 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3314 set => SetValue(ThemeChangeSensitiveProperty, value);
3318 /// Create Style, it is abstract function and must be override.
3320 [EditorBrowsable(EditorBrowsableState.Never)]
3321 protected virtual ViewStyle CreateViewStyle()
3323 return new ViewStyle();
3327 /// Called after the View's ControlStates changed.
3329 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3330 [EditorBrowsable(EditorBrowsableState.Never)]
3331 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3337 [EditorBrowsable(EditorBrowsableState.Never)]
3338 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3340 isThemeChanged = true;
3341 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3342 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3343 isThemeChanged = false;
3347 /// Apply style instance to the view.
3348 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3350 /// <since_tizen> 9 </since_tizen>
3351 public virtual void ApplyStyle(ViewStyle viewStyle)
3353 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3355 if (themeData == null) themeData = new ThemeData();
3357 themeData.viewStyle = viewStyle;
3359 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3365 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3367 if (bindablePropertyOfView == null)
3372 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3373 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3375 foreach (var sourceProperty in dirtyStyleProperties)
3377 var sourceValue = viewStyle.GetValue(sourceProperty);
3379 if (sourceValue == null)
3384 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3386 // Do not set value again when theme is changed and the value has been set already.
3387 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3392 if (destinationProperty != null)
3394 InternalSetValue(destinationProperty, sourceValue);
3400 /// Get whether the View is culled or not.
3401 /// True means that the View is out of the view frustum.
3404 /// Hidden-API (Inhouse-API).
3406 [EditorBrowsable(EditorBrowsableState.Never)]
3411 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
3416 /// Set or Get TransitionOptions for the page transition.
3417 /// This property is used to define how this view will be transitioned during Page switching.
3419 /// <since_tizen> 9 </since_tizen>
3420 public TransitionOptions TransitionOptions
3424 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3428 SetValue(TransitionOptionsProperty, value);
3429 NotifyPropertyChanged();
3433 private TransitionOptions InternalTransitionOptions
3437 transitionOptions = value;
3441 return transitionOptions;
3446 /// Called when the view is hit through TouchEvent or GestureEvent.
3447 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3448 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3449 /// User can override whether hit or not in HitTest.
3450 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3451 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3453 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3454 [EditorBrowsable(EditorBrowsableState.Never)]
3455 protected virtual bool HitTest(Touch touch)
3461 /// Retrieve the View's current Color.
3464 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3465 /// 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).
3466 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3467 /// and users can get the current actual values through them.
3469 [EditorBrowsable(EditorBrowsableState.Never)]
3470 public Color CurrentColor => GetCurrentColor();
3473 /// Retrieve the current scale factor applied to the View.
3476 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3477 /// 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).
3478 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3479 /// and users can get the current actual values through them.
3481 [EditorBrowsable(EditorBrowsableState.Never)]
3482 public Vector3 CurrentScale => GetCurrentScale();