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 dispatchGestureEvents = true;
84 private bool dispatchParentGestureEvents = true;
85 private string internalName = string.Empty;
86 private Position internalCurrentParentOrigin = null;
87 private Position internalCurrentAnchorPoint = null;
88 private Vector3 internalTargetSize = null;
89 private Size2D internalCurrentSize = null;
90 private Vector3 internalNaturalSize = 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 /// Creates a new instance of a view.
122 /// <since_tizen> 3 </since_tizen>
123 public View() : this(Interop.View.New(), true)
125 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
129 [EditorBrowsable(EditorBrowsableState.Never)]
130 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
135 /// Create a new instance of a View with setting the status of shown or hidden.
137 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
138 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
139 [EditorBrowsable(EditorBrowsableState.Never)]
140 public View(bool shown) : this(Interop.View.New(), true)
142 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
146 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
148 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
157 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
159 InitializeStyle(viewStyle);
162 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
166 PositionUsesPivotPoint = false;
169 onWindowSendEventCallback = SendViewAddedEventToWindow;
170 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
171 signal?.Connect(onWindowSendEventCallback);
173 hitTestResultDataCallback = OnHitTestResult;
174 using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
175 touchDataSignal?.Connect(hitTestResultDataCallback);
182 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
183 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
186 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
188 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197 /// The event that is triggered when the View's ControlState is changed.
199 [EditorBrowsable(EditorBrowsableState.Never)]
200 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
202 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
206 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
208 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
209 [EditorBrowsable(EditorBrowsableState.Never)]
210 public bool LayoutSet
219 /// Flag to allow Layouting to be disabled for Views.
220 /// Once a View has a Layout set then any children added to Views from then on will receive
221 /// automatic Layouts.
223 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
224 [EditorBrowsable(EditorBrowsableState.Never)]
225 public static bool LayoutingDisabled { get; set; } = true;
228 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
230 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
231 [EditorBrowsable(EditorBrowsableState.Never)]
232 public static void SetDefaultGrabTouchAfterLeave(bool enable)
234 defaultGrabTouchAfterLeave = enable;
238 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
240 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
241 [EditorBrowsable(EditorBrowsableState.Never)]
242 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
244 defaultAllowOnlyOwnTouch = enable;
248 /// Deprecate. Do not use this.
249 /// The style instance applied to this view.
250 /// Note that do not modify the ViewStyle.
251 /// Modifying ViewStyle will affect other views with same ViewStyle.
253 [EditorBrowsable(EditorBrowsableState.Never)]
254 protected ViewStyle ViewStyle
258 if (themeData == null) themeData = new ThemeData();
260 if (themeData.viewStyle == null)
262 ApplyStyle(CreateViewStyle());
264 return themeData.viewStyle;
269 /// Get/Set the control state.
270 /// Note that the ControlState only available for the classes derived from Control.
271 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
272 /// please set <see cref="EnableControlState"/> to true.
274 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
275 [EditorBrowsable(EditorBrowsableState.Never)]
276 public ControlState ControlState
280 return themeData == null ? ControlState.Normal : themeData.controlStates;
284 if (ControlState == value)
289 var prevState = ControlState;
291 if (themeData == null) themeData = new ThemeData();
292 themeData.controlStates = value;
294 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
296 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
298 if (themeData.ControlStatePropagation)
300 foreach (View child in Children)
302 ControlState allowed = child.PropagatableControlStates;
303 if (allowed.Contains(ControlState.All))
305 child.ControlState = value;
309 ControlState newControlState = child.ControlState;
311 if (allowed.Contains(ControlState.Normal))
313 if (value.Contains(ControlState.Normal))
315 newControlState += ControlState.Normal;
319 newControlState -= ControlState.Normal;
323 if (allowed.Contains(ControlState.Disabled))
325 if (value.Contains(ControlState.Disabled))
327 newControlState += ControlState.Disabled;
331 newControlState -= ControlState.Disabled;
335 if (allowed.Contains(ControlState.Selected))
337 if (value.Contains(ControlState.Selected))
339 newControlState += ControlState.Selected;
343 newControlState -= ControlState.Selected;
347 if (allowed.Contains(ControlState.Pressed))
349 if (value.Contains(ControlState.Pressed))
351 newControlState += ControlState.Pressed;
355 newControlState -= ControlState.Pressed;
359 if (allowed.Contains(ControlState.Focused))
361 if (value.Contains(ControlState.Focused))
363 newControlState += ControlState.Focused;
367 newControlState -= ControlState.Focused;
371 if (allowed.Contains(ControlState.Other))
373 if (value.Contains(ControlState.Other))
375 newControlState += ControlState.Other;
379 newControlState -= ControlState.Other;
383 if (child.ControlState != newControlState)
384 child.ControlState = newControlState;
389 OnControlStateChanged(changeInfo);
391 ControlStateChangedEvent?.Invoke(this, changeInfo);
396 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
398 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
399 [EditorBrowsable(EditorBrowsableState.Never)]
400 public bool ExcludeLayouting
404 return (bool)GetValue(ExcludeLayoutingProperty);
408 SetValue(ExcludeLayoutingProperty, value);
409 NotifyPropertyChanged();
413 private bool InternalExcludeLayouting
417 return excludeLayouting;
421 excludeLayouting = value;
422 if (Layout != null && Layout.SetPositionByLayout == value)
424 Layout.SetPositionByLayout = !value;
425 Layout.RequestLayout();
431 /// The StyleName, type string.
432 /// The value indicates DALi style name defined in json theme file.
434 /// <since_tizen> 3 </since_tizen>
435 public string StyleName
439 return (string)GetValue(StyleNameProperty);
443 SetValue(StyleNameProperty, value);
444 NotifyPropertyChanged();
449 /// The KeyInputFocus, type bool.
451 [EditorBrowsable(EditorBrowsableState.Never)]
452 public bool KeyInputFocus
456 return (bool)GetValue(KeyInputFocusProperty);
460 SetValue(KeyInputFocusProperty, value);
461 NotifyPropertyChanged();
466 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
470 /// The property cascade chaining set is not recommended.
473 /// Animatable - This property can be animated using <c>Animation</c> class.
475 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
480 /// This way is recommended for setting the property
482 /// var view = new View();
483 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
485 /// This way to set the property is prohibited
487 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
490 /// <since_tizen> 3 </since_tizen>
491 public Color BackgroundColor
495 return (Color)GetValue(BackgroundColorProperty);
499 SetValue(BackgroundColorProperty, value);
500 NotifyPropertyChanged();
505 /// The mutually exclusive with "backgroundColor" and "background" type Map.
507 /// <since_tizen> 3 </since_tizen>
508 public string BackgroundImage
512 return (string)GetValue(BackgroundImageProperty);
516 SetValue(BackgroundImageProperty, value);
517 NotifyPropertyChanged();
522 /// Get or set the border of background image.
524 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
525 [EditorBrowsable(EditorBrowsableState.Never)]
526 public Rectangle BackgroundImageBorder
530 return (Rectangle)GetValue(BackgroundImageBorderProperty);
534 SetValue(BackgroundImageBorderProperty, value);
535 NotifyPropertyChanged();
540 /// The background of view.
542 /// <since_tizen> 3 </since_tizen>
543 public Tizen.NUI.PropertyMap Background
547 return (PropertyMap)GetValue(BackgroundProperty);
551 SetValue(BackgroundProperty, value);
552 NotifyPropertyChanged();
557 /// Describes a shadow as an image for a View.
558 /// It is null by default.
561 /// Getter returns copied instance of current shadow.
564 /// The mutually exclusive with "BoxShadow".
568 /// Animatable - This property can be animated using <c>Animation</c> class.
569 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
571 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
573 /// Animatable sub-property : Offset.
576 [EditorBrowsable(EditorBrowsableState.Never)]
577 public ImageShadow ImageShadow
581 return (ImageShadow)GetValue(ImageShadowProperty);
585 SetValue(ImageShadowProperty, value);
586 NotifyPropertyChanged();
591 /// Describes a box shaped shadow drawing for a View.
592 /// It is null by default.
595 /// The mutually exclusive with "ImageShadow".
599 /// Animatable - This property can be animated using <c>Animation</c> class.
600 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
602 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
604 /// Animatable sub-property : Offset, Color, BlurRadius.
607 /// <since_tizen> 9 </since_tizen>
608 public Shadow BoxShadow
612 return (Shadow)GetValue(BoxShadowProperty);
616 SetValue(BoxShadowProperty, value);
617 NotifyPropertyChanged();
622 /// The radius for the rounded corners of the View.
623 /// This will rounds background and shadow edges.
624 /// 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).
625 /// Each radius will clamp internally to the half of smaller of the view's width or height.
626 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
630 /// Animatable - This property can be animated using <c>Animation</c> class.
632 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
636 /// <since_tizen> 9 </since_tizen>
637 public Vector4 CornerRadius
641 return (Vector4)GetValue(CornerRadiusProperty);
645 SetValue(CornerRadiusProperty, value);
646 NotifyPropertyChanged();
651 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
652 /// It is absolute by default.
653 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
655 /// <since_tizen> 9 </since_tizen>
656 public VisualTransformPolicyType CornerRadiusPolicy
658 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
659 set => SetValue(CornerRadiusPolicyProperty, value);
663 /// The width for the borderline of the View.
667 /// Animatable - This property can be animated using <c>Animation</c> class.
669 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
672 /// Note that, an image background may not have borderline if it uses the Border property.
674 /// <since_tizen> 9 </since_tizen>
675 public float BorderlineWidth
679 return (float)GetValue(BorderlineWidthProperty);
683 SetValue(BorderlineWidthProperty, value);
684 NotifyPropertyChanged();
689 /// The color for the borderline of the View.
690 /// It is Color.Black by default.
694 /// Animatable - This property can be animated using <c>Animation</c> class.
696 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
700 /// <since_tizen> 9 </since_tizen>
701 public Color BorderlineColor
705 return (Color)GetValue(BorderlineColorProperty);
709 SetValue(BorderlineColorProperty, value);
710 NotifyPropertyChanged();
715 /// The color selector for the borderline of the View.
716 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
717 /// So this API is internally used only.
719 internal Selector<Color> BorderlineColorSelector
723 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
727 SetValue(BorderlineColorSelectorProperty, value);
728 NotifyPropertyChanged();
733 /// The Relative offset for the borderline of the View.
734 /// Recommended range : [-1.0f to 1.0f].
735 /// If -1.0f, draw borderline inside of the View.
736 /// If 1.0f, draw borderline outside of the View.
737 /// If 0.0f, draw borderline half inside and half outside.
738 /// It is 0.0f by default.
742 /// Animatable - This property can be animated using <c>Animation</c> class.
744 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
748 /// <since_tizen> 9 </since_tizen>
749 public float BorderlineOffset
753 return (float)GetValue(BorderlineOffsetProperty);
757 SetValue(BorderlineOffsetProperty, value);
758 NotifyPropertyChanged();
763 /// The current state of the view.
765 /// <since_tizen> 3 </since_tizen>
770 return (States)GetValue(StateProperty);
774 SetValue(StateProperty, value);
775 NotifyPropertyChanged();
780 /// The current sub state of the view.
782 /// <since_tizen> 3 </since_tizen>
783 public States SubState
787 return (States)GetValue(SubStateProperty);
791 SetValue(SubStateProperty, value);
792 NotifyPropertyChanged();
797 /// Displays a tooltip
799 /// <since_tizen> 3 </since_tizen>
800 public Tizen.NUI.PropertyMap Tooltip
804 return (PropertyMap)GetValue(TooltipProperty);
808 SetValue(TooltipProperty, value);
809 NotifyPropertyChanged();
814 /// Displays a tooltip as a text.
816 /// <since_tizen> 3 </since_tizen>
817 public string TooltipText
821 return GetValue(TooltipTextProperty) as string;
825 SetValue(TooltipTextProperty, value);
829 private string InternalTooltipText
833 using (var propertyValue = GetProperty(Property.TOOLTIP))
835 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
837 return retrivedValue;
839 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
840 return "error to get TooltipText";
845 var temp = new Tizen.NUI.PropertyValue(value);
846 SetProperty(View.Property.TOOLTIP, temp);
848 NotifyPropertyChanged();
853 /// The Child property of FlexContainer.<br />
854 /// The proportion of the free space in the container, the flex item will receive.<br />
855 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
857 /// <since_tizen> 3 </since_tizen>
858 [Obsolete("Deprecated in API8, will be removed in API10.")]
863 return (float)GetValue(FlexProperty);
867 SetValue(FlexProperty, value);
868 NotifyPropertyChanged();
873 /// The Child property of FlexContainer.<br />
874 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
876 /// <since_tizen> 3 </since_tizen>
877 [Obsolete("Deprecated in API8, will be removed in API10.")]
882 return (int)GetValue(AlignSelfProperty);
886 SetValue(AlignSelfProperty, value);
887 NotifyPropertyChanged();
892 /// The Child property of FlexContainer.<br />
893 /// The space around the flex item.<br />
896 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
898 /// <since_tizen> 3 </since_tizen>
899 [Obsolete("Deprecated in API8, will be removed in API10.")]
900 public Vector4 FlexMargin
904 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
905 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
909 SetValue(FlexMarginProperty, value);
910 NotifyPropertyChanged();
915 /// The top-left cell this child occupies, if not set, the first available cell is used.
918 /// The property cascade chaining set is not recommended.
919 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
922 /// This way is recommended for setting the property
924 /// var view = new View();
925 /// view.CellIndex = new Vector2(1, 3);
927 /// This way to set the property is prohibited
929 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
932 /// <since_tizen> 3 </since_tizen>
933 public Vector2 CellIndex
937 return (Vector2)GetValue(CellIndexProperty);
941 SetValue(CellIndexProperty, value);
942 NotifyPropertyChanged();
947 /// The number of rows this child occupies, if not set, the default value is 1.
950 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
952 /// <since_tizen> 3 </since_tizen>
957 return (float)GetValue(RowSpanProperty);
961 SetValue(RowSpanProperty, value);
962 NotifyPropertyChanged();
967 /// The number of columns this child occupies, if not set, the default value is 1.
970 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
972 /// <since_tizen> 3 </since_tizen>
973 public float ColumnSpan
977 return (float)GetValue(ColumnSpanProperty);
981 SetValue(ColumnSpanProperty, value);
982 NotifyPropertyChanged();
987 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
990 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
992 /// <since_tizen> 3 </since_tizen>
993 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
997 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1001 SetValue(CellHorizontalAlignmentProperty, value);
1002 NotifyPropertyChanged();
1007 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1010 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1012 /// <since_tizen> 3 </since_tizen>
1013 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1017 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1021 SetValue(CellVerticalAlignmentProperty, value);
1022 NotifyPropertyChanged();
1027 /// The left focusable view.<br />
1028 /// This will return null if not set.<br />
1029 /// This will also return null if the specified left focusable view is not on a window.<br />
1031 /// <since_tizen> 3 </since_tizen>
1032 public View LeftFocusableView
1034 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1037 return (View)GetValue(LeftFocusableViewProperty);
1041 SetValue(LeftFocusableViewProperty, value);
1042 NotifyPropertyChanged();
1047 /// The right focusable view.<br />
1048 /// This will return null if not set.<br />
1049 /// This will also return null if the specified right focusable view is not on a window.<br />
1051 /// <since_tizen> 3 </since_tizen>
1052 public View RightFocusableView
1054 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1057 return (View)GetValue(RightFocusableViewProperty);
1061 SetValue(RightFocusableViewProperty, value);
1062 NotifyPropertyChanged();
1067 /// The up focusable view.<br />
1068 /// This will return null if not set.<br />
1069 /// This will also return null if the specified up focusable view is not on a window.<br />
1071 /// <since_tizen> 3 </since_tizen>
1072 public View UpFocusableView
1074 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1077 return (View)GetValue(UpFocusableViewProperty);
1081 SetValue(UpFocusableViewProperty, value);
1082 NotifyPropertyChanged();
1087 /// The down focusable view.<br />
1088 /// This will return null if not set.<br />
1089 /// This will also return null if the specified down focusable view is not on a window.<br />
1091 /// <since_tizen> 3 </since_tizen>
1092 public View DownFocusableView
1094 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1097 return (View)GetValue(DownFocusableViewProperty);
1101 SetValue(DownFocusableViewProperty, value);
1102 NotifyPropertyChanged();
1107 /// The clockwise focusable view by rotary wheel.<br />
1108 /// This will return null if not set.<br />
1109 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1111 [EditorBrowsable(EditorBrowsableState.Never)]
1112 public View ClockwiseFocusableView
1114 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1117 return (View)GetValue(ClockwiseFocusableViewProperty);
1121 SetValue(ClockwiseFocusableViewProperty, value);
1122 NotifyPropertyChanged();
1127 /// The counter clockwise focusable view by rotary wheel.<br />
1128 /// This will return null if not set.<br />
1129 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1131 [EditorBrowsable(EditorBrowsableState.Never)]
1132 public View CounterClockwiseFocusableView
1134 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1137 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1141 SetValue(CounterClockwiseFocusableViewProperty, value);
1142 NotifyPropertyChanged();
1147 /// Whether the view should be focusable by keyboard navigation.
1149 /// <since_tizen> 3 </since_tizen>
1150 public bool Focusable
1154 SetValue(FocusableProperty, value);
1155 NotifyPropertyChanged();
1159 return (bool)GetValue(FocusableProperty);
1164 /// 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.
1165 /// Note : Default value is true.
1167 [EditorBrowsable(EditorBrowsableState.Never)]
1168 public bool FocusableChildren
1172 SetValue(FocusableChildrenProperty, value);
1173 NotifyPropertyChanged();
1177 return (bool)GetValue(FocusableChildrenProperty);
1182 /// Whether this view can focus by touch.
1183 /// If Focusable is false, FocusableInTouch is disabled.
1184 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1186 [EditorBrowsable(EditorBrowsableState.Never)]
1187 public bool FocusableInTouch
1191 SetValue(FocusableInTouchProperty, value);
1192 NotifyPropertyChanged();
1196 return (bool)GetValue(FocusableInTouchProperty);
1201 /// Retrieves the position of the view.
1202 /// The coordinates are relative to the view's parent.
1205 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1206 /// 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).
1207 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1208 /// and users can get the current actual values through them.
1210 /// <since_tizen> 3 </since_tizen>
1211 public Position CurrentPosition
1215 return GetCurrentPosition();
1220 /// Sets the size of a view for the width and the height.<br />
1221 /// Geometry can be scaled to fit within this area.<br />
1222 /// This does not interfere with the view's scale factor.<br />
1223 /// The views default depth is the minimum of width and height.<br />
1226 /// The property cascade chaining set is not recommended.
1229 /// This way is recommended for setting the property
1231 /// var view = new View();
1232 /// view.Size2D = new Size2D(100, 200);
1234 /// This way to set the property is prohibited
1236 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1239 /// <since_tizen> 3 </since_tizen>
1240 public Size2D Size2D
1244 var temp = (Size2D)GetValue(Size2DProperty);
1246 if (this.Layout == null)
1248 if (temp.Width < 0) { temp.Width = 0; }
1249 if (temp.Height < 0) { temp.Height = 0; }
1256 SetValue(Size2DProperty, value);
1258 NotifyPropertyChanged();
1263 /// Retrieves the size of the view.
1264 /// The coordinates are relative to the view's parent.
1267 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1268 /// 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).
1269 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1270 /// and users can get the current actual values through them.
1272 /// <since_tizen> 3 </since_tizen>
1273 public Size2D CurrentSize
1277 return GetCurrentSize();
1282 /// Retrieves and sets the view's opacity.<br />
1286 /// Animatable - This property can be animated using <c>Animation</c> class.
1288 /// animation.AnimateTo(view, "Opacity", 0.5f);
1292 /// <since_tizen> 3 </since_tizen>
1293 public float Opacity
1297 return (float)GetValue(OpacityProperty);
1301 SetValue(OpacityProperty, value);
1302 NotifyPropertyChanged();
1307 /// Sets the position of the view for X and Y.<br />
1308 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1309 /// If the position inheritance is disabled, sets the world position.<br />
1312 /// The property cascade chaining set is not recommended.
1315 /// This way is recommended for setting the property
1317 /// var view = new View();
1318 /// view.Position2D = new Position2D(100, 200);
1320 /// This way to set the property is prohibited
1322 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1325 /// <since_tizen> 3 </since_tizen>
1326 public Position2D Position2D
1330 return (Position2D)GetValue(Position2DProperty);
1334 SetValue(Position2DProperty, value);
1335 NotifyPropertyChanged();
1340 /// Retrieves the screen position of the view.<br />
1342 /// <since_tizen> 3 </since_tizen>
1343 public Vector2 ScreenPosition
1347 return GetCurrentScreenPosition();
1352 /// Retrieves the screen position and size of the view.<br />
1355 /// The float type Rectangle class is not ready yet.
1356 /// Therefore, it transmits data in Vector4 class.
1357 /// This type should later be changed to the appropriate data type.
1359 [EditorBrowsable(EditorBrowsableState.Never)]
1360 public Vector4 ScreenPositionSize
1364 return GetCurrentScreenPositionSize();
1369 /// Determines whether the pivot point should be used to determine the position of the view.
1370 /// This is false by default.
1372 /// <remarks>If false, then the top-left of the view is used for the position.
1373 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1375 /// <since_tizen> 3 </since_tizen>
1376 public bool PositionUsesPivotPoint
1380 return (bool)GetValue(PositionUsesPivotPointProperty);
1384 SetValue(PositionUsesPivotPointProperty, value);
1385 NotifyPropertyChanged();
1390 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1392 /// <since_tizen> 3 </since_tizen>
1393 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1395 "View view = new View(); " +
1396 "view.PivotPoint = PivotPoint.Center; " +
1397 "view.PositionUsesPivotPoint = true;" +
1398 " This has been deprecated in API5 and will be removed in API8")]
1399 [EditorBrowsable(EditorBrowsableState.Never)]
1400 public bool PositionUsesAnchorPoint
1404 return (bool)GetValue(PositionUsesAnchorPointProperty);
1408 SetValue(PositionUsesAnchorPointProperty, value);
1412 private bool InternalPositionUsesAnchorPoint
1416 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
1420 Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
1421 NotifyPropertyChanged();
1426 /// Queries whether the view is connected to the stage.<br />
1427 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1429 /// <since_tizen> 3 </since_tizen>
1430 public bool IsOnWindow
1439 /// Gets the depth in the hierarchy for the view.
1441 /// <since_tizen> 3 </since_tizen>
1442 public int HierarchyDepth
1446 return GetHierarchyDepth();
1451 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1454 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1455 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1456 /// The values set by this property will likely change.
1458 /// <since_tizen> 3 </since_tizen>
1459 public int SiblingOrder
1463 return (int)GetValue(SiblingOrderProperty);
1467 SetValue(SiblingOrderProperty, value);
1469 Layout?.ChangeLayoutSiblingOrder(value);
1471 NotifyPropertyChanged();
1476 /// Returns the natural size of the view.
1479 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1481 /// <since_tizen> 5 </since_tizen>
1482 public Vector3 NaturalSize
1486 Vector3 ret = GetNaturalSize();
1487 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1493 /// Returns the natural size (Size2D) of the view.
1496 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1498 /// <since_tizen> 4 </since_tizen>
1499 public Size2D NaturalSize2D
1503 Vector3 temp = GetNaturalSize();
1504 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1506 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1513 /// Gets or sets the origin of a view within its parent's area.<br />
1514 /// 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 />
1515 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1516 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1518 /// <pre>The view has been initialized.</pre>
1519 /// <since_tizen> 3 </since_tizen>
1520 public Position ParentOrigin
1524 Position tmp = (Position)GetValue(ParentOriginProperty);
1525 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1529 SetValue(ParentOriginProperty, value);
1530 NotifyPropertyChanged();
1535 /// Gets or sets the anchor-point of a view.<br />
1536 /// 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 />
1537 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1538 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1539 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1540 /// <pre>The view has been initialized.</pre>
1543 /// The property cascade chaining set is not recommended.
1546 /// This way is recommended for setting the property
1548 /// var view = new View();
1549 /// view.PivotPoint = PivotPoint.Center;
1551 /// This way to set the property is prohibited
1553 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1556 /// <since_tizen> 3 </since_tizen>
1557 public Position PivotPoint
1561 return (Position)GetValue(PivotPointProperty);
1565 SetValue(PivotPointProperty, value);
1566 NotifyPropertyChanged();
1571 /// Gets or sets the size width of the view.
1575 /// Animatable - This property can be animated using <c>Animation</c> class.
1577 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1581 /// <since_tizen> 3 </since_tizen>
1582 public float SizeWidth
1586 return (float)GetValue(SizeWidthProperty);
1590 SetValue(SizeWidthProperty, value);
1591 NotifyPropertyChanged();
1596 /// Gets or sets the size height of the view.
1600 /// Animatable - This property can be animated using <c>Animation</c> class.
1603 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1606 /// <since_tizen> 3 </since_tizen>
1607 public float SizeHeight
1611 return (float)GetValue(SizeHeightProperty);
1615 SetValue(SizeHeightProperty, value);
1616 NotifyPropertyChanged();
1621 /// Gets or sets the position of the view.<br />
1622 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1623 /// If the position inheritance is disabled, sets the world position.<br />
1627 /// Animatable - This property can be animated using <c>Animation</c> class.
1629 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1632 /// The property cascade chaining set is not recommended.
1635 /// This way is recommended for setting the property
1637 /// var view = new View();
1638 /// view.Position = new Position(100, 200.5f, 0);
1640 /// This way to set the property is prohibited
1642 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1645 /// <since_tizen> 3 </since_tizen>
1646 public Position Position
1650 return (Position)GetValue(PositionProperty);
1654 SetValue(PositionProperty, value);
1655 NotifyPropertyChanged();
1660 /// Gets or sets the position X of the view.
1664 /// Animatable - This property can be animated using <c>Animation</c> class.
1666 /// animation.AnimateTo(view, "PositionX", 50.0f);
1670 /// <since_tizen> 3 </since_tizen>
1671 public float PositionX
1675 return (float)GetValue(PositionXProperty);
1679 SetValue(PositionXProperty, value);
1680 NotifyPropertyChanged();
1685 /// Gets or sets the position Y of the view.
1689 /// Animatable - This property can be animated using <c>Animation</c> class.
1691 /// animation.AnimateTo(view, "PositionY", 50.0f);
1695 /// <since_tizen> 3 </since_tizen>
1696 public float PositionY
1700 return (float)GetValue(PositionYProperty);
1704 SetValue(PositionYProperty, value);
1705 NotifyPropertyChanged();
1710 /// Gets or sets the position Z of the view.
1714 /// Animatable - This property can be animated using <c>Animation</c> class.
1716 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1720 /// <since_tizen> 3 </since_tizen>
1721 public float PositionZ
1725 return (float)GetValue(PositionZProperty);
1729 SetValue(PositionZProperty, value);
1730 NotifyPropertyChanged();
1735 /// Gets or sets the world position of the view.
1737 /// <since_tizen> 3 </since_tizen>
1738 public Vector3 WorldPosition
1742 return GetCurrentWorldPosition();
1747 /// Gets or sets the orientation of the view.<br />
1748 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1752 /// This is an asynchronous method.
1755 /// Animatable - This property can be animated using <c>Animation</c> class.
1757 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1761 /// <since_tizen> 3 </since_tizen>
1762 public Rotation Orientation
1766 return (Rotation)GetValue(OrientationProperty);
1770 SetValue(OrientationProperty, value);
1771 NotifyPropertyChanged();
1776 /// Gets or sets the world orientation of the view.<br />
1778 /// <since_tizen> 3 </since_tizen>
1779 public Rotation WorldOrientation
1783 Rotation temp = new Rotation();
1784 var pValue = GetProperty(View.Property.WorldOrientation);
1792 /// Gets or sets the scale factor applied to the view.<br />
1796 /// Animatable - This property can be animated using <c>Animation</c> class.
1798 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1801 /// The property cascade chaining set is not recommended.
1804 /// This way is recommended for setting the property
1806 /// var view = new View();
1807 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1809 /// This way to set the property is prohibited
1811 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1814 /// <since_tizen> 3 </since_tizen>
1815 public Vector3 Scale
1819 return (Vector3)GetValue(ScaleProperty);
1823 SetValue(ScaleProperty, value);
1824 NotifyPropertyChanged();
1829 /// Gets or sets the scale X factor applied to the view.
1833 /// Animatable - This property can be animated using <c>Animation</c> class.
1835 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1839 /// <since_tizen> 3 </since_tizen>
1844 return (float)GetValue(ScaleXProperty);
1848 SetValue(ScaleXProperty, value);
1849 NotifyPropertyChanged();
1854 /// Gets or sets the scale Y factor applied to the view.
1858 /// Animatable - This property can be animated using <c>Animation</c> class.
1860 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1864 /// <since_tizen> 3 </since_tizen>
1869 return (float)GetValue(ScaleYProperty);
1873 SetValue(ScaleYProperty, value);
1874 NotifyPropertyChanged();
1879 /// Gets or sets the scale Z factor applied to the view.
1883 /// Animatable - This property can be animated using <c>Animation</c> class.
1885 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1889 /// <since_tizen> 3 </since_tizen>
1894 return (float)GetValue(ScaleZProperty);
1898 SetValue(ScaleZProperty, value);
1899 NotifyPropertyChanged();
1904 /// Gets the world scale of the view.
1906 /// <since_tizen> 3 </since_tizen>
1907 public Vector3 WorldScale
1911 return GetCurrentWorldScale();
1916 /// Retrieves the visibility flag of the view.
1920 /// If the view is not visible, then the view and its children will not be rendered.
1921 /// 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.
1924 /// Animatable - This property can be animated using <c>Animation</c> class.
1926 /// animation.AnimateTo(view, "Visibility", false);
1930 /// <since_tizen> 3 </since_tizen>
1931 public bool Visibility
1935 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
1940 /// Gets the view's world color.
1942 /// <since_tizen> 3 </since_tizen>
1943 public Vector4 WorldColor
1947 return GetCurrentWorldColor();
1952 /// Gets or sets the view's name.
1954 /// <since_tizen> 3 </since_tizen>
1959 return (string)GetValue(NameProperty);
1963 SetValue(NameProperty, value);
1964 NotifyPropertyChanged();
1969 /// Get the number of children held by the view.
1971 /// <since_tizen> 3 </since_tizen>
1972 public new uint ChildCount
1976 return Convert.ToUInt32(Children.Count);
1981 /// Gets the view's ID.
1984 /// <since_tizen> 3 </since_tizen>
1994 /// Gets or sets the status of whether the view should emit touch or hover signals.
1995 /// If a View is made insensitive, then the View and its children are not hittable.
1997 /// <since_tizen> 3 </since_tizen>
1998 public bool Sensitive
2002 return (bool)GetValue(SensitiveProperty);
2006 SetValue(SensitiveProperty, value);
2007 NotifyPropertyChanged();
2012 /// Gets or sets the status of whether the view should be enabled user interactions.
2013 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2015 /// <since_tizen> tizen_next </since_tizen>
2016 [EditorBrowsable(EditorBrowsableState.Never)]
2017 public bool IsEnabled
2021 return (bool)GetValue(IsEnabledProperty);
2025 SetValue(IsEnabledProperty, value);
2026 NotifyPropertyChanged();
2031 /// 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.
2033 /// <since_tizen> 3 </since_tizen>
2034 public bool LeaveRequired
2038 return (bool)GetValue(LeaveRequiredProperty);
2042 SetValue(LeaveRequiredProperty, value);
2043 NotifyPropertyChanged();
2048 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2050 /// <since_tizen> 3 </since_tizen>
2051 public bool InheritOrientation
2055 return (bool)GetValue(InheritOrientationProperty);
2059 SetValue(InheritOrientationProperty, value);
2060 NotifyPropertyChanged();
2065 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2067 /// <since_tizen> 3 </since_tizen>
2068 public bool InheritScale
2072 return (bool)GetValue(InheritScaleProperty);
2076 SetValue(InheritScaleProperty, value);
2077 NotifyPropertyChanged();
2082 /// Gets or sets the status of how the view and its children should be drawn.<br />
2083 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2084 /// 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 />
2085 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2086 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2087 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2089 /// <since_tizen> 3 </since_tizen>
2090 public DrawModeType DrawMode
2094 return (DrawModeType)GetValue(DrawModeProperty);
2098 SetValue(DrawModeProperty, value);
2099 NotifyPropertyChanged();
2104 /// Gets or sets the relative to parent size factor of the view.<br />
2105 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2106 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2109 /// The property cascade chaining set is not recommended.
2112 /// This way is recommended for setting the property
2114 /// var text = new TextField();
2115 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2117 /// This way to set the property is prohibited
2119 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2122 /// <since_tizen> 3 </since_tizen>
2123 public Vector3 SizeModeFactor
2127 return (Vector3)GetValue(SizeModeFactorProperty);
2131 SetValue(SizeModeFactorProperty, value);
2132 NotifyPropertyChanged();
2137 /// Gets or sets the width resize policy to be used.
2139 /// <since_tizen> 3 </since_tizen>
2140 public ResizePolicyType WidthResizePolicy
2144 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2148 SetValue(WidthResizePolicyProperty, value);
2149 NotifyPropertyChanged();
2154 /// Gets or sets the height resize policy to be used.
2156 /// <since_tizen> 3 </since_tizen>
2157 public ResizePolicyType HeightResizePolicy
2161 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2165 SetValue(HeightResizePolicyProperty, value);
2166 NotifyPropertyChanged();
2171 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2172 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2174 /// <since_tizen> 3 </since_tizen>
2175 public SizeScalePolicyType SizeScalePolicy
2179 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2183 SetValue(SizeScalePolicyProperty, value);
2184 NotifyPropertyChanged();
2189 /// Gets or sets the status of whether the width size is dependent on the height size.
2191 /// <since_tizen> 3 </since_tizen>
2192 public bool WidthForHeight
2196 return (bool)GetValue(WidthForHeightProperty);
2200 SetValue(WidthForHeightProperty, value);
2201 NotifyPropertyChanged();
2206 /// Gets or sets the status of whether the height size is dependent on the width size.
2208 /// <since_tizen> 3 </since_tizen>
2209 public bool HeightForWidth
2213 return (bool)GetValue(HeightForWidthProperty);
2217 SetValue(HeightForWidthProperty, value);
2218 NotifyPropertyChanged();
2223 /// Gets or sets the padding for use in layout.
2226 /// The property cascade chaining set is not recommended.
2229 /// This way is recommended for setting the property
2231 /// var view = new View();
2232 /// view.Padding = new Extents(5, 5, 5, 5);
2234 /// This way to set the property is prohibited
2236 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2239 /// <since_tizen> 5 </since_tizen>
2240 public Extents Padding
2244 return (Extents)GetValue(PaddingProperty);
2248 SetValue(PaddingProperty, value);
2249 NotifyPropertyChanged();
2254 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2256 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2258 /// The property cascade chaining set is not recommended.
2261 /// This way is recommended for setting the property
2263 /// var view = new View();
2264 /// view.MinimumSize = new Size2D(100, 200);
2266 /// This way to set the property is prohibited
2268 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2271 /// <since_tizen> 3 </since_tizen>
2272 public Size2D MinimumSize
2276 return (Size2D)GetValue(MinimumSizeProperty);
2282 throw new ArgumentNullException(nameof(value));
2286 // Note: it only works if minimum size is >= than natural size.
2287 // To force the size it should be done through the width&height spec or Size2D.
2288 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2289 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2290 layout.RequestLayout();
2292 SetValue(MinimumSizeProperty, value);
2293 NotifyPropertyChanged();
2298 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2301 /// This way is recommended for setting the property
2303 /// var view = new View();
2304 /// view.MaximumSize = new Size2D(100, 200);
2306 /// This way to set the property is prohibited
2308 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2311 /// <since_tizen> 3 </since_tizen>
2312 public Size2D MaximumSize
2316 return (Size2D)GetValue(MaximumSizeProperty);
2320 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2321 // MATCH_PARENT spec + parent container size can be used to limit
2324 layout.RequestLayout();
2326 SetValue(MaximumSizeProperty, value);
2327 NotifyPropertyChanged();
2332 /// Gets or sets whether a child view inherits it's parent's position.<br />
2333 /// Default is to inherit.<br />
2334 /// 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 />
2336 /// <since_tizen> 3 </since_tizen>
2337 public bool InheritPosition
2341 return (bool)GetValue(InheritPositionProperty);
2345 SetValue(InheritPositionProperty, value);
2346 NotifyPropertyChanged();
2351 /// Gets or sets the clipping behavior (mode) of it's children.
2353 /// <since_tizen> 3 </since_tizen>
2354 public ClippingModeType ClippingMode
2358 return (ClippingModeType)GetValue(ClippingModeProperty);
2362 SetValue(ClippingModeProperty, value);
2363 NotifyPropertyChanged();
2368 /// Gets the number of renderers held by the view.
2370 /// <since_tizen> 3 </since_tizen>
2371 public uint RendererCount
2375 return GetRendererCount();
2380 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2383 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2385 /// <since_tizen> 3 </since_tizen>
2386 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2388 "View view = new View(); " +
2389 "view.PivotPoint = PivotPoint.Center; " +
2390 "view.PositionUsesPivotPoint = true;")]
2391 [EditorBrowsable(EditorBrowsableState.Never)]
2392 public Position AnchorPoint
2396 return GetValue(AnchorPointProperty) as Position;
2400 SetValue(AnchorPointProperty, value);
2404 private Position InternalAnchorPoint
2408 return GetCurrentAnchorPoint();
2412 SetAnchorPoint(value);
2413 NotifyPropertyChanged();
2418 /// Sets the size of a view for the width, the height and the depth.<br />
2419 /// Geometry can be scaled to fit within this area.<br />
2420 /// This does not interfere with the view's scale factor.<br />
2421 /// The views default depth is the minimum of width and height.<br />
2425 /// Animatable - This property can be animated using <c>Animation</c> class.
2427 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2430 /// The property cascade chaining set is not recommended.
2433 /// This way is recommended for setting the property
2435 /// var view = new View();
2436 /// view.Size = new Size(100.5f, 200, 0);
2438 /// This way to set the property is prohibited
2440 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2443 /// <since_tizen> 5 </since_tizen>
2448 return (Size)GetValue(SizeProperty);
2452 SetValue(SizeProperty, value);
2453 NotifyPropertyChanged();
2458 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2460 /// <since_tizen> 3 </since_tizen>
2461 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2463 "Container parent = view.GetParent(); " +
2464 "View view = parent as View;")]
2465 [EditorBrowsable(EditorBrowsableState.Never)]
2466 public new View Parent
2471 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2472 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2473 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2475 if (basehandle is Layer layer)
2477 ret = new View(Layer.getCPtr(layer).Handle, false);
2478 NUILog.Error("This Parent property is deprecated, should do not be used");
2482 ret = basehandle as View;
2485 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2486 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2488 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2494 /// Gets/Sets whether inherit parent's the layout Direction.
2496 /// <since_tizen> 4 </since_tizen>
2497 public bool InheritLayoutDirection
2501 return (bool)GetValue(InheritLayoutDirectionProperty);
2505 SetValue(InheritLayoutDirectionProperty, value);
2506 NotifyPropertyChanged();
2511 /// Gets/Sets the layout Direction.
2513 /// <since_tizen> 4 </since_tizen>
2514 public ViewLayoutDirectionType LayoutDirection
2518 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2522 SetValue(LayoutDirectionProperty, value);
2523 NotifyPropertyChanged();
2524 layout?.RequestLayout();
2529 /// Gets or sets the Margin for use in layout.
2532 /// Margin property is supported by Layout algorithms and containers.
2533 /// Please Set Layout if you want to use Margin property.
2534 /// The property cascade chaining set is not recommended.
2537 /// This way is recommended for setting the property
2539 /// var view = new View();
2540 /// view.Margin = new Extents(10, 5, 15, 20);
2542 /// This way to set the property is prohibited
2544 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2547 /// <since_tizen> 4 </since_tizen>
2548 public Extents Margin
2552 return (Extents)GetValue(MarginProperty);
2556 SetValue(MarginProperty, value);
2557 NotifyPropertyChanged();
2562 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2566 /// // matchParentView matches its size to its parent size.
2567 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2568 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2570 /// // wrapContentView wraps its children with their desired size.
2571 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2572 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2574 /// // exactSizeView shows itself with an exact size.
2575 /// exactSizeView.WidthSpecification = 100;
2576 /// exactSizeView.HeightSpecification = 100;
2579 /// <since_tizen> 6 </since_tizen>
2580 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2581 public int WidthSpecification
2585 return (int)GetValue(WidthSpecificationProperty);
2589 SetValue(WidthSpecificationProperty, value);
2590 NotifyPropertyChanged();
2594 private int InternalWidthSpecification
2602 if (value == widthPolicy)
2605 widthPolicy = value;
2606 if (widthPolicy >= 0)
2608 SizeWidth = widthPolicy;
2610 layout?.RequestLayout();
2615 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2619 /// // matchParentView matches its size to its parent size.
2620 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2621 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2623 /// // wrapContentView wraps its children with their desired size.
2624 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2625 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2627 /// // exactSizeView shows itself with an exact size.
2628 /// exactSizeView.WidthSpecification = 100;
2629 /// exactSizeView.HeightSpecification = 100;
2632 /// <since_tizen> 6 </since_tizen>
2633 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2634 public int HeightSpecification
2638 return (int)GetValue(HeightSpecificationProperty);
2642 SetValue(HeightSpecificationProperty, value);
2643 NotifyPropertyChanged();
2647 private int InternalHeightSpecification
2651 return heightPolicy;
2655 if (value == heightPolicy)
2658 heightPolicy = value;
2659 if (heightPolicy >= 0)
2661 SizeHeight = heightPolicy;
2663 layout?.RequestLayout();
2668 /// Gets the List of transitions for this View.
2670 /// <since_tizen> 6 </since_tizen>
2671 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2675 if (layoutTransitions == null)
2677 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2679 return layoutTransitions;
2684 /// Sets a layout transitions for this View.
2686 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2688 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2690 /// <since_tizen> 6 </since_tizen>
2691 public LayoutTransition LayoutTransition
2695 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2699 SetValue(LayoutTransitionProperty, value);
2700 NotifyPropertyChanged();
2704 private LayoutTransition InternalLayoutTransition
2708 return layoutTransition;
2714 throw new global::System.ArgumentNullException(nameof(value));
2716 if (layoutTransitions == null)
2718 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2721 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2723 AttachTransitionsToChildren(value);
2725 layoutTransition = value;
2730 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2733 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2735 /// <since_tizen> 4 </since_tizen>
2736 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2737 [EditorBrowsable(EditorBrowsableState.Never)]
2738 public Extents PaddingEX
2742 return GetValue(PaddingEXProperty) as Extents;
2746 SetValue(PaddingEXProperty, value);
2750 private Extents InternalPaddingEX
2754 Extents temp = new Extents(0, 0, 0, 0);
2755 var pValue = GetProperty(View.Property.PADDING);
2758 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2764 var temp = new Tizen.NUI.PropertyValue(value);
2765 SetProperty(View.Property.PADDING, temp);
2767 NotifyPropertyChanged();
2768 layout?.RequestLayout();
2773 /// The Color of View. This is an RGBA value.
2774 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2775 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2776 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2777 /// Inherient of color value depend on <see cref="ColorMode"/>.
2781 /// Animatable - This property can be animated using <c>Animation</c> class.
2783 /// The property cascade chaining set is not recommended.
2786 /// This way is recommended for setting the property
2788 /// var view = new View();
2789 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2791 /// This way to set the property is prohibited
2793 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2796 [EditorBrowsable(EditorBrowsableState.Never)]
2801 return (Color)GetValue(ColorProperty);
2805 SetValue(ColorProperty, value);
2806 NotifyPropertyChanged();
2811 /// The Red component of View.Color.
2815 /// Animatable - This property can be animated using <c>Animation</c> class.
2818 [EditorBrowsable(EditorBrowsableState.Never)]
2819 public float ColorRed
2823 return (float)GetValue(ColorRedProperty);
2827 SetValue(ColorRedProperty, value);
2828 NotifyPropertyChanged();
2833 /// The Green component of View.Color.
2837 /// Animatable - This property can be animated using <c>Animation</c> class.
2840 [EditorBrowsable(EditorBrowsableState.Never)]
2841 public float ColorGreen
2845 return (float)GetValue(ColorGreenProperty);
2849 SetValue(ColorGreenProperty, value);
2850 NotifyPropertyChanged();
2855 /// The Blue component of View.Color.
2859 /// Animatable - This property can be animated using <c>Animation</c> class.
2862 [EditorBrowsable(EditorBrowsableState.Never)]
2863 public float ColorBlue
2867 return (float)GetValue(ColorBlueProperty);
2871 SetValue(ColorBlueProperty, value);
2872 NotifyPropertyChanged();
2877 /// Set the layout on this View. Replaces any existing Layout.
2880 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2882 /// <since_tizen> 6 </since_tizen>
2883 public LayoutItem Layout
2887 return GetValue(LayoutProperty) as LayoutItem;
2891 SetValue(LayoutProperty, value);
2895 private LayoutItem InternalLayout
2903 // Do nothing if layout provided is already set on this View.
2904 if (value == layout)
2909 LayoutingDisabled = false;
2912 // If new layout being set already has a owner then that owner receives a replacement default layout.
2913 // First check if the layout to be set already has a owner.
2914 if (value?.Owner != null)
2916 // Previous owner of the layout gets a default layout as a replacement.
2917 value.Owner.Layout = new AbsoluteLayout()
2919 // Copy Margin and Padding to replacement LayoutGroup.
2920 Margin = value.Margin,
2921 Padding = value.Padding,
2925 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2926 // View if no replacement. Previously margin and padding values would have been moved from
2927 // the View to the layout.
2928 if (layout != null) // Existing layout
2932 // Existing layout being replaced so copy over margin and padding values.
2933 value.Margin = layout.Margin;
2934 value.Padding = layout.Padding;
2935 value.SetPositionByLayout = !excludeLayouting;
2939 // Layout not being replaced so restore margin and padding to View.
2940 SetValue(MarginProperty, layout.Margin);
2941 SetValue(PaddingProperty, layout.Padding);
2942 NotifyPropertyChanged();
2947 // First Layout to be added to the View hence copy
2949 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2952 Extents margin = Margin;
2953 Extents padding = Padding;
2954 bool setMargin = false;
2955 bool setPadding = false;
2957 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2959 // If View already has a margin set then store it in Layout instead.
2960 value.Margin = margin;
2961 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2965 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
2967 // If View already has a padding set then store it in Layout instead.
2968 value.Padding = padding;
2969 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
2973 if (setMargin || setPadding)
2975 NotifyPropertyChanged();
2978 value.SetPositionByLayout = !excludeLayouting;
2982 // Remove existing layout from it's parent layout group.
2985 // Set layout to this view
2991 /// The weight of the View, used to share available space in a layout with siblings.
2993 /// <since_tizen> 6 </since_tizen>
3003 layout?.RequestLayout();
3008 /// Whether to load the BackgroundImage synchronously.
3009 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3010 /// Note: For Normal Quad images only.
3012 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3013 [EditorBrowsable(EditorBrowsableState.Never)]
3014 public bool BackgroundImageSynchronosLoading
3018 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3022 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3023 NotifyPropertyChanged();
3027 private bool InternalBackgroundImageSynchronosLoading
3031 return BackgroundImageSynchronousLoading;
3035 BackgroundImageSynchronousLoading = value;
3040 /// Whether to load the BackgroundImage synchronously.
3041 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3042 /// Note: For Normal Quad images only.
3044 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3045 [EditorBrowsable(EditorBrowsableState.Never)]
3046 public bool BackgroundImageSynchronousLoading
3050 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3054 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3055 NotifyPropertyChanged();
3059 private bool InternalBackgroundImageSynchronousLoading
3063 return backgroundImageSynchronousLoading;
3067 backgroundImageSynchronousLoading = value;
3069 if (!string.IsNullOrEmpty(BackgroundImage))
3071 PropertyMap bgMap = this.Background;
3072 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3073 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3080 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3081 [EditorBrowsable(EditorBrowsableState.Never)]
3082 public Vector4 UpdateAreaHint
3086 return (Vector4)GetValue(UpdateAreaHintProperty);
3090 SetValue(UpdateAreaHintProperty, value);
3091 NotifyPropertyChanged();
3096 /// Enable/Disable ControlState propagation for children.
3097 /// It is false by default.
3098 /// If the View needs to share ControlState with descendants, please set it true.
3099 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3101 [EditorBrowsable(EditorBrowsableState.Never)]
3102 public bool EnableControlStatePropagation
3106 return (bool)GetValue(EnableControlStatePropagationProperty);
3110 SetValue(EnableControlStatePropagationProperty, value);
3111 NotifyPropertyChanged();
3115 private bool InternalEnableControlStatePropagation
3117 get => themeData?.ControlStatePropagation ?? false;
3120 if (InternalEnableControlStatePropagation == value) return;
3122 if (themeData == null) themeData = new ThemeData();
3124 themeData.ControlStatePropagation = value;
3126 foreach (View child in Children)
3128 child.EnableControlStatePropagation = value;
3134 /// The ControlStates can propagate from the parent.
3135 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3136 /// if parent view EnableControlState is true.
3137 /// <see cref="EnableControlState"/>.
3138 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3140 [EditorBrowsable(EditorBrowsableState.Never)]
3141 public ControlState PropagatableControlStates
3145 return (ControlState)GetValue(PropagatableControlStatesProperty);
3149 SetValue(PropagatableControlStatesProperty, value);
3150 NotifyPropertyChanged();
3154 private ControlState InternalPropagatableControlStates
3156 get => propagatableControlStates;
3157 set => propagatableControlStates = value;
3161 /// By default, it is false in View, true in Control.
3162 /// Note that if the value is true, the View will be a touch receptor.
3164 [EditorBrowsable(EditorBrowsableState.Never)]
3165 public bool EnableControlState
3169 return (bool)GetValue(EnableControlStateProperty);
3173 SetValue(EnableControlStateProperty, value);
3178 /// Whether the actor grab all touches even if touch leaves its boundary.
3180 /// <returns>true, if it grab all touch after start</returns>
3181 [EditorBrowsable(EditorBrowsableState.Never)]
3182 public bool GrabTouchAfterLeave
3186 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3190 SetValue(GrabTouchAfterLeaveProperty, value);
3194 private bool InternalGrabTouchAfterLeave
3198 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
3202 Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
3203 NotifyPropertyChanged();
3208 /// Whether the view will only receive own touch.
3210 /// <returns>true, if it only receives touches that started from itself.</returns>
3211 [EditorBrowsable(EditorBrowsableState.Never)]
3212 public bool AllowOnlyOwnTouch
3216 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3220 SetValue(AllowOnlyOwnTouchProperty, value);
3224 private bool InternalAllowOnlyOwnTouch
3228 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
3232 Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
3233 NotifyPropertyChanged();
3238 /// Determines which blend equation will be used to render renderers of this actor.
3240 /// <returns>blend equation enum currently assigned</returns>
3241 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3242 [EditorBrowsable(EditorBrowsableState.Never)]
3243 public BlendEquationType BlendEquation
3247 return (BlendEquationType)GetValue(BlendEquationProperty);
3251 SetValue(BlendEquationProperty, value);
3255 private BlendEquationType InternalBlendEquation
3259 return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
3263 Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
3264 NotifyPropertyChanged();
3269 /// If the value is true, the View will change its style as the theme changes.
3270 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3272 /// <since_tizen> 9 </since_tizen>
3273 public bool ThemeChangeSensitive
3275 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3276 set => SetValue(ThemeChangeSensitiveProperty, value);
3280 /// Create Style, it is abstract function and must be override.
3282 [EditorBrowsable(EditorBrowsableState.Never)]
3283 protected virtual ViewStyle CreateViewStyle()
3285 return new ViewStyle();
3289 /// Called after the View's ControlStates changed.
3291 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3292 [EditorBrowsable(EditorBrowsableState.Never)]
3293 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3299 [EditorBrowsable(EditorBrowsableState.Never)]
3300 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3302 isThemeChanged = true;
3303 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3304 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3305 isThemeChanged = false;
3309 /// Apply style instance to the view.
3310 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3312 /// <since_tizen> 9 </since_tizen>
3313 public virtual void ApplyStyle(ViewStyle viewStyle)
3315 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3317 if (themeData == null) themeData = new ThemeData();
3319 themeData.viewStyle = viewStyle;
3321 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3327 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3329 if (bindablePropertyOfView == null)
3334 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3335 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3337 foreach (var sourceProperty in dirtyStyleProperties)
3339 var sourceValue = viewStyle.GetValue(sourceProperty);
3341 if (sourceValue == null)
3346 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3348 // Do not set value again when theme is changed and the value has been set already.
3349 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3354 if (destinationProperty != null)
3356 InternalSetValue(destinationProperty, sourceValue);
3362 /// Get whether the View is culled or not.
3363 /// True means that the View is out of the view frustum.
3366 /// Hidden-API (Inhouse-API).
3368 [EditorBrowsable(EditorBrowsableState.Never)]
3373 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
3378 /// Set or Get TransitionOptions for the page transition.
3379 /// This property is used to define how this view will be transitioned during Page switching.
3381 /// <since_tizen> 9 </since_tizen>
3382 public TransitionOptions TransitionOptions
3386 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3390 SetValue(TransitionOptionsProperty, value);
3391 NotifyPropertyChanged();
3395 private TransitionOptions InternalTransitionOptions
3399 transitionOptions = value;
3403 return transitionOptions;
3408 /// Gets or sets the status of whether the view should emit key event signals.
3409 /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
3411 [EditorBrowsable(EditorBrowsableState.Never)]
3412 public bool DispatchKeyEvents
3416 return (bool)GetValue(DispatchKeyEventsProperty);
3420 SetValue(DispatchKeyEventsProperty, value);
3421 NotifyPropertyChanged();
3426 /// Gets or sets the status of whether touch events can be dispatched.
3427 /// 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.
3428 /// This works without adding a TouchEvent callback in the View.
3430 /// 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.
3433 [EditorBrowsable(EditorBrowsableState.Never)]
3434 public bool DispatchTouchEvents
3438 return dispatchTouchEvents;
3442 if (dispatchTouchEvents != value)
3444 dispatchTouchEvents = value;
3445 if (dispatchTouchEvents == false)
3447 TouchEvent += OnDispatchTouchEvent;
3451 TouchEvent -= OnDispatchTouchEvent;
3457 private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
3463 /// Gets or sets the status of whether the view should emit Gesture event signals.
3464 /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
3465 /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3467 [EditorBrowsable(EditorBrowsableState.Never)]
3468 public bool DispatchGestureEvents
3472 return dispatchGestureEvents;
3476 if (dispatchGestureEvents != value)
3478 dispatchGestureEvents = value;
3479 ConfigGestureDetector(dispatchGestureEvents);
3485 /// Gets or sets the status of whether the view should emit Gesture event signals.
3486 /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
3487 /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3489 [EditorBrowsable(EditorBrowsableState.Never)]
3490 public bool DispatchParentGestureEvents
3494 return dispatchParentGestureEvents;
3498 if (dispatchParentGestureEvents != value)
3500 dispatchParentGestureEvents = value;
3501 ConfigGestureDetector(dispatchParentGestureEvents);
3506 private void ConfigGestureDetector(bool dispatch)
3508 if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
3509 if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
3510 if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
3511 if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
3512 if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
3514 if (dispatch == true)
3516 configGestureCount = configGestureCount > 0 ? configGestureCount-- : 0;
3517 if (configGestureCount == 0)
3519 panGestureDetector.Detach(this);
3520 longGestureDetector.Detach(this);
3521 pinchGestureDetector.Detach(this);
3522 tapGestureDetector.Detach(this);
3523 rotationGestureDetector.Detach(this);
3525 panGestureDetector.Detected -= OnGestureDetected;
3526 longGestureDetector.Detected -= OnGestureDetected;
3527 pinchGestureDetector.Detected -= OnGestureDetected;
3528 tapGestureDetector.Detected -= OnGestureDetected;
3529 rotationGestureDetector.Detected -= OnGestureDetected;
3531 panGestureDetector = null;
3532 longGestureDetector = null;
3533 pinchGestureDetector = null;
3534 tapGestureDetector = null;
3535 rotationGestureDetector = null;
3540 if (configGestureCount == 0)
3542 panGestureDetector.Attach(this);
3543 longGestureDetector.Attach(this);
3544 pinchGestureDetector.Attach(this);
3545 tapGestureDetector.Attach(this);
3546 rotationGestureDetector.Attach(this);
3548 panGestureDetector.Detected += OnGestureDetected;
3549 longGestureDetector.Detected += OnGestureDetected;
3550 pinchGestureDetector.Detected += OnGestureDetected;
3551 tapGestureDetector.Detected += OnGestureDetected;
3552 rotationGestureDetector.Detected += OnGestureDetected;
3554 configGestureCount++;
3558 private void OnGestureDetected(object source, EventArgs e)
3560 // Does notting. This is to consume the gesture.
3564 /// Called when the view is hit through TouchEvent or GestureEvent.
3565 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3566 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3567 /// User can override whether hit or not in HitTest.
3568 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3569 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3571 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3572 [EditorBrowsable(EditorBrowsableState.Never)]
3573 protected virtual bool HitTest(Touch touch)
3579 /// Retrieve the View's current Color.
3582 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3583 /// 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).
3584 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3585 /// and users can get the current actual values through them.
3587 [EditorBrowsable(EditorBrowsableState.Never)]
3588 public Color CurrentColor => GetCurrentColor();
3591 /// Retrieve the current scale factor applied to the View.
3594 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3595 /// 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).
3596 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3597 /// and users can get the current actual values through them.
3599 [EditorBrowsable(EditorBrowsableState.Never)]
3600 public Vector3 CurrentScale => GetCurrentScale();