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 // List of dispatch Event
76 private PanGestureDetector panGestureDetector = null;
77 private LongPressGestureDetector longGestureDetector = null;
78 private PinchGestureDetector pinchGestureDetector = null;
79 private TapGestureDetector tapGestureDetector = null;
80 private RotationGestureDetector rotationGestureDetector = null;
81 private int configGestureCount = 0;
82 private bool dispatchTouchEvents = true;
83 private bool dispatchParentTouchEvents = true;
84 private bool dispatchGestureEvents = true;
85 private bool dispatchParentGestureEvents = true;
86 private string internalName = string.Empty;
87 private Position internalCurrentParentOrigin = null;
88 private Position internalCurrentAnchorPoint = null;
89 private Vector3 internalTargetSize = null;
90 private Size2D internalCurrentSize = null;
91 private Position internalCurrentPosition = null;
92 private Vector3 internalCurrentWorldPosition = null;
93 private Vector3 internalCurrentScale = null;
94 private Vector3 internalCurrentWorldScale = null;
95 private Vector4 internalCurrentColor = null;
96 private Vector4 internalCurrentWorldColor = null;
97 private Vector2 internalCurrentScreenPosition = null;
101 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
102 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
103 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
104 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
106 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
107 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
108 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
109 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
111 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
112 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
113 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
114 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
116 RegisterAccessibilityDelegate();
120 /// Accessibility mode for controlling View's Accessible implementation.
121 /// It is only relevant when deriving custom controls from View directly,
122 /// as classes derived from CustomView (or any of its subclasses) get the
123 /// Custom mode by default.
125 [EditorBrowsable(EditorBrowsableState.Never)]
126 public enum ViewAccessibilityMode
129 /// Default accessibility implementation. Overriding View.Accessibility...()
130 /// virtual methods will have no effect.
132 [EditorBrowsable(EditorBrowsableState.Never)]
135 /// Custom accessibility implementation. Overriding View.Accessibility...()
136 /// will be necessary to provide accessibility support for the View.
138 [EditorBrowsable(EditorBrowsableState.Never)]
142 private static IntPtr NewWithAccessibilityMode(ViewAccessibilityMode accessibilityMode)
144 switch (accessibilityMode)
146 case ViewAccessibilityMode.Custom:
148 return Interop.View.NewCustom();
150 case ViewAccessibilityMode.Default:
153 return Interop.View.New();
159 /// Creates a new instance of a view.
161 /// <since_tizen> 3 </since_tizen>
162 public View() : this(ViewAccessibilityMode.Default)
166 [EditorBrowsable(EditorBrowsableState.Never)]
167 public View(ViewAccessibilityMode accessibilityMode) : this(NewWithAccessibilityMode(accessibilityMode), true)
169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
172 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
173 [EditorBrowsable(EditorBrowsableState.Never)]
174 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
179 /// Create a new instance of a View with setting the status of shown or hidden.
181 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
182 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
183 [EditorBrowsable(EditorBrowsableState.Never)]
184 public View(bool shown) : this(Interop.View.New(), true)
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
201 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
203 InitializeStyle(viewStyle);
206 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
210 PositionUsesPivotPoint = false;
211 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
212 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
221 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
223 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 /// The event that is triggered when the View's ControlState is changed.
234 [EditorBrowsable(EditorBrowsableState.Never)]
235 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
237 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
241 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
243 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
244 [EditorBrowsable(EditorBrowsableState.Never)]
245 public bool LayoutSet
254 /// Flag to allow Layouting to be disabled for Views.
255 /// Once a View has a Layout set then any children added to Views from then on will receive
256 /// automatic Layouts.
258 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
259 [EditorBrowsable(EditorBrowsableState.Never)]
260 public static bool LayoutingDisabled { get; set; } = true;
263 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
265 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
266 [EditorBrowsable(EditorBrowsableState.Never)]
267 public static void SetDefaultGrabTouchAfterLeave(bool enable)
269 defaultGrabTouchAfterLeave = enable;
273 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
275 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
276 [EditorBrowsable(EditorBrowsableState.Never)]
277 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
279 defaultAllowOnlyOwnTouch = enable;
283 /// Deprecate. Do not use this.
284 /// The style instance applied to this view.
285 /// Note that do not modify the ViewStyle.
286 /// Modifying ViewStyle will affect other views with same ViewStyle.
288 [EditorBrowsable(EditorBrowsableState.Never)]
289 protected ViewStyle ViewStyle
293 if (themeData == null) themeData = new ThemeData();
295 if (themeData.viewStyle == null)
297 ApplyStyle(CreateViewStyle());
299 return themeData.viewStyle;
304 /// Get/Set the control state.
305 /// Note that the ControlState only available for the classes derived from Control.
306 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
307 /// please set <see cref="EnableControlState"/> to true.
309 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
310 [EditorBrowsable(EditorBrowsableState.Never)]
311 public ControlState ControlState
315 return themeData == null ? ControlState.Normal : themeData.controlStates;
319 if (ControlState == value)
324 var prevState = ControlState;
326 if (themeData == null) themeData = new ThemeData();
327 themeData.controlStates = value;
329 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
331 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
333 if (themeData.ControlStatePropagation)
335 foreach (View child in Children)
337 ControlState allowed = child.PropagatableControlStates;
338 if (allowed.Contains(ControlState.All))
340 child.ControlState = value;
344 ControlState newControlState = child.ControlState;
346 if (allowed.Contains(ControlState.Normal))
348 if (value.Contains(ControlState.Normal))
350 newControlState += ControlState.Normal;
354 newControlState -= ControlState.Normal;
358 if (allowed.Contains(ControlState.Disabled))
360 if (value.Contains(ControlState.Disabled))
362 newControlState += ControlState.Disabled;
366 newControlState -= ControlState.Disabled;
370 if (allowed.Contains(ControlState.Selected))
372 if (value.Contains(ControlState.Selected))
374 newControlState += ControlState.Selected;
378 newControlState -= ControlState.Selected;
382 if (allowed.Contains(ControlState.Pressed))
384 if (value.Contains(ControlState.Pressed))
386 newControlState += ControlState.Pressed;
390 newControlState -= ControlState.Pressed;
394 if (allowed.Contains(ControlState.Focused))
396 if (value.Contains(ControlState.Focused))
398 newControlState += ControlState.Focused;
402 newControlState -= ControlState.Focused;
406 if (allowed.Contains(ControlState.Other))
408 if (value.Contains(ControlState.Other))
410 newControlState += ControlState.Other;
414 newControlState -= ControlState.Other;
418 if (child.ControlState != newControlState)
419 child.ControlState = newControlState;
424 OnControlStateChanged(changeInfo);
426 ControlStateChangedEvent?.Invoke(this, changeInfo);
431 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
433 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
434 [EditorBrowsable(EditorBrowsableState.Never)]
435 public bool ExcludeLayouting
439 return (bool)GetValue(ExcludeLayoutingProperty);
443 SetValue(ExcludeLayoutingProperty, value);
444 NotifyPropertyChanged();
448 private bool InternalExcludeLayouting
452 return excludeLayouting;
456 excludeLayouting = value;
457 if (Layout != null && Layout.SetPositionByLayout == value)
459 Layout.SetPositionByLayout = !value;
460 Layout.RequestLayout();
466 /// The StyleName, type string.
467 /// The value indicates DALi style name defined in json theme file.
469 /// <since_tizen> 3 </since_tizen>
470 public string StyleName
474 return (string)GetValue(StyleNameProperty);
478 SetValue(StyleNameProperty, value);
479 NotifyPropertyChanged();
484 /// The KeyInputFocus, type bool.
486 [EditorBrowsable(EditorBrowsableState.Never)]
487 public bool KeyInputFocus
491 return (bool)GetValue(KeyInputFocusProperty);
495 SetValue(KeyInputFocusProperty, value);
496 NotifyPropertyChanged();
501 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
505 /// The property cascade chaining set is not recommended.
508 /// Animatable - This property can be animated using <c>Animation</c> class.
510 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
515 /// This way is recommended for setting the property
517 /// var view = new View();
518 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
520 /// This way to set the property is prohibited
522 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
525 /// <since_tizen> 3 </since_tizen>
526 public Color BackgroundColor
530 return (Color)GetValue(BackgroundColorProperty);
534 SetValue(BackgroundColorProperty, value);
535 NotifyPropertyChanged();
540 /// The mutually exclusive with "backgroundColor" and "background" type Map.
542 /// <since_tizen> 3 </since_tizen>
543 public string BackgroundImage
547 return (string)GetValue(BackgroundImageProperty);
551 SetValue(BackgroundImageProperty, value);
552 NotifyPropertyChanged();
557 /// Get or set the border of background image.
559 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
560 [EditorBrowsable(EditorBrowsableState.Never)]
561 public Rectangle BackgroundImageBorder
565 return (Rectangle)GetValue(BackgroundImageBorderProperty);
569 SetValue(BackgroundImageBorderProperty, value);
570 NotifyPropertyChanged();
575 /// The background of view.
577 /// <since_tizen> 3 </since_tizen>
578 public Tizen.NUI.PropertyMap Background
582 return (PropertyMap)GetValue(BackgroundProperty);
586 SetValue(BackgroundProperty, value);
587 NotifyPropertyChanged();
592 /// Describes a shadow as an image for a View.
593 /// It is null by default.
596 /// Getter returns copied instance of current shadow.
599 /// The mutually exclusive with "BoxShadow".
603 /// Animatable - This property can be animated using <c>Animation</c> class.
604 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
606 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
608 /// Animatable sub-property : Offset.
611 [EditorBrowsable(EditorBrowsableState.Never)]
612 public ImageShadow ImageShadow
616 return (ImageShadow)GetValue(ImageShadowProperty);
620 SetValue(ImageShadowProperty, value);
621 NotifyPropertyChanged();
626 /// Describes a box shaped shadow drawing for a View.
627 /// It is null by default.
630 /// The mutually exclusive with "ImageShadow".
634 /// Animatable - This property can be animated using <c>Animation</c> class.
635 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
637 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
639 /// Animatable sub-property : Offset, Color, BlurRadius.
642 /// <since_tizen> 9 </since_tizen>
643 public Shadow BoxShadow
647 return (Shadow)GetValue(BoxShadowProperty);
651 SetValue(BoxShadowProperty, value);
652 NotifyPropertyChanged();
657 /// The radius for the rounded corners of the View.
658 /// This will rounds background and shadow edges.
659 /// 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).
660 /// Each radius will clamp internally to the half of smaller of the view's width or height.
661 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
665 /// Animatable - This property can be animated using <c>Animation</c> class.
667 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
671 /// <since_tizen> 9 </since_tizen>
672 public Vector4 CornerRadius
676 return (Vector4)GetValue(CornerRadiusProperty);
680 SetValue(CornerRadiusProperty, value);
681 NotifyPropertyChanged();
686 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
687 /// It is absolute by default.
688 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
690 /// <since_tizen> 9 </since_tizen>
691 public VisualTransformPolicyType CornerRadiusPolicy
693 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
694 set => SetValue(CornerRadiusPolicyProperty, value);
698 /// The width for the borderline of the View.
702 /// Animatable - This property can be animated using <c>Animation</c> class.
704 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
707 /// Note that, an image background may not have borderline if it uses the Border property.
709 /// <since_tizen> 9 </since_tizen>
710 public float BorderlineWidth
714 return (float)GetValue(BorderlineWidthProperty);
718 SetValue(BorderlineWidthProperty, value);
719 NotifyPropertyChanged();
724 /// The color for the borderline of the View.
725 /// It is Color.Black by default.
729 /// Animatable - This property can be animated using <c>Animation</c> class.
731 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
735 /// <since_tizen> 9 </since_tizen>
736 public Color BorderlineColor
740 return (Color)GetValue(BorderlineColorProperty);
744 SetValue(BorderlineColorProperty, value);
745 NotifyPropertyChanged();
750 /// The color selector for the borderline of the View.
751 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
752 /// So this API is internally used only.
754 internal Selector<Color> BorderlineColorSelector
758 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
762 SetValue(BorderlineColorSelectorProperty, value);
763 NotifyPropertyChanged();
768 /// The Relative offset for the borderline of the View.
769 /// Recommended range : [-1.0f to 1.0f].
770 /// If -1.0f, draw borderline inside of the View.
771 /// If 1.0f, draw borderline outside of the View.
772 /// If 0.0f, draw borderline half inside and half outside.
773 /// It is 0.0f by default.
777 /// Animatable - This property can be animated using <c>Animation</c> class.
779 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
783 /// <since_tizen> 9 </since_tizen>
784 public float BorderlineOffset
788 return (float)GetValue(BorderlineOffsetProperty);
792 SetValue(BorderlineOffsetProperty, value);
793 NotifyPropertyChanged();
798 /// The current state of the view.
800 /// <since_tizen> 3 </since_tizen>
805 return (States)GetValue(StateProperty);
809 SetValue(StateProperty, value);
810 NotifyPropertyChanged();
815 /// The current sub state of the view.
817 /// <since_tizen> 3 </since_tizen>
818 public States SubState
822 return (States)GetValue(SubStateProperty);
826 SetValue(SubStateProperty, value);
827 NotifyPropertyChanged();
832 /// Displays a tooltip
834 /// <since_tizen> 3 </since_tizen>
835 public Tizen.NUI.PropertyMap Tooltip
839 return (PropertyMap)GetValue(TooltipProperty);
843 SetValue(TooltipProperty, value);
844 NotifyPropertyChanged();
849 /// Displays a tooltip as a text.
851 /// <since_tizen> 3 </since_tizen>
852 public string TooltipText
856 return GetValue(TooltipTextProperty) as string;
860 SetValue(TooltipTextProperty, value);
864 private string InternalTooltipText
868 using (var propertyValue = GetProperty(Property.TOOLTIP))
870 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
872 return retrivedValue;
874 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
875 return "error to get TooltipText";
880 var temp = new Tizen.NUI.PropertyValue(value);
881 SetProperty(View.Property.TOOLTIP, temp);
883 NotifyPropertyChanged();
888 /// The Child property of FlexContainer.<br />
889 /// The proportion of the free space in the container, the flex item will receive.<br />
890 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
892 /// <since_tizen> 3 </since_tizen>
893 [Obsolete("Deprecated in API8, will be removed in API10.")]
898 return (float)GetValue(FlexProperty);
902 SetValue(FlexProperty, value);
903 NotifyPropertyChanged();
908 /// The Child property of FlexContainer.<br />
909 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
911 /// <since_tizen> 3 </since_tizen>
912 [Obsolete("Deprecated in API8, will be removed in API10.")]
917 return (int)GetValue(AlignSelfProperty);
921 SetValue(AlignSelfProperty, value);
922 NotifyPropertyChanged();
927 /// The Child property of FlexContainer.<br />
928 /// The space around the flex item.<br />
931 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
933 /// <since_tizen> 3 </since_tizen>
934 [Obsolete("Deprecated in API8, will be removed in API10.")]
935 public Vector4 FlexMargin
939 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
940 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
944 SetValue(FlexMarginProperty, value);
945 NotifyPropertyChanged();
950 /// The top-left cell this child occupies, if not set, the first available cell is used.
953 /// The property cascade chaining set is not recommended.
954 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
957 /// This way is recommended for setting the property
959 /// var view = new View();
960 /// view.CellIndex = new Vector2(1, 3);
962 /// This way to set the property is prohibited
964 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
967 /// <since_tizen> 3 </since_tizen>
968 public Vector2 CellIndex
972 return (Vector2)GetValue(CellIndexProperty);
976 SetValue(CellIndexProperty, value);
977 NotifyPropertyChanged();
982 /// The number of rows this child occupies, if not set, the default value is 1.
985 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
987 /// <since_tizen> 3 </since_tizen>
992 return (float)GetValue(RowSpanProperty);
996 SetValue(RowSpanProperty, value);
997 NotifyPropertyChanged();
1002 /// The number of columns this child occupies, if not set, the default value is 1.
1005 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1007 /// <since_tizen> 3 </since_tizen>
1008 public float ColumnSpan
1012 return (float)GetValue(ColumnSpanProperty);
1016 SetValue(ColumnSpanProperty, value);
1017 NotifyPropertyChanged();
1022 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
1025 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1027 /// <since_tizen> 3 </since_tizen>
1028 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1032 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1036 SetValue(CellHorizontalAlignmentProperty, value);
1037 NotifyPropertyChanged();
1042 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1045 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1047 /// <since_tizen> 3 </since_tizen>
1048 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1052 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1056 SetValue(CellVerticalAlignmentProperty, value);
1057 NotifyPropertyChanged();
1062 /// The left focusable view.<br />
1063 /// This will return null if not set.<br />
1064 /// This will also return null if the specified left focusable view is not on a window.<br />
1066 /// <since_tizen> 3 </since_tizen>
1067 public View LeftFocusableView
1069 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1072 return (View)GetValue(LeftFocusableViewProperty);
1076 SetValue(LeftFocusableViewProperty, value);
1077 NotifyPropertyChanged();
1082 /// The right focusable view.<br />
1083 /// This will return null if not set.<br />
1084 /// This will also return null if the specified right focusable view is not on a window.<br />
1086 /// <since_tizen> 3 </since_tizen>
1087 public View RightFocusableView
1089 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1092 return (View)GetValue(RightFocusableViewProperty);
1096 SetValue(RightFocusableViewProperty, value);
1097 NotifyPropertyChanged();
1102 /// The up focusable view.<br />
1103 /// This will return null if not set.<br />
1104 /// This will also return null if the specified up focusable view is not on a window.<br />
1106 /// <since_tizen> 3 </since_tizen>
1107 public View UpFocusableView
1109 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1112 return (View)GetValue(UpFocusableViewProperty);
1116 SetValue(UpFocusableViewProperty, value);
1117 NotifyPropertyChanged();
1122 /// The down focusable view.<br />
1123 /// This will return null if not set.<br />
1124 /// This will also return null if the specified down focusable view is not on a window.<br />
1126 /// <since_tizen> 3 </since_tizen>
1127 public View DownFocusableView
1129 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1132 return (View)GetValue(DownFocusableViewProperty);
1136 SetValue(DownFocusableViewProperty, value);
1137 NotifyPropertyChanged();
1142 /// The clockwise focusable view by rotary wheel.<br />
1143 /// This will return null if not set.<br />
1144 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1146 [EditorBrowsable(EditorBrowsableState.Never)]
1147 public View ClockwiseFocusableView
1149 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1152 return (View)GetValue(ClockwiseFocusableViewProperty);
1156 SetValue(ClockwiseFocusableViewProperty, value);
1157 NotifyPropertyChanged();
1162 /// The counter clockwise focusable view by rotary wheel.<br />
1163 /// This will return null if not set.<br />
1164 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1166 [EditorBrowsable(EditorBrowsableState.Never)]
1167 public View CounterClockwiseFocusableView
1169 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1172 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1176 SetValue(CounterClockwiseFocusableViewProperty, value);
1177 NotifyPropertyChanged();
1182 /// Whether the view should be focusable by keyboard navigation.
1184 /// <since_tizen> 3 </since_tizen>
1185 public bool Focusable
1189 SetValue(FocusableProperty, value);
1190 NotifyPropertyChanged();
1194 return (bool)GetValue(FocusableProperty);
1199 /// 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.
1200 /// Note : Default value is true.
1202 [EditorBrowsable(EditorBrowsableState.Never)]
1203 public bool FocusableChildren
1207 SetValue(FocusableChildrenProperty, value);
1208 NotifyPropertyChanged();
1212 return (bool)GetValue(FocusableChildrenProperty);
1217 /// Whether this view can focus by touch.
1218 /// If Focusable is false, FocusableInTouch is disabled.
1219 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1221 [EditorBrowsable(EditorBrowsableState.Never)]
1222 public bool FocusableInTouch
1226 SetValue(FocusableInTouchProperty, value);
1227 NotifyPropertyChanged();
1231 return (bool)GetValue(FocusableInTouchProperty);
1236 /// Retrieves the position of the view.
1237 /// The coordinates are relative to the view's parent.
1240 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1241 /// 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).
1242 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1243 /// and users can get the current actual values through them.
1245 /// <since_tizen> 3 </since_tizen>
1246 public Position CurrentPosition
1250 return GetCurrentPosition();
1255 /// Sets the size of a view for the width and the height.<br />
1256 /// Geometry can be scaled to fit within this area.<br />
1257 /// This does not interfere with the view's scale factor.<br />
1258 /// The views default depth is the minimum of width and height.<br />
1261 /// The property cascade chaining set is not recommended.
1264 /// This way is recommended for setting the property
1266 /// var view = new View();
1267 /// view.Size2D = new Size2D(100, 200);
1269 /// This way to set the property is prohibited
1271 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1274 /// <since_tizen> 3 </since_tizen>
1275 public Size2D Size2D
1279 var temp = (Size2D)GetValue(Size2DProperty);
1281 if (this.Layout == null)
1283 if (temp.Width < 0) { temp.Width = 0; }
1284 if (temp.Height < 0) { temp.Height = 0; }
1291 SetValue(Size2DProperty, value);
1293 NotifyPropertyChanged();
1298 /// Retrieves the size of the view.
1299 /// The coordinates are relative to the view's parent.
1302 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1303 /// 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).
1304 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1305 /// and users can get the current actual values through them.
1307 /// <since_tizen> 3 </since_tizen>
1308 public Size2D CurrentSize
1312 return GetCurrentSize();
1317 /// Retrieves and sets the view's opacity.<br />
1321 /// Animatable - This property can be animated using <c>Animation</c> class.
1323 /// animation.AnimateTo(view, "Opacity", 0.5f);
1327 /// <since_tizen> 3 </since_tizen>
1328 public float Opacity
1332 return (float)GetValue(OpacityProperty);
1336 SetValue(OpacityProperty, value);
1337 NotifyPropertyChanged();
1342 /// Sets the position of the view for X and Y.<br />
1343 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1344 /// If the position inheritance is disabled, sets the world position.<br />
1347 /// The property cascade chaining set is not recommended.
1350 /// This way is recommended for setting the property
1352 /// var view = new View();
1353 /// view.Position2D = new Position2D(100, 200);
1355 /// This way to set the property is prohibited
1357 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1360 /// <since_tizen> 3 </since_tizen>
1361 public Position2D Position2D
1365 return (Position2D)GetValue(Position2DProperty);
1369 SetValue(Position2DProperty, value);
1370 NotifyPropertyChanged();
1375 /// Retrieves the screen position of the view.<br />
1377 /// <since_tizen> 3 </since_tizen>
1378 public Vector2 ScreenPosition
1382 return GetCurrentScreenPosition();
1387 /// Retrieves the screen position and size of the view.<br />
1390 /// The float type Rectangle class is not ready yet.
1391 /// Therefore, it transmits data in Vector4 class.
1392 /// This type should later be changed to the appropriate data type.
1394 [EditorBrowsable(EditorBrowsableState.Never)]
1395 public Vector4 ScreenPositionSize
1399 return GetCurrentScreenPositionSize();
1404 /// Determines whether the pivot point should be used to determine the position of the view.
1405 /// This is false by default.
1407 /// <remarks>If false, then the top-left of the view is used for the position.
1408 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1410 /// <since_tizen> 3 </since_tizen>
1411 public bool PositionUsesPivotPoint
1415 return (bool)GetValue(PositionUsesPivotPointProperty);
1419 SetValue(PositionUsesPivotPointProperty, value);
1420 NotifyPropertyChanged();
1425 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1427 /// <since_tizen> 3 </since_tizen>
1428 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1430 "View view = new View(); " +
1431 "view.PivotPoint = PivotPoint.Center; " +
1432 "view.PositionUsesPivotPoint = true;" +
1433 " This has been deprecated in API5 and will be removed in API8")]
1434 [EditorBrowsable(EditorBrowsableState.Never)]
1435 public bool PositionUsesAnchorPoint
1439 return (bool)GetValue(PositionUsesAnchorPointProperty);
1443 SetValue(PositionUsesAnchorPointProperty, value);
1447 private bool InternalPositionUsesAnchorPoint
1451 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
1455 Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
1456 NotifyPropertyChanged();
1461 /// Queries whether the view is connected to the stage.<br />
1462 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1464 /// <since_tizen> 3 </since_tizen>
1465 public bool IsOnWindow
1474 /// Gets the depth in the hierarchy for the view.
1476 /// <since_tizen> 3 </since_tizen>
1477 public int HierarchyDepth
1481 return GetHierarchyDepth();
1486 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1489 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1490 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1491 /// The values set by this property will likely change.
1493 /// <since_tizen> 3 </since_tizen>
1494 public int SiblingOrder
1498 return (int)GetValue(SiblingOrderProperty);
1502 SetValue(SiblingOrderProperty, value);
1504 Layout?.ChangeLayoutSiblingOrder(value);
1506 NotifyPropertyChanged();
1511 /// Returns the natural size of the view.
1514 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1516 /// <since_tizen> 5 </since_tizen>
1517 public Vector3 NaturalSize
1521 Vector3 ret = GetNaturalSize();
1522 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1528 /// Returns the natural size (Size2D) of the view.
1531 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1533 /// <since_tizen> 4 </since_tizen>
1534 public Size2D NaturalSize2D
1538 Vector3 temp = GetNaturalSize();
1539 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1543 sz = new Size2D((int)temp.Width, (int)temp.Height);
1551 /// Gets or sets the origin of a view within its parent's area.<br />
1552 /// 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 />
1553 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1554 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1556 /// <pre>The view has been initialized.</pre>
1557 /// <since_tizen> 3 </since_tizen>
1558 public Position ParentOrigin
1562 Position tmp = (Position)GetValue(ParentOriginProperty);
1563 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1567 SetValue(ParentOriginProperty, value);
1568 NotifyPropertyChanged();
1573 /// Gets or sets the anchor-point of a view.<br />
1574 /// 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 />
1575 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1576 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1577 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1578 /// <pre>The view has been initialized.</pre>
1581 /// The property cascade chaining set is not recommended.
1584 /// This way is recommended for setting the property
1586 /// var view = new View();
1587 /// view.PivotPoint = PivotPoint.Center;
1589 /// This way to set the property is prohibited
1591 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1594 /// <since_tizen> 3 </since_tizen>
1595 public Position PivotPoint
1599 return (Position)GetValue(PivotPointProperty);
1603 SetValue(PivotPointProperty, value);
1604 NotifyPropertyChanged();
1609 /// Gets or sets the size width of the view.
1613 /// Animatable - This property can be animated using <c>Animation</c> class.
1615 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1619 /// <since_tizen> 3 </since_tizen>
1620 public float SizeWidth
1624 return (float)GetValue(SizeWidthProperty);
1628 SetValue(SizeWidthProperty, value);
1629 NotifyPropertyChanged();
1634 /// Gets or sets the size height of the view.
1638 /// Animatable - This property can be animated using <c>Animation</c> class.
1641 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1644 /// <since_tizen> 3 </since_tizen>
1645 public float SizeHeight
1649 return (float)GetValue(SizeHeightProperty);
1653 SetValue(SizeHeightProperty, value);
1654 NotifyPropertyChanged();
1659 /// Gets or sets the position of the view.<br />
1660 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1661 /// If the position inheritance is disabled, sets the world position.<br />
1665 /// Animatable - This property can be animated using <c>Animation</c> class.
1667 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1670 /// The property cascade chaining set is not recommended.
1673 /// This way is recommended for setting the property
1675 /// var view = new View();
1676 /// view.Position = new Position(100, 200.5f, 0);
1678 /// This way to set the property is prohibited
1680 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1683 /// <since_tizen> 3 </since_tizen>
1684 public Position Position
1688 return (Position)GetValue(PositionProperty);
1692 SetValue(PositionProperty, value);
1693 NotifyPropertyChanged();
1698 /// Gets or sets the position X of the view.
1702 /// Animatable - This property can be animated using <c>Animation</c> class.
1704 /// animation.AnimateTo(view, "PositionX", 50.0f);
1708 /// <since_tizen> 3 </since_tizen>
1709 public float PositionX
1713 return (float)GetValue(PositionXProperty);
1717 SetValue(PositionXProperty, value);
1718 NotifyPropertyChanged();
1723 /// Gets or sets the position Y of the view.
1727 /// Animatable - This property can be animated using <c>Animation</c> class.
1729 /// animation.AnimateTo(view, "PositionY", 50.0f);
1733 /// <since_tizen> 3 </since_tizen>
1734 public float PositionY
1738 return (float)GetValue(PositionYProperty);
1742 SetValue(PositionYProperty, value);
1743 NotifyPropertyChanged();
1748 /// Gets or sets the position Z of the view.
1752 /// Animatable - This property can be animated using <c>Animation</c> class.
1754 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1758 /// <since_tizen> 3 </since_tizen>
1759 public float PositionZ
1763 return (float)GetValue(PositionZProperty);
1767 SetValue(PositionZProperty, value);
1768 NotifyPropertyChanged();
1773 /// Gets or sets the world position of the view.
1775 /// <since_tizen> 3 </since_tizen>
1776 public Vector3 WorldPosition
1780 return GetCurrentWorldPosition();
1785 /// Gets or sets the orientation of the view.<br />
1786 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1790 /// This is an asynchronous method.
1793 /// Animatable - This property can be animated using <c>Animation</c> class.
1795 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1799 /// <since_tizen> 3 </since_tizen>
1800 public Rotation Orientation
1804 return (Rotation)GetValue(OrientationProperty);
1808 SetValue(OrientationProperty, value);
1809 NotifyPropertyChanged();
1814 /// Gets or sets the world orientation of the view.<br />
1816 /// <since_tizen> 3 </since_tizen>
1817 public Rotation WorldOrientation
1821 Rotation temp = new Rotation();
1822 var pValue = GetProperty(View.Property.WorldOrientation);
1830 /// Gets or sets the scale factor applied to the view.<br />
1834 /// Animatable - This property can be animated using <c>Animation</c> class.
1836 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1839 /// The property cascade chaining set is not recommended.
1842 /// This way is recommended for setting the property
1844 /// var view = new View();
1845 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1847 /// This way to set the property is prohibited
1849 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1852 /// <since_tizen> 3 </since_tizen>
1853 public Vector3 Scale
1857 return (Vector3)GetValue(ScaleProperty);
1861 SetValue(ScaleProperty, value);
1862 NotifyPropertyChanged();
1867 /// Gets or sets the scale X factor applied to the view.
1871 /// Animatable - This property can be animated using <c>Animation</c> class.
1873 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1877 /// <since_tizen> 3 </since_tizen>
1882 return (float)GetValue(ScaleXProperty);
1886 SetValue(ScaleXProperty, value);
1887 NotifyPropertyChanged();
1892 /// Gets or sets the scale Y factor applied to the view.
1896 /// Animatable - This property can be animated using <c>Animation</c> class.
1898 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1902 /// <since_tizen> 3 </since_tizen>
1907 return (float)GetValue(ScaleYProperty);
1911 SetValue(ScaleYProperty, value);
1912 NotifyPropertyChanged();
1917 /// Gets or sets the scale Z factor applied to the view.
1921 /// Animatable - This property can be animated using <c>Animation</c> class.
1923 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1927 /// <since_tizen> 3 </since_tizen>
1932 return (float)GetValue(ScaleZProperty);
1936 SetValue(ScaleZProperty, value);
1937 NotifyPropertyChanged();
1942 /// Gets the world scale of the view.
1944 /// <since_tizen> 3 </since_tizen>
1945 public Vector3 WorldScale
1949 return GetCurrentWorldScale();
1954 /// Retrieves the visibility flag of the view.
1958 /// If the view is not visible, then the view and its children will not be rendered.
1959 /// 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.
1962 /// Animatable - This property can be animated using <c>Animation</c> class.
1964 /// animation.AnimateTo(view, "Visibility", false);
1968 /// <since_tizen> 3 </since_tizen>
1969 public bool Visibility
1973 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
1978 /// Gets the view's world color.
1980 /// <since_tizen> 3 </since_tizen>
1981 public Vector4 WorldColor
1985 return GetCurrentWorldColor();
1990 /// Gets or sets the view's name.
1992 /// <since_tizen> 3 </since_tizen>
1997 return (string)GetValue(NameProperty);
2001 SetValue(NameProperty, value);
2002 NotifyPropertyChanged();
2007 /// Get the number of children held by the view.
2009 /// <since_tizen> 3 </since_tizen>
2010 public new uint ChildCount
2014 return Convert.ToUInt32(Children.Count);
2019 /// Gets the view's ID.
2022 /// <since_tizen> 3 </since_tizen>
2032 /// Gets or sets the status of whether the view should emit touch or hover signals.
2033 /// If a View is made insensitive, then the View and its children are not hittable.
2035 /// <since_tizen> 3 </since_tizen>
2036 public bool Sensitive
2040 return (bool)GetValue(SensitiveProperty);
2044 SetValue(SensitiveProperty, value);
2045 NotifyPropertyChanged();
2050 /// Gets or sets the status of whether the view should be enabled user interactions.
2051 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2053 /// <since_tizen> tizen_next </since_tizen>
2054 [EditorBrowsable(EditorBrowsableState.Never)]
2055 public bool IsEnabled
2059 return (bool)GetValue(IsEnabledProperty);
2063 SetValue(IsEnabledProperty, value);
2064 NotifyPropertyChanged();
2069 /// 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.
2071 /// <since_tizen> 3 </since_tizen>
2072 public bool LeaveRequired
2076 return (bool)GetValue(LeaveRequiredProperty);
2080 SetValue(LeaveRequiredProperty, value);
2081 NotifyPropertyChanged();
2086 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2088 /// <since_tizen> 3 </since_tizen>
2089 public bool InheritOrientation
2093 return (bool)GetValue(InheritOrientationProperty);
2097 SetValue(InheritOrientationProperty, value);
2098 NotifyPropertyChanged();
2103 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2105 /// <since_tizen> 3 </since_tizen>
2106 public bool InheritScale
2110 return (bool)GetValue(InheritScaleProperty);
2114 SetValue(InheritScaleProperty, value);
2115 NotifyPropertyChanged();
2120 /// Gets or sets the status of how the view and its children should be drawn.<br />
2121 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2122 /// 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 />
2123 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2124 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2125 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2127 /// <since_tizen> 3 </since_tizen>
2128 public DrawModeType DrawMode
2132 return (DrawModeType)GetValue(DrawModeProperty);
2136 SetValue(DrawModeProperty, value);
2137 NotifyPropertyChanged();
2142 /// Gets or sets the relative to parent size factor of the view.<br />
2143 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2144 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2147 /// The property cascade chaining set is not recommended.
2150 /// This way is recommended for setting the property
2152 /// var text = new TextField();
2153 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2155 /// This way to set the property is prohibited
2157 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2160 /// <since_tizen> 3 </since_tizen>
2161 public Vector3 SizeModeFactor
2165 return (Vector3)GetValue(SizeModeFactorProperty);
2169 SetValue(SizeModeFactorProperty, value);
2170 NotifyPropertyChanged();
2175 /// Gets or sets the width resize policy to be used.
2177 /// <since_tizen> 3 </since_tizen>
2178 public ResizePolicyType WidthResizePolicy
2182 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2186 SetValue(WidthResizePolicyProperty, value);
2187 NotifyPropertyChanged();
2192 /// Gets or sets the height resize policy to be used.
2194 /// <since_tizen> 3 </since_tizen>
2195 public ResizePolicyType HeightResizePolicy
2199 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2203 SetValue(HeightResizePolicyProperty, value);
2204 NotifyPropertyChanged();
2209 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2210 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2212 /// <since_tizen> 3 </since_tizen>
2213 public SizeScalePolicyType SizeScalePolicy
2217 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2221 SetValue(SizeScalePolicyProperty, value);
2222 NotifyPropertyChanged();
2227 /// Gets or sets the status of whether the width size is dependent on the height size.
2229 /// <since_tizen> 3 </since_tizen>
2230 public bool WidthForHeight
2234 return (bool)GetValue(WidthForHeightProperty);
2238 SetValue(WidthForHeightProperty, value);
2239 NotifyPropertyChanged();
2244 /// Gets or sets the status of whether the height size is dependent on the width size.
2246 /// <since_tizen> 3 </since_tizen>
2247 public bool HeightForWidth
2251 return (bool)GetValue(HeightForWidthProperty);
2255 SetValue(HeightForWidthProperty, value);
2256 NotifyPropertyChanged();
2261 /// Gets or sets the padding for use in layout.
2264 /// The property cascade chaining set is not recommended.
2267 /// This way is recommended for setting the property
2269 /// var view = new View();
2270 /// view.Padding = new Extents(5, 5, 5, 5);
2272 /// This way to set the property is prohibited
2274 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2277 /// <since_tizen> 5 </since_tizen>
2278 public Extents Padding
2282 return (Extents)GetValue(PaddingProperty);
2286 SetValue(PaddingProperty, value);
2287 NotifyPropertyChanged();
2292 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2294 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2296 /// The property cascade chaining set is not recommended.
2299 /// This way is recommended for setting the property
2301 /// var view = new View();
2302 /// view.MinimumSize = new Size2D(100, 200);
2304 /// This way to set the property is prohibited
2306 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2309 /// <since_tizen> 3 </since_tizen>
2310 public Size2D MinimumSize
2314 return (Size2D)GetValue(MinimumSizeProperty);
2320 throw new ArgumentNullException(nameof(value));
2324 // Note: it only works if minimum size is >= than natural size.
2325 // To force the size it should be done through the width&height spec or Size2D.
2326 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2327 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2328 layout.RequestLayout();
2330 SetValue(MinimumSizeProperty, value);
2331 NotifyPropertyChanged();
2336 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2339 /// This way is recommended for setting the property
2341 /// var view = new View();
2342 /// view.MaximumSize = new Size2D(100, 200);
2344 /// This way to set the property is prohibited
2346 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2349 /// <since_tizen> 3 </since_tizen>
2350 public Size2D MaximumSize
2354 return (Size2D)GetValue(MaximumSizeProperty);
2358 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2359 // MATCH_PARENT spec + parent container size can be used to limit
2362 layout.RequestLayout();
2364 SetValue(MaximumSizeProperty, value);
2365 NotifyPropertyChanged();
2370 /// Gets or sets whether a child view inherits it's parent's position.<br />
2371 /// Default is to inherit.<br />
2372 /// 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 />
2374 /// <since_tizen> 3 </since_tizen>
2375 public bool InheritPosition
2379 return (bool)GetValue(InheritPositionProperty);
2383 SetValue(InheritPositionProperty, value);
2384 NotifyPropertyChanged();
2389 /// Gets or sets the clipping behavior (mode) of it's children.
2391 /// <since_tizen> 3 </since_tizen>
2392 public ClippingModeType ClippingMode
2396 return (ClippingModeType)GetValue(ClippingModeProperty);
2400 SetValue(ClippingModeProperty, value);
2401 NotifyPropertyChanged();
2406 /// Gets the number of renderers held by the view.
2408 /// <since_tizen> 3 </since_tizen>
2409 public uint RendererCount
2413 return GetRendererCount();
2418 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2421 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2423 /// <since_tizen> 3 </since_tizen>
2424 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2426 "View view = new View(); " +
2427 "view.PivotPoint = PivotPoint.Center; " +
2428 "view.PositionUsesPivotPoint = true;")]
2429 [EditorBrowsable(EditorBrowsableState.Never)]
2430 public Position AnchorPoint
2434 return GetValue(AnchorPointProperty) as Position;
2438 SetValue(AnchorPointProperty, value);
2442 private Position InternalAnchorPoint
2446 return GetCurrentAnchorPoint();
2450 SetAnchorPoint(value);
2451 NotifyPropertyChanged();
2456 /// Sets the size of a view for the width, the height and the depth.<br />
2457 /// Geometry can be scaled to fit within this area.<br />
2458 /// This does not interfere with the view's scale factor.<br />
2459 /// The views default depth is the minimum of width and height.<br />
2463 /// Animatable - This property can be animated using <c>Animation</c> class.
2465 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2468 /// The property cascade chaining set is not recommended.
2471 /// This way is recommended for setting the property
2473 /// var view = new View();
2474 /// view.Size = new Size(100.5f, 200, 0);
2476 /// This way to set the property is prohibited
2478 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2481 /// <since_tizen> 5 </since_tizen>
2486 return (Size)GetValue(SizeProperty);
2490 SetValue(SizeProperty, value);
2491 NotifyPropertyChanged();
2496 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2498 /// <since_tizen> 3 </since_tizen>
2499 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2501 "Container parent = view.GetParent(); " +
2502 "View view = parent as View;")]
2503 [EditorBrowsable(EditorBrowsableState.Never)]
2504 public new View Parent
2509 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2510 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2511 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2513 if (basehandle is Layer layer)
2515 ret = new View(Layer.getCPtr(layer).Handle, false);
2516 NUILog.Error("This Parent property is deprecated, should do not be used");
2520 ret = basehandle as View;
2523 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2524 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2526 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2532 /// Gets/Sets whether inherit parent's the layout Direction.
2534 /// <since_tizen> 4 </since_tizen>
2535 public bool InheritLayoutDirection
2539 return (bool)GetValue(InheritLayoutDirectionProperty);
2543 SetValue(InheritLayoutDirectionProperty, value);
2544 NotifyPropertyChanged();
2549 /// Gets/Sets the layout Direction.
2551 /// <since_tizen> 4 </since_tizen>
2552 public ViewLayoutDirectionType LayoutDirection
2556 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2560 SetValue(LayoutDirectionProperty, value);
2561 NotifyPropertyChanged();
2562 layout?.RequestLayout();
2567 /// Gets or sets the Margin for use in layout.
2570 /// Margin property is supported by Layout algorithms and containers.
2571 /// Please Set Layout if you want to use Margin property.
2572 /// The property cascade chaining set is not recommended.
2575 /// This way is recommended for setting the property
2577 /// var view = new View();
2578 /// view.Margin = new Extents(10, 5, 15, 20);
2580 /// This way to set the property is prohibited
2582 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2585 /// <since_tizen> 4 </since_tizen>
2586 public Extents Margin
2590 return (Extents)GetValue(MarginProperty);
2594 SetValue(MarginProperty, value);
2595 NotifyPropertyChanged();
2600 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2604 /// // matchParentView matches its size to its parent size.
2605 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2606 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2608 /// // wrapContentView wraps its children with their desired size.
2609 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2610 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2612 /// // exactSizeView shows itself with an exact size.
2613 /// exactSizeView.WidthSpecification = 100;
2614 /// exactSizeView.HeightSpecification = 100;
2617 /// <since_tizen> 6 </since_tizen>
2618 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2619 public int WidthSpecification
2623 return (int)GetValue(WidthSpecificationProperty);
2627 SetValue(WidthSpecificationProperty, value);
2628 NotifyPropertyChanged();
2632 private int InternalWidthSpecification
2640 if (value == widthPolicy)
2643 widthPolicy = value;
2644 if (widthPolicy >= 0)
2646 SizeWidth = widthPolicy;
2648 layout?.RequestLayout();
2653 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2657 /// // matchParentView matches its size to its parent size.
2658 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2659 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2661 /// // wrapContentView wraps its children with their desired size.
2662 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2663 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2665 /// // exactSizeView shows itself with an exact size.
2666 /// exactSizeView.WidthSpecification = 100;
2667 /// exactSizeView.HeightSpecification = 100;
2670 /// <since_tizen> 6 </since_tizen>
2671 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2672 public int HeightSpecification
2676 return (int)GetValue(HeightSpecificationProperty);
2680 SetValue(HeightSpecificationProperty, value);
2681 NotifyPropertyChanged();
2685 private int InternalHeightSpecification
2689 return heightPolicy;
2693 if (value == heightPolicy)
2696 heightPolicy = value;
2697 if (heightPolicy >= 0)
2699 SizeHeight = heightPolicy;
2701 layout?.RequestLayout();
2706 /// Gets the List of transitions for this View.
2708 /// <since_tizen> 6 </since_tizen>
2709 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2713 if (layoutTransitions == null)
2715 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2717 return layoutTransitions;
2722 /// Sets a layout transitions for this View.
2724 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2726 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2728 /// <since_tizen> 6 </since_tizen>
2729 public LayoutTransition LayoutTransition
2733 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2737 SetValue(LayoutTransitionProperty, value);
2738 NotifyPropertyChanged();
2742 private LayoutTransition InternalLayoutTransition
2746 return layoutTransition;
2752 throw new global::System.ArgumentNullException(nameof(value));
2754 if (layoutTransitions == null)
2756 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2759 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2761 AttachTransitionsToChildren(value);
2763 layoutTransition = value;
2768 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2771 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2773 /// <since_tizen> 4 </since_tizen>
2774 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2775 [EditorBrowsable(EditorBrowsableState.Never)]
2776 public Extents PaddingEX
2780 return GetValue(PaddingEXProperty) as Extents;
2784 SetValue(PaddingEXProperty, value);
2788 private Extents InternalPaddingEX
2792 Extents temp = new Extents(0, 0, 0, 0);
2793 var pValue = GetProperty(View.Property.PADDING);
2796 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2802 var temp = new Tizen.NUI.PropertyValue(value);
2803 SetProperty(View.Property.PADDING, temp);
2805 NotifyPropertyChanged();
2806 layout?.RequestLayout();
2811 /// The Color of View. This is an RGBA value.
2812 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2813 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2814 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2815 /// Inherient of color value depend on <see cref="ColorMode"/>.
2819 /// Animatable - This property can be animated using <c>Animation</c> class.
2821 /// The property cascade chaining set is not recommended.
2824 /// This way is recommended for setting the property
2826 /// var view = new View();
2827 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2829 /// This way to set the property is prohibited
2831 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2834 [EditorBrowsable(EditorBrowsableState.Never)]
2839 return (Color)GetValue(ColorProperty);
2843 SetValue(ColorProperty, value);
2844 NotifyPropertyChanged();
2849 /// The Red component of View.Color.
2853 /// Animatable - This property can be animated using <c>Animation</c> class.
2856 [EditorBrowsable(EditorBrowsableState.Never)]
2857 public float ColorRed
2861 return (float)GetValue(ColorRedProperty);
2865 SetValue(ColorRedProperty, value);
2866 NotifyPropertyChanged();
2871 /// The Green component of View.Color.
2875 /// Animatable - This property can be animated using <c>Animation</c> class.
2878 [EditorBrowsable(EditorBrowsableState.Never)]
2879 public float ColorGreen
2883 return (float)GetValue(ColorGreenProperty);
2887 SetValue(ColorGreenProperty, value);
2888 NotifyPropertyChanged();
2893 /// The Blue component of View.Color.
2897 /// Animatable - This property can be animated using <c>Animation</c> class.
2900 [EditorBrowsable(EditorBrowsableState.Never)]
2901 public float ColorBlue
2905 return (float)GetValue(ColorBlueProperty);
2909 SetValue(ColorBlueProperty, value);
2910 NotifyPropertyChanged();
2915 /// Set the layout on this View. Replaces any existing Layout.
2918 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2920 /// <since_tizen> 6 </since_tizen>
2921 public LayoutItem Layout
2925 return GetValue(LayoutProperty) as LayoutItem;
2929 SetValue(LayoutProperty, value);
2933 private LayoutItem InternalLayout
2941 // Do nothing if layout provided is already set on this View.
2942 if (value == layout)
2947 LayoutingDisabled = false;
2950 // If new layout being set already has a owner then that owner receives a replacement default layout.
2951 // First check if the layout to be set already has a owner.
2952 if (value?.Owner != null)
2954 // Previous owner of the layout gets a default layout as a replacement.
2955 value.Owner.Layout = new AbsoluteLayout()
2957 // Copy Margin and Padding to replacement LayoutGroup.
2958 Margin = value.Margin,
2959 Padding = value.Padding,
2963 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2964 // View if no replacement. Previously margin and padding values would have been moved from
2965 // the View to the layout.
2966 if (layout != null) // Existing layout
2970 // Existing layout being replaced so copy over margin and padding values.
2971 value.Margin = layout.Margin;
2972 value.Padding = layout.Padding;
2973 value.SetPositionByLayout = !excludeLayouting;
2977 // Layout not being replaced so restore margin and padding to View.
2978 SetValue(MarginProperty, layout.Margin);
2979 SetValue(PaddingProperty, layout.Padding);
2980 NotifyPropertyChanged();
2985 // First Layout to be added to the View hence copy
2987 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2990 Extents margin = Margin;
2991 Extents padding = Padding;
2992 bool setMargin = false;
2993 bool setPadding = false;
2995 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2997 // If View already has a margin set then store it in Layout instead.
2998 value.Margin = margin;
2999 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
3003 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
3005 // If View already has a padding set then store it in Layout instead.
3006 value.Padding = padding;
3007 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
3011 if (setMargin || setPadding)
3013 NotifyPropertyChanged();
3016 value.SetPositionByLayout = !excludeLayouting;
3020 // Remove existing layout from it's parent layout group.
3023 // Set layout to this view
3029 /// The weight of the View, used to share available space in a layout with siblings.
3031 /// <since_tizen> 6 </since_tizen>
3041 layout?.RequestLayout();
3046 /// Whether to load the BackgroundImage synchronously.
3047 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3048 /// Note: For Normal Quad images only.
3050 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3051 [EditorBrowsable(EditorBrowsableState.Never)]
3052 public bool BackgroundImageSynchronosLoading
3056 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3060 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3061 NotifyPropertyChanged();
3065 private bool InternalBackgroundImageSynchronosLoading
3069 return BackgroundImageSynchronousLoading;
3073 BackgroundImageSynchronousLoading = value;
3078 /// Whether to load the BackgroundImage synchronously.
3079 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3080 /// Note: For Normal Quad images only.
3082 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3083 [EditorBrowsable(EditorBrowsableState.Never)]
3084 public bool BackgroundImageSynchronousLoading
3088 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3092 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3093 NotifyPropertyChanged();
3097 private bool InternalBackgroundImageSynchronousLoading
3101 return backgroundImageSynchronousLoading;
3105 backgroundImageSynchronousLoading = value;
3107 if (!string.IsNullOrEmpty(BackgroundImage))
3109 PropertyMap bgMap = this.Background;
3110 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3111 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3118 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3119 [EditorBrowsable(EditorBrowsableState.Never)]
3120 public Vector4 UpdateAreaHint
3124 return (Vector4)GetValue(UpdateAreaHintProperty);
3128 SetValue(UpdateAreaHintProperty, value);
3129 NotifyPropertyChanged();
3134 /// Enable/Disable ControlState propagation for children.
3135 /// It is false by default.
3136 /// If the View needs to share ControlState with descendants, please set it true.
3137 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3139 [EditorBrowsable(EditorBrowsableState.Never)]
3140 public bool EnableControlStatePropagation
3144 return (bool)GetValue(EnableControlStatePropagationProperty);
3148 SetValue(EnableControlStatePropagationProperty, value);
3149 NotifyPropertyChanged();
3153 private bool InternalEnableControlStatePropagation
3155 get => themeData?.ControlStatePropagation ?? false;
3158 if (InternalEnableControlStatePropagation == value) return;
3160 if (themeData == null) themeData = new ThemeData();
3162 themeData.ControlStatePropagation = value;
3164 foreach (View child in Children)
3166 child.EnableControlStatePropagation = value;
3172 /// The ControlStates can propagate from the parent.
3173 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3174 /// if parent view EnableControlState is true.
3175 /// <see cref="EnableControlState"/>.
3176 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3178 [EditorBrowsable(EditorBrowsableState.Never)]
3179 public ControlState PropagatableControlStates
3183 return (ControlState)GetValue(PropagatableControlStatesProperty);
3187 SetValue(PropagatableControlStatesProperty, value);
3188 NotifyPropertyChanged();
3192 private ControlState InternalPropagatableControlStates
3194 get => propagatableControlStates;
3195 set => propagatableControlStates = value;
3199 /// By default, it is false in View, true in Control.
3200 /// Note that if the value is true, the View will be a touch receptor.
3202 [EditorBrowsable(EditorBrowsableState.Never)]
3203 public bool EnableControlState
3207 return (bool)GetValue(EnableControlStateProperty);
3211 SetValue(EnableControlStateProperty, value);
3216 /// Whether the actor grab all touches even if touch leaves its boundary.
3218 /// <returns>true, if it grab all touch after start</returns>
3219 [EditorBrowsable(EditorBrowsableState.Never)]
3220 public bool GrabTouchAfterLeave
3224 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3228 SetValue(GrabTouchAfterLeaveProperty, value);
3232 private bool InternalGrabTouchAfterLeave
3236 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
3240 Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
3242 // Use custom HitTest callback only if GrabTouchAfterLeave is true.
3245 RegisterHitTestCallback();
3249 UnregisterHitTestCallback();
3252 NotifyPropertyChanged();
3257 /// Whether the view will only receive own touch.
3259 /// <returns>true, if it only receives touches that started from itself.</returns>
3260 [EditorBrowsable(EditorBrowsableState.Never)]
3261 public bool AllowOnlyOwnTouch
3265 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3269 SetValue(AllowOnlyOwnTouchProperty, value);
3273 private bool InternalAllowOnlyOwnTouch
3277 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
3281 Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
3282 NotifyPropertyChanged();
3287 /// Determines which blend equation will be used to render renderers of this actor.
3289 /// <returns>blend equation enum currently assigned</returns>
3290 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3291 [EditorBrowsable(EditorBrowsableState.Never)]
3292 public BlendEquationType BlendEquation
3296 return (BlendEquationType)GetValue(BlendEquationProperty);
3300 SetValue(BlendEquationProperty, value);
3304 private BlendEquationType InternalBlendEquation
3308 return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
3312 Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
3313 NotifyPropertyChanged();
3318 /// If the value is true, the View will change its style as the theme changes.
3319 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3321 /// <since_tizen> 9 </since_tizen>
3322 public bool ThemeChangeSensitive
3324 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3325 set => SetValue(ThemeChangeSensitiveProperty, value);
3329 /// Create Style, it is abstract function and must be override.
3331 [EditorBrowsable(EditorBrowsableState.Never)]
3332 protected virtual ViewStyle CreateViewStyle()
3334 return new ViewStyle();
3338 /// Called after the View's ControlStates changed.
3340 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3341 [EditorBrowsable(EditorBrowsableState.Never)]
3342 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3348 [EditorBrowsable(EditorBrowsableState.Never)]
3349 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3351 isThemeChanged = true;
3352 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3353 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3354 isThemeChanged = false;
3358 /// Apply style instance to the view.
3359 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3361 /// <since_tizen> 9 </since_tizen>
3362 public virtual void ApplyStyle(ViewStyle viewStyle)
3364 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3366 if (themeData == null) themeData = new ThemeData();
3368 themeData.viewStyle = viewStyle;
3370 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3376 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3378 if (bindablePropertyOfView == null)
3383 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3384 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3386 foreach (var sourceProperty in dirtyStyleProperties)
3388 var sourceValue = viewStyle.GetValue(sourceProperty);
3390 if (sourceValue == null)
3395 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3397 // Do not set value again when theme is changed and the value has been set already.
3398 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3403 if (destinationProperty != null)
3405 InternalSetValue(destinationProperty, sourceValue);
3411 /// Get whether the View is culled or not.
3412 /// True means that the View is out of the view frustum.
3415 /// Hidden-API (Inhouse-API).
3417 [EditorBrowsable(EditorBrowsableState.Never)]
3422 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
3427 /// Set or Get TransitionOptions for the page transition.
3428 /// This property is used to define how this view will be transitioned during Page switching.
3430 /// <since_tizen> 9 </since_tizen>
3431 public TransitionOptions TransitionOptions
3435 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3439 SetValue(TransitionOptionsProperty, value);
3440 NotifyPropertyChanged();
3444 private TransitionOptions InternalTransitionOptions
3448 transitionOptions = value;
3452 return transitionOptions;
3457 /// Gets or sets the status of whether the view should emit key event signals.
3458 /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
3460 [EditorBrowsable(EditorBrowsableState.Never)]
3461 public bool DispatchKeyEvents
3465 return (bool)GetValue(DispatchKeyEventsProperty);
3469 SetValue(DispatchKeyEventsProperty, value);
3470 NotifyPropertyChanged();
3475 /// Gets or sets the status of whether touch events can be dispatched.
3476 /// If a View's DispatchTouchEvents is set to false, then it's can not will receive touch and parents will not receive a touch event signal either.
3477 /// This works without adding a TouchEvent callback in the View.
3479 /// If the <see cref="Tizen.NUI.BaseComponents.View.Sensitive"/> is a property that determines whether or not to be hittable, then this property prevents the propagation of the hit touch event.
3482 [EditorBrowsable(EditorBrowsableState.Never)]
3483 public bool DispatchTouchEvents
3487 return dispatchTouchEvents;
3491 if (dispatchTouchEvents != value)
3493 dispatchTouchEvents = value;
3494 if (dispatchTouchEvents == false)
3496 TouchEvent += OnDispatchTouchEvent;
3500 TouchEvent -= OnDispatchTouchEvent;
3506 private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
3512 /// Gets or sets the status of whether touch events can be dispatched to the parent.
3513 /// If a View's DispatchParentTouchEvents is set to false, then parents will not receive a touch event signal either.
3514 /// This works without adding a TouchEvent callback in the View.
3516 /// If the <see cref="Tizen.NUI.BaseComponents.View.Sensitive"/> is a property that determines whether or not to be hittable, then this property prevents the propagation of the hit touch event.
3519 [EditorBrowsable(EditorBrowsableState.Never)]
3520 public bool DispatchParentTouchEvents
3524 return dispatchParentTouchEvents;
3528 if (dispatchParentTouchEvents != value)
3530 dispatchParentTouchEvents = value;
3531 if (dispatchParentTouchEvents == false)
3533 TouchEvent += OnDispatchParentTouchEvent;
3537 TouchEvent -= OnDispatchParentTouchEvent;
3543 private bool OnDispatchParentTouchEvent(object source, View.TouchEventArgs e)
3549 /// Gets or sets the status of whether the view should emit Gesture event signals.
3550 /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
3551 /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3553 [EditorBrowsable(EditorBrowsableState.Never)]
3554 public bool DispatchGestureEvents
3558 return dispatchGestureEvents;
3562 if (dispatchGestureEvents != value)
3564 dispatchGestureEvents = value;
3565 ConfigGestureDetector(dispatchGestureEvents);
3571 /// Gets or sets the status of whether the view should emit Gesture event signals.
3572 /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
3573 /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3575 [EditorBrowsable(EditorBrowsableState.Never)]
3576 public bool DispatchParentGestureEvents
3580 return dispatchParentGestureEvents;
3584 if (dispatchParentGestureEvents != value)
3586 dispatchParentGestureEvents = value;
3587 ConfigGestureDetector(dispatchParentGestureEvents);
3592 private void ConfigGestureDetector(bool dispatch)
3594 if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
3595 if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
3596 if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
3597 if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
3598 if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
3600 if (dispatch == true)
3602 configGestureCount = configGestureCount > 0 ? configGestureCount-- : 0;
3603 if (configGestureCount == 0)
3605 panGestureDetector.Detach(this);
3606 longGestureDetector.Detach(this);
3607 pinchGestureDetector.Detach(this);
3608 tapGestureDetector.Detach(this);
3609 rotationGestureDetector.Detach(this);
3611 panGestureDetector.Detected -= OnGestureDetected;
3612 longGestureDetector.Detected -= OnGestureDetected;
3613 pinchGestureDetector.Detected -= OnGestureDetected;
3614 tapGestureDetector.Detected -= OnGestureDetected;
3615 rotationGestureDetector.Detected -= OnGestureDetected;
3617 panGestureDetector = null;
3618 longGestureDetector = null;
3619 pinchGestureDetector = null;
3620 tapGestureDetector = null;
3621 rotationGestureDetector = null;
3626 if (configGestureCount == 0)
3628 panGestureDetector.Attach(this);
3629 longGestureDetector.Attach(this);
3630 pinchGestureDetector.Attach(this);
3631 tapGestureDetector.Attach(this);
3632 rotationGestureDetector.Attach(this);
3634 panGestureDetector.Detected += OnGestureDetected;
3635 longGestureDetector.Detected += OnGestureDetected;
3636 pinchGestureDetector.Detected += OnGestureDetected;
3637 tapGestureDetector.Detected += OnGestureDetected;
3638 rotationGestureDetector.Detected += OnGestureDetected;
3640 configGestureCount++;
3644 private void OnGestureDetected(object source, EventArgs e)
3646 // Does notting. This is to consume the gesture.
3650 /// Called when the view is hit through TouchEvent or GestureEvent.
3651 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3652 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3653 /// User can override whether hit or not in HitTest.
3654 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3655 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3657 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3658 [EditorBrowsable(EditorBrowsableState.Never)]
3659 protected virtual bool HitTest(Touch touch)
3665 /// Retrieve the View's current Color.
3668 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3669 /// 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).
3670 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3671 /// and users can get the current actual values through them.
3673 [EditorBrowsable(EditorBrowsableState.Never)]
3674 public Color CurrentColor => GetCurrentColor();
3677 /// Retrieve the current scale factor applied to the View.
3680 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3681 /// 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).
3682 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3683 /// and users can get the current actual values through them.
3685 [EditorBrowsable(EditorBrowsableState.Never)]
3686 public Vector3 CurrentScale => GetCurrentScale();