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 Position internalCurrentPosition = null;
91 private Vector3 internalCurrentWorldPosition = null;
92 private Vector3 internalCurrentScale = null;
93 private Vector3 internalCurrentWorldScale = null;
94 private Vector4 internalCurrentColor = null;
95 private Vector4 internalCurrentWorldColor = null;
96 private Vector2 internalCurrentScreenPosition = null;
100 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
101 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
102 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
103 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
105 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
106 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
107 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
108 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
110 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
111 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
112 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
113 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
115 RegisterAccessibilityDelegate();
119 /// Accessibility mode for controlling View's Accessible implementation.
120 /// It is only relevant when deriving custom controls from View directly,
121 /// as classes derived from CustomView (or any of its subclasses) get the
122 /// Custom mode by default.
124 [EditorBrowsable(EditorBrowsableState.Never)]
125 public enum ViewAccessibilityMode
128 /// Default accessibility implementation. Overriding View.Accessibility...()
129 /// virtual methods will have no effect.
131 [EditorBrowsable(EditorBrowsableState.Never)]
134 /// Custom accessibility implementation. Overriding View.Accessibility...()
135 /// will be necessary to provide accessibility support for the View.
137 [EditorBrowsable(EditorBrowsableState.Never)]
141 private static IntPtr NewWithAccessibilityMode(ViewAccessibilityMode accessibilityMode)
143 switch (accessibilityMode)
145 case ViewAccessibilityMode.Custom:
147 return Interop.View.NewCustom();
149 case ViewAccessibilityMode.Default:
152 return Interop.View.New();
158 /// Creates a new instance of a view.
160 /// <since_tizen> 3 </since_tizen>
161 public View() : this(ViewAccessibilityMode.Default)
165 [EditorBrowsable(EditorBrowsableState.Never)]
166 public View(ViewAccessibilityMode accessibilityMode) : this(NewWithAccessibilityMode(accessibilityMode), true)
168 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
172 [EditorBrowsable(EditorBrowsableState.Never)]
173 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
178 /// Create a new instance of a View with setting the status of shown or hidden.
180 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
181 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
182 [EditorBrowsable(EditorBrowsableState.Never)]
183 public View(bool shown) : this(Interop.View.New(), true)
185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
200 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
202 InitializeStyle(viewStyle);
205 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
209 PositionUsesPivotPoint = false;
212 onWindowSendEventCallback = SendViewAddedEventToWindow;
213 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
214 signal?.Connect(onWindowSendEventCallback);
216 hitTestResultDataCallback = OnHitTestResult;
217 using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
218 touchDataSignal?.Connect(hitTestResultDataCallback);
225 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
226 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
229 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
240 /// The event that is triggered when the View's ControlState is changed.
242 [EditorBrowsable(EditorBrowsableState.Never)]
243 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
245 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
249 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
251 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
252 [EditorBrowsable(EditorBrowsableState.Never)]
253 public bool LayoutSet
262 /// Flag to allow Layouting to be disabled for Views.
263 /// Once a View has a Layout set then any children added to Views from then on will receive
264 /// automatic Layouts.
266 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
267 [EditorBrowsable(EditorBrowsableState.Never)]
268 public static bool LayoutingDisabled { get; set; } = true;
271 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
273 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
274 [EditorBrowsable(EditorBrowsableState.Never)]
275 public static void SetDefaultGrabTouchAfterLeave(bool enable)
277 defaultGrabTouchAfterLeave = enable;
281 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
283 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
284 [EditorBrowsable(EditorBrowsableState.Never)]
285 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
287 defaultAllowOnlyOwnTouch = enable;
291 /// Deprecate. Do not use this.
292 /// The style instance applied to this view.
293 /// Note that do not modify the ViewStyle.
294 /// Modifying ViewStyle will affect other views with same ViewStyle.
296 [EditorBrowsable(EditorBrowsableState.Never)]
297 protected ViewStyle ViewStyle
301 if (themeData == null) themeData = new ThemeData();
303 if (themeData.viewStyle == null)
305 ApplyStyle(CreateViewStyle());
307 return themeData.viewStyle;
312 /// Get/Set the control state.
313 /// Note that the ControlState only available for the classes derived from Control.
314 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
315 /// please set <see cref="EnableControlState"/> to true.
317 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
318 [EditorBrowsable(EditorBrowsableState.Never)]
319 public ControlState ControlState
323 return themeData == null ? ControlState.Normal : themeData.controlStates;
327 if (ControlState == value)
332 var prevState = ControlState;
334 if (themeData == null) themeData = new ThemeData();
335 themeData.controlStates = value;
337 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
339 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
341 if (themeData.ControlStatePropagation)
343 foreach (View child in Children)
345 ControlState allowed = child.PropagatableControlStates;
346 if (allowed.Contains(ControlState.All))
348 child.ControlState = value;
352 ControlState newControlState = child.ControlState;
354 if (allowed.Contains(ControlState.Normal))
356 if (value.Contains(ControlState.Normal))
358 newControlState += ControlState.Normal;
362 newControlState -= ControlState.Normal;
366 if (allowed.Contains(ControlState.Disabled))
368 if (value.Contains(ControlState.Disabled))
370 newControlState += ControlState.Disabled;
374 newControlState -= ControlState.Disabled;
378 if (allowed.Contains(ControlState.Selected))
380 if (value.Contains(ControlState.Selected))
382 newControlState += ControlState.Selected;
386 newControlState -= ControlState.Selected;
390 if (allowed.Contains(ControlState.Pressed))
392 if (value.Contains(ControlState.Pressed))
394 newControlState += ControlState.Pressed;
398 newControlState -= ControlState.Pressed;
402 if (allowed.Contains(ControlState.Focused))
404 if (value.Contains(ControlState.Focused))
406 newControlState += ControlState.Focused;
410 newControlState -= ControlState.Focused;
414 if (allowed.Contains(ControlState.Other))
416 if (value.Contains(ControlState.Other))
418 newControlState += ControlState.Other;
422 newControlState -= ControlState.Other;
426 if (child.ControlState != newControlState)
427 child.ControlState = newControlState;
432 OnControlStateChanged(changeInfo);
434 ControlStateChangedEvent?.Invoke(this, changeInfo);
439 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
441 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
442 [EditorBrowsable(EditorBrowsableState.Never)]
443 public bool ExcludeLayouting
447 return (bool)GetValue(ExcludeLayoutingProperty);
451 SetValue(ExcludeLayoutingProperty, value);
452 NotifyPropertyChanged();
456 private bool InternalExcludeLayouting
460 return excludeLayouting;
464 excludeLayouting = value;
465 if (Layout != null && Layout.SetPositionByLayout == value)
467 Layout.SetPositionByLayout = !value;
468 Layout.RequestLayout();
474 /// The StyleName, type string.
475 /// The value indicates DALi style name defined in json theme file.
477 /// <since_tizen> 3 </since_tizen>
478 public string StyleName
482 return (string)GetValue(StyleNameProperty);
486 SetValue(StyleNameProperty, value);
487 NotifyPropertyChanged();
492 /// The KeyInputFocus, type bool.
494 [EditorBrowsable(EditorBrowsableState.Never)]
495 public bool KeyInputFocus
499 return (bool)GetValue(KeyInputFocusProperty);
503 SetValue(KeyInputFocusProperty, value);
504 NotifyPropertyChanged();
509 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
513 /// The property cascade chaining set is not recommended.
516 /// Animatable - This property can be animated using <c>Animation</c> class.
518 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
523 /// This way is recommended for setting the property
525 /// var view = new View();
526 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
528 /// This way to set the property is prohibited
530 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
533 /// <since_tizen> 3 </since_tizen>
534 public Color BackgroundColor
538 return (Color)GetValue(BackgroundColorProperty);
542 SetValue(BackgroundColorProperty, value);
543 NotifyPropertyChanged();
548 /// The mutually exclusive with "backgroundColor" and "background" type Map.
550 /// <since_tizen> 3 </since_tizen>
551 public string BackgroundImage
555 return (string)GetValue(BackgroundImageProperty);
559 SetValue(BackgroundImageProperty, value);
560 NotifyPropertyChanged();
565 /// Get or set the border of background image.
567 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
568 [EditorBrowsable(EditorBrowsableState.Never)]
569 public Rectangle BackgroundImageBorder
573 return (Rectangle)GetValue(BackgroundImageBorderProperty);
577 SetValue(BackgroundImageBorderProperty, value);
578 NotifyPropertyChanged();
583 /// The background of view.
585 /// <since_tizen> 3 </since_tizen>
586 public Tizen.NUI.PropertyMap Background
590 return (PropertyMap)GetValue(BackgroundProperty);
594 SetValue(BackgroundProperty, value);
595 NotifyPropertyChanged();
600 /// Describes a shadow as an image for a View.
601 /// It is null by default.
604 /// Getter returns copied instance of current shadow.
607 /// The mutually exclusive with "BoxShadow".
611 /// Animatable - This property can be animated using <c>Animation</c> class.
612 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
614 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
616 /// Animatable sub-property : Offset.
619 [EditorBrowsable(EditorBrowsableState.Never)]
620 public ImageShadow ImageShadow
624 return (ImageShadow)GetValue(ImageShadowProperty);
628 SetValue(ImageShadowProperty, value);
629 NotifyPropertyChanged();
634 /// Describes a box shaped shadow drawing for a View.
635 /// It is null by default.
638 /// The mutually exclusive with "ImageShadow".
642 /// Animatable - This property can be animated using <c>Animation</c> class.
643 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
645 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
647 /// Animatable sub-property : Offset, Color, BlurRadius.
650 /// <since_tizen> 9 </since_tizen>
651 public Shadow BoxShadow
655 return (Shadow)GetValue(BoxShadowProperty);
659 SetValue(BoxShadowProperty, value);
660 NotifyPropertyChanged();
665 /// The radius for the rounded corners of the View.
666 /// This will rounds background and shadow edges.
667 /// 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).
668 /// Each radius will clamp internally to the half of smaller of the view's width or height.
669 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
673 /// Animatable - This property can be animated using <c>Animation</c> class.
675 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
679 /// <since_tizen> 9 </since_tizen>
680 public Vector4 CornerRadius
684 return (Vector4)GetValue(CornerRadiusProperty);
688 SetValue(CornerRadiusProperty, value);
689 NotifyPropertyChanged();
694 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
695 /// It is absolute by default.
696 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
698 /// <since_tizen> 9 </since_tizen>
699 public VisualTransformPolicyType CornerRadiusPolicy
701 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
702 set => SetValue(CornerRadiusPolicyProperty, value);
706 /// The width for the borderline of the View.
710 /// Animatable - This property can be animated using <c>Animation</c> class.
712 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
715 /// Note that, an image background may not have borderline if it uses the Border property.
717 /// <since_tizen> 9 </since_tizen>
718 public float BorderlineWidth
722 return (float)GetValue(BorderlineWidthProperty);
726 SetValue(BorderlineWidthProperty, value);
727 NotifyPropertyChanged();
732 /// The color for the borderline of the View.
733 /// It is Color.Black by default.
737 /// Animatable - This property can be animated using <c>Animation</c> class.
739 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
743 /// <since_tizen> 9 </since_tizen>
744 public Color BorderlineColor
748 return (Color)GetValue(BorderlineColorProperty);
752 SetValue(BorderlineColorProperty, value);
753 NotifyPropertyChanged();
758 /// The color selector for the borderline of the View.
759 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
760 /// So this API is internally used only.
762 internal Selector<Color> BorderlineColorSelector
766 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
770 SetValue(BorderlineColorSelectorProperty, value);
771 NotifyPropertyChanged();
776 /// The Relative offset for the borderline of the View.
777 /// Recommended range : [-1.0f to 1.0f].
778 /// If -1.0f, draw borderline inside of the View.
779 /// If 1.0f, draw borderline outside of the View.
780 /// If 0.0f, draw borderline half inside and half outside.
781 /// It is 0.0f by default.
785 /// Animatable - This property can be animated using <c>Animation</c> class.
787 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
791 /// <since_tizen> 9 </since_tizen>
792 public float BorderlineOffset
796 return (float)GetValue(BorderlineOffsetProperty);
800 SetValue(BorderlineOffsetProperty, value);
801 NotifyPropertyChanged();
806 /// The current state of the view.
808 /// <since_tizen> 3 </since_tizen>
813 return (States)GetValue(StateProperty);
817 SetValue(StateProperty, value);
818 NotifyPropertyChanged();
823 /// The current sub state of the view.
825 /// <since_tizen> 3 </since_tizen>
826 public States SubState
830 return (States)GetValue(SubStateProperty);
834 SetValue(SubStateProperty, value);
835 NotifyPropertyChanged();
840 /// Displays a tooltip
842 /// <since_tizen> 3 </since_tizen>
843 public Tizen.NUI.PropertyMap Tooltip
847 return (PropertyMap)GetValue(TooltipProperty);
851 SetValue(TooltipProperty, value);
852 NotifyPropertyChanged();
857 /// Displays a tooltip as a text.
859 /// <since_tizen> 3 </since_tizen>
860 public string TooltipText
864 return GetValue(TooltipTextProperty) as string;
868 SetValue(TooltipTextProperty, value);
872 private string InternalTooltipText
876 using (var propertyValue = GetProperty(Property.TOOLTIP))
878 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
880 return retrivedValue;
882 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
883 return "error to get TooltipText";
888 var temp = new Tizen.NUI.PropertyValue(value);
889 SetProperty(View.Property.TOOLTIP, temp);
891 NotifyPropertyChanged();
896 /// The Child property of FlexContainer.<br />
897 /// The proportion of the free space in the container, the flex item will receive.<br />
898 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
900 /// <since_tizen> 3 </since_tizen>
901 [Obsolete("Deprecated in API8, will be removed in API10.")]
906 return (float)GetValue(FlexProperty);
910 SetValue(FlexProperty, value);
911 NotifyPropertyChanged();
916 /// The Child property of FlexContainer.<br />
917 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
919 /// <since_tizen> 3 </since_tizen>
920 [Obsolete("Deprecated in API8, will be removed in API10.")]
925 return (int)GetValue(AlignSelfProperty);
929 SetValue(AlignSelfProperty, value);
930 NotifyPropertyChanged();
935 /// The Child property of FlexContainer.<br />
936 /// The space around the flex item.<br />
939 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
941 /// <since_tizen> 3 </since_tizen>
942 [Obsolete("Deprecated in API8, will be removed in API10.")]
943 public Vector4 FlexMargin
947 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
948 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
952 SetValue(FlexMarginProperty, value);
953 NotifyPropertyChanged();
958 /// The top-left cell this child occupies, if not set, the first available cell is used.
961 /// The property cascade chaining set is not recommended.
962 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
965 /// This way is recommended for setting the property
967 /// var view = new View();
968 /// view.CellIndex = new Vector2(1, 3);
970 /// This way to set the property is prohibited
972 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
975 /// <since_tizen> 3 </since_tizen>
976 public Vector2 CellIndex
980 return (Vector2)GetValue(CellIndexProperty);
984 SetValue(CellIndexProperty, value);
985 NotifyPropertyChanged();
990 /// The number of rows this child occupies, if not set, the default value is 1.
993 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
995 /// <since_tizen> 3 </since_tizen>
1000 return (float)GetValue(RowSpanProperty);
1004 SetValue(RowSpanProperty, value);
1005 NotifyPropertyChanged();
1010 /// The number of columns this child occupies, if not set, the default value is 1.
1013 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1015 /// <since_tizen> 3 </since_tizen>
1016 public float ColumnSpan
1020 return (float)GetValue(ColumnSpanProperty);
1024 SetValue(ColumnSpanProperty, value);
1025 NotifyPropertyChanged();
1030 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
1033 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1035 /// <since_tizen> 3 </since_tizen>
1036 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1040 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1044 SetValue(CellHorizontalAlignmentProperty, value);
1045 NotifyPropertyChanged();
1050 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1053 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1055 /// <since_tizen> 3 </since_tizen>
1056 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1060 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1064 SetValue(CellVerticalAlignmentProperty, value);
1065 NotifyPropertyChanged();
1070 /// The left focusable view.<br />
1071 /// This will return null if not set.<br />
1072 /// This will also return null if the specified left focusable view is not on a window.<br />
1074 /// <since_tizen> 3 </since_tizen>
1075 public View LeftFocusableView
1077 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1080 return (View)GetValue(LeftFocusableViewProperty);
1084 SetValue(LeftFocusableViewProperty, value);
1085 NotifyPropertyChanged();
1090 /// The right focusable view.<br />
1091 /// This will return null if not set.<br />
1092 /// This will also return null if the specified right focusable view is not on a window.<br />
1094 /// <since_tizen> 3 </since_tizen>
1095 public View RightFocusableView
1097 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1100 return (View)GetValue(RightFocusableViewProperty);
1104 SetValue(RightFocusableViewProperty, value);
1105 NotifyPropertyChanged();
1110 /// The up focusable view.<br />
1111 /// This will return null if not set.<br />
1112 /// This will also return null if the specified up focusable view is not on a window.<br />
1114 /// <since_tizen> 3 </since_tizen>
1115 public View UpFocusableView
1117 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1120 return (View)GetValue(UpFocusableViewProperty);
1124 SetValue(UpFocusableViewProperty, value);
1125 NotifyPropertyChanged();
1130 /// The down focusable view.<br />
1131 /// This will return null if not set.<br />
1132 /// This will also return null if the specified down focusable view is not on a window.<br />
1134 /// <since_tizen> 3 </since_tizen>
1135 public View DownFocusableView
1137 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1140 return (View)GetValue(DownFocusableViewProperty);
1144 SetValue(DownFocusableViewProperty, value);
1145 NotifyPropertyChanged();
1150 /// The clockwise focusable view by rotary wheel.<br />
1151 /// This will return null if not set.<br />
1152 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1154 [EditorBrowsable(EditorBrowsableState.Never)]
1155 public View ClockwiseFocusableView
1157 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1160 return (View)GetValue(ClockwiseFocusableViewProperty);
1164 SetValue(ClockwiseFocusableViewProperty, value);
1165 NotifyPropertyChanged();
1170 /// The counter clockwise focusable view by rotary wheel.<br />
1171 /// This will return null if not set.<br />
1172 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1174 [EditorBrowsable(EditorBrowsableState.Never)]
1175 public View CounterClockwiseFocusableView
1177 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1180 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1184 SetValue(CounterClockwiseFocusableViewProperty, value);
1185 NotifyPropertyChanged();
1190 /// Whether the view should be focusable by keyboard navigation.
1192 /// <since_tizen> 3 </since_tizen>
1193 public bool Focusable
1197 SetValue(FocusableProperty, value);
1198 NotifyPropertyChanged();
1202 return (bool)GetValue(FocusableProperty);
1207 /// Whether the children of this view can be focusable by keyboard navigation. If user sets this to false, the children of this actor view will not be focused.
1208 /// Note : Default value is true.
1210 [EditorBrowsable(EditorBrowsableState.Never)]
1211 public bool FocusableChildren
1215 SetValue(FocusableChildrenProperty, value);
1216 NotifyPropertyChanged();
1220 return (bool)GetValue(FocusableChildrenProperty);
1225 /// Whether this view can focus by touch.
1226 /// If Focusable is false, FocusableInTouch is disabled.
1227 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1229 [EditorBrowsable(EditorBrowsableState.Never)]
1230 public bool FocusableInTouch
1234 SetValue(FocusableInTouchProperty, value);
1235 NotifyPropertyChanged();
1239 return (bool)GetValue(FocusableInTouchProperty);
1244 /// Retrieves the position of the view.
1245 /// The coordinates are relative to the view's parent.
1248 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1249 /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
1250 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1251 /// and users can get the current actual values through them.
1253 /// <since_tizen> 3 </since_tizen>
1254 public Position CurrentPosition
1258 return GetCurrentPosition();
1263 /// Sets the size of a view for the width and the height.<br />
1264 /// Geometry can be scaled to fit within this area.<br />
1265 /// This does not interfere with the view's scale factor.<br />
1266 /// The views default depth is the minimum of width and height.<br />
1269 /// The property cascade chaining set is not recommended.
1272 /// This way is recommended for setting the property
1274 /// var view = new View();
1275 /// view.Size2D = new Size2D(100, 200);
1277 /// This way to set the property is prohibited
1279 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1282 /// <since_tizen> 3 </since_tizen>
1283 public Size2D Size2D
1287 var temp = (Size2D)GetValue(Size2DProperty);
1289 if (this.Layout == null)
1291 if (temp.Width < 0) { temp.Width = 0; }
1292 if (temp.Height < 0) { temp.Height = 0; }
1299 SetValue(Size2DProperty, value);
1301 NotifyPropertyChanged();
1306 /// Retrieves the size of the view.
1307 /// The coordinates are relative to the view's parent.
1310 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1311 /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
1312 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1313 /// and users can get the current actual values through them.
1315 /// <since_tizen> 3 </since_tizen>
1316 public Size2D CurrentSize
1320 return GetCurrentSize();
1325 /// Retrieves and sets the view's opacity.<br />
1329 /// Animatable - This property can be animated using <c>Animation</c> class.
1331 /// animation.AnimateTo(view, "Opacity", 0.5f);
1335 /// <since_tizen> 3 </since_tizen>
1336 public float Opacity
1340 return (float)GetValue(OpacityProperty);
1344 SetValue(OpacityProperty, value);
1345 NotifyPropertyChanged();
1350 /// Sets the position of the view for X and Y.<br />
1351 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1352 /// If the position inheritance is disabled, sets the world position.<br />
1355 /// The property cascade chaining set is not recommended.
1358 /// This way is recommended for setting the property
1360 /// var view = new View();
1361 /// view.Position2D = new Position2D(100, 200);
1363 /// This way to set the property is prohibited
1365 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1368 /// <since_tizen> 3 </since_tizen>
1369 public Position2D Position2D
1373 return (Position2D)GetValue(Position2DProperty);
1377 SetValue(Position2DProperty, value);
1378 NotifyPropertyChanged();
1383 /// Retrieves the screen position of the view.<br />
1385 /// <since_tizen> 3 </since_tizen>
1386 public Vector2 ScreenPosition
1390 return GetCurrentScreenPosition();
1395 /// Retrieves the screen position and size of the view.<br />
1398 /// The float type Rectangle class is not ready yet.
1399 /// Therefore, it transmits data in Vector4 class.
1400 /// This type should later be changed to the appropriate data type.
1402 [EditorBrowsable(EditorBrowsableState.Never)]
1403 public Vector4 ScreenPositionSize
1407 return GetCurrentScreenPositionSize();
1412 /// Determines whether the pivot point should be used to determine the position of the view.
1413 /// This is false by default.
1415 /// <remarks>If false, then the top-left of the view is used for the position.
1416 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1418 /// <since_tizen> 3 </since_tizen>
1419 public bool PositionUsesPivotPoint
1423 return (bool)GetValue(PositionUsesPivotPointProperty);
1427 SetValue(PositionUsesPivotPointProperty, value);
1428 NotifyPropertyChanged();
1433 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1435 /// <since_tizen> 3 </since_tizen>
1436 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1438 "View view = new View(); " +
1439 "view.PivotPoint = PivotPoint.Center; " +
1440 "view.PositionUsesPivotPoint = true;" +
1441 " This has been deprecated in API5 and will be removed in API8")]
1442 [EditorBrowsable(EditorBrowsableState.Never)]
1443 public bool PositionUsesAnchorPoint
1447 return (bool)GetValue(PositionUsesAnchorPointProperty);
1451 SetValue(PositionUsesAnchorPointProperty, value);
1455 private bool InternalPositionUsesAnchorPoint
1459 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
1463 Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
1464 NotifyPropertyChanged();
1469 /// Queries whether the view is connected to the stage.<br />
1470 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1472 /// <since_tizen> 3 </since_tizen>
1473 public bool IsOnWindow
1482 /// Gets the depth in the hierarchy for the view.
1484 /// <since_tizen> 3 </since_tizen>
1485 public int HierarchyDepth
1489 return GetHierarchyDepth();
1494 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1497 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1498 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1499 /// The values set by this property will likely change.
1501 /// <since_tizen> 3 </since_tizen>
1502 public int SiblingOrder
1506 return (int)GetValue(SiblingOrderProperty);
1510 SetValue(SiblingOrderProperty, value);
1512 Layout?.ChangeLayoutSiblingOrder(value);
1514 NotifyPropertyChanged();
1519 /// Returns the natural size of the view.
1522 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1524 /// <since_tizen> 5 </since_tizen>
1525 public Vector3 NaturalSize
1529 Vector3 ret = GetNaturalSize();
1530 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1536 /// Returns the natural size (Size2D) of the view.
1539 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1541 /// <since_tizen> 4 </since_tizen>
1542 public Size2D NaturalSize2D
1546 Vector3 temp = GetNaturalSize();
1547 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1551 sz = new Size2D((int)temp.Width, (int)temp.Height);
1559 /// Gets or sets the origin of a view within its parent's area.<br />
1560 /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent, and (1.0, 1.0, 0.5) is the bottom-right corner.<br />
1561 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1562 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1564 /// <pre>The view has been initialized.</pre>
1565 /// <since_tizen> 3 </since_tizen>
1566 public Position ParentOrigin
1570 Position tmp = (Position)GetValue(ParentOriginProperty);
1571 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1575 SetValue(ParentOriginProperty, value);
1576 NotifyPropertyChanged();
1581 /// Gets or sets the anchor-point of a view.<br />
1582 /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the view, and (1.0, 1.0, 0.5) is the bottom-right corner.<br />
1583 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1584 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1585 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1586 /// <pre>The view has been initialized.</pre>
1589 /// The property cascade chaining set is not recommended.
1592 /// This way is recommended for setting the property
1594 /// var view = new View();
1595 /// view.PivotPoint = PivotPoint.Center;
1597 /// This way to set the property is prohibited
1599 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1602 /// <since_tizen> 3 </since_tizen>
1603 public Position PivotPoint
1607 return (Position)GetValue(PivotPointProperty);
1611 SetValue(PivotPointProperty, value);
1612 NotifyPropertyChanged();
1617 /// Gets or sets the size width of the view.
1621 /// Animatable - This property can be animated using <c>Animation</c> class.
1623 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1627 /// <since_tizen> 3 </since_tizen>
1628 public float SizeWidth
1632 return (float)GetValue(SizeWidthProperty);
1636 SetValue(SizeWidthProperty, value);
1637 NotifyPropertyChanged();
1642 /// Gets or sets the size height of the view.
1646 /// Animatable - This property can be animated using <c>Animation</c> class.
1649 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1652 /// <since_tizen> 3 </since_tizen>
1653 public float SizeHeight
1657 return (float)GetValue(SizeHeightProperty);
1661 SetValue(SizeHeightProperty, value);
1662 NotifyPropertyChanged();
1667 /// Gets or sets the position of the view.<br />
1668 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1669 /// If the position inheritance is disabled, sets the world position.<br />
1673 /// Animatable - This property can be animated using <c>Animation</c> class.
1675 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1678 /// The property cascade chaining set is not recommended.
1681 /// This way is recommended for setting the property
1683 /// var view = new View();
1684 /// view.Position = new Position(100, 200.5f, 0);
1686 /// This way to set the property is prohibited
1688 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1691 /// <since_tizen> 3 </since_tizen>
1692 public Position Position
1696 return (Position)GetValue(PositionProperty);
1700 SetValue(PositionProperty, value);
1701 NotifyPropertyChanged();
1706 /// Gets or sets the position X of the view.
1710 /// Animatable - This property can be animated using <c>Animation</c> class.
1712 /// animation.AnimateTo(view, "PositionX", 50.0f);
1716 /// <since_tizen> 3 </since_tizen>
1717 public float PositionX
1721 return (float)GetValue(PositionXProperty);
1725 SetValue(PositionXProperty, value);
1726 NotifyPropertyChanged();
1731 /// Gets or sets the position Y of the view.
1735 /// Animatable - This property can be animated using <c>Animation</c> class.
1737 /// animation.AnimateTo(view, "PositionY", 50.0f);
1741 /// <since_tizen> 3 </since_tizen>
1742 public float PositionY
1746 return (float)GetValue(PositionYProperty);
1750 SetValue(PositionYProperty, value);
1751 NotifyPropertyChanged();
1756 /// Gets or sets the position Z of the view.
1760 /// Animatable - This property can be animated using <c>Animation</c> class.
1762 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1766 /// <since_tizen> 3 </since_tizen>
1767 public float PositionZ
1771 return (float)GetValue(PositionZProperty);
1775 SetValue(PositionZProperty, value);
1776 NotifyPropertyChanged();
1781 /// Gets or sets the world position of the view.
1783 /// <since_tizen> 3 </since_tizen>
1784 public Vector3 WorldPosition
1788 return GetCurrentWorldPosition();
1793 /// Gets or sets the orientation of the view.<br />
1794 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1798 /// This is an asynchronous method.
1801 /// Animatable - This property can be animated using <c>Animation</c> class.
1803 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1807 /// <since_tizen> 3 </since_tizen>
1808 public Rotation Orientation
1812 return (Rotation)GetValue(OrientationProperty);
1816 SetValue(OrientationProperty, value);
1817 NotifyPropertyChanged();
1822 /// Gets or sets the world orientation of the view.<br />
1824 /// <since_tizen> 3 </since_tizen>
1825 public Rotation WorldOrientation
1829 Rotation temp = new Rotation();
1830 var pValue = GetProperty(View.Property.WorldOrientation);
1838 /// Gets or sets the scale factor applied to the view.<br />
1842 /// Animatable - This property can be animated using <c>Animation</c> class.
1844 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1847 /// The property cascade chaining set is not recommended.
1850 /// This way is recommended for setting the property
1852 /// var view = new View();
1853 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1855 /// This way to set the property is prohibited
1857 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1860 /// <since_tizen> 3 </since_tizen>
1861 public Vector3 Scale
1865 return (Vector3)GetValue(ScaleProperty);
1869 SetValue(ScaleProperty, value);
1870 NotifyPropertyChanged();
1875 /// Gets or sets the scale X factor applied to the view.
1879 /// Animatable - This property can be animated using <c>Animation</c> class.
1881 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1885 /// <since_tizen> 3 </since_tizen>
1890 return (float)GetValue(ScaleXProperty);
1894 SetValue(ScaleXProperty, value);
1895 NotifyPropertyChanged();
1900 /// Gets or sets the scale Y factor applied to the view.
1904 /// Animatable - This property can be animated using <c>Animation</c> class.
1906 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1910 /// <since_tizen> 3 </since_tizen>
1915 return (float)GetValue(ScaleYProperty);
1919 SetValue(ScaleYProperty, value);
1920 NotifyPropertyChanged();
1925 /// Gets or sets the scale Z factor applied to the view.
1929 /// Animatable - This property can be animated using <c>Animation</c> class.
1931 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1935 /// <since_tizen> 3 </since_tizen>
1940 return (float)GetValue(ScaleZProperty);
1944 SetValue(ScaleZProperty, value);
1945 NotifyPropertyChanged();
1950 /// Gets the world scale of the view.
1952 /// <since_tizen> 3 </since_tizen>
1953 public Vector3 WorldScale
1957 return GetCurrentWorldScale();
1962 /// Retrieves the visibility flag of the view.
1966 /// If the view is not visible, then the view and its children will not be rendered.
1967 /// This is regardless of the individual visibility values of the children, i.e., the view will only be rendered if all of its parents have visibility set to true.
1970 /// Animatable - This property can be animated using <c>Animation</c> class.
1972 /// animation.AnimateTo(view, "Visibility", false);
1976 /// <since_tizen> 3 </since_tizen>
1977 public bool Visibility
1981 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
1986 /// Gets the view's world color.
1988 /// <since_tizen> 3 </since_tizen>
1989 public Vector4 WorldColor
1993 return GetCurrentWorldColor();
1998 /// Gets or sets the view's name.
2000 /// <since_tizen> 3 </since_tizen>
2005 return (string)GetValue(NameProperty);
2009 SetValue(NameProperty, value);
2010 NotifyPropertyChanged();
2015 /// Get the number of children held by the view.
2017 /// <since_tizen> 3 </since_tizen>
2018 public new uint ChildCount
2022 return Convert.ToUInt32(Children.Count);
2027 /// Gets the view's ID.
2030 /// <since_tizen> 3 </since_tizen>
2040 /// Gets or sets the status of whether the view should emit touch or hover signals.
2041 /// If a View is made insensitive, then the View and its children are not hittable.
2043 /// <since_tizen> 3 </since_tizen>
2044 public bool Sensitive
2048 return (bool)GetValue(SensitiveProperty);
2052 SetValue(SensitiveProperty, value);
2053 NotifyPropertyChanged();
2058 /// Gets or sets the status of whether the view should be enabled user interactions.
2059 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2061 /// <since_tizen> tizen_next </since_tizen>
2062 [EditorBrowsable(EditorBrowsableState.Never)]
2063 public bool IsEnabled
2067 return (bool)GetValue(IsEnabledProperty);
2071 SetValue(IsEnabledProperty, value);
2072 NotifyPropertyChanged();
2077 /// Gets or sets the status of whether the view should receive a notification when touch or hover motion events leave the boundary of the view.
2079 /// <since_tizen> 3 </since_tizen>
2080 public bool LeaveRequired
2084 return (bool)GetValue(LeaveRequiredProperty);
2088 SetValue(LeaveRequiredProperty, value);
2089 NotifyPropertyChanged();
2094 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2096 /// <since_tizen> 3 </since_tizen>
2097 public bool InheritOrientation
2101 return (bool)GetValue(InheritOrientationProperty);
2105 SetValue(InheritOrientationProperty, value);
2106 NotifyPropertyChanged();
2111 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2113 /// <since_tizen> 3 </since_tizen>
2114 public bool InheritScale
2118 return (bool)GetValue(InheritScaleProperty);
2122 SetValue(InheritScaleProperty, value);
2123 NotifyPropertyChanged();
2128 /// Gets or sets the status of how the view and its children should be drawn.<br />
2129 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2130 /// If an object is in a 3D layer, it will be depth-tested against other objects in the world, i.e., it may be obscured if other objects are in front.<br />
2131 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2132 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2133 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2135 /// <since_tizen> 3 </since_tizen>
2136 public DrawModeType DrawMode
2140 return (DrawModeType)GetValue(DrawModeProperty);
2144 SetValue(DrawModeProperty, value);
2145 NotifyPropertyChanged();
2150 /// Gets or sets the relative to parent size factor of the view.<br />
2151 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2152 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2155 /// The property cascade chaining set is not recommended.
2158 /// This way is recommended for setting the property
2160 /// var text = new TextField();
2161 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2163 /// This way to set the property is prohibited
2165 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2168 /// <since_tizen> 3 </since_tizen>
2169 public Vector3 SizeModeFactor
2173 return (Vector3)GetValue(SizeModeFactorProperty);
2177 SetValue(SizeModeFactorProperty, value);
2178 NotifyPropertyChanged();
2183 /// Gets or sets the width resize policy to be used.
2185 /// <since_tizen> 3 </since_tizen>
2186 public ResizePolicyType WidthResizePolicy
2190 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2194 SetValue(WidthResizePolicyProperty, value);
2195 NotifyPropertyChanged();
2200 /// Gets or sets the height resize policy to be used.
2202 /// <since_tizen> 3 </since_tizen>
2203 public ResizePolicyType HeightResizePolicy
2207 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2211 SetValue(HeightResizePolicyProperty, value);
2212 NotifyPropertyChanged();
2217 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2218 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2220 /// <since_tizen> 3 </since_tizen>
2221 public SizeScalePolicyType SizeScalePolicy
2225 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2229 SetValue(SizeScalePolicyProperty, value);
2230 NotifyPropertyChanged();
2235 /// Gets or sets the status of whether the width size is dependent on the height size.
2237 /// <since_tizen> 3 </since_tizen>
2238 public bool WidthForHeight
2242 return (bool)GetValue(WidthForHeightProperty);
2246 SetValue(WidthForHeightProperty, value);
2247 NotifyPropertyChanged();
2252 /// Gets or sets the status of whether the height size is dependent on the width size.
2254 /// <since_tizen> 3 </since_tizen>
2255 public bool HeightForWidth
2259 return (bool)GetValue(HeightForWidthProperty);
2263 SetValue(HeightForWidthProperty, value);
2264 NotifyPropertyChanged();
2269 /// Gets or sets the padding for use in layout.
2272 /// The property cascade chaining set is not recommended.
2275 /// This way is recommended for setting the property
2277 /// var view = new View();
2278 /// view.Padding = new Extents(5, 5, 5, 5);
2280 /// This way to set the property is prohibited
2282 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2285 /// <since_tizen> 5 </since_tizen>
2286 public Extents Padding
2290 return (Extents)GetValue(PaddingProperty);
2294 SetValue(PaddingProperty, value);
2295 NotifyPropertyChanged();
2300 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2302 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2304 /// The property cascade chaining set is not recommended.
2307 /// This way is recommended for setting the property
2309 /// var view = new View();
2310 /// view.MinimumSize = new Size2D(100, 200);
2312 /// This way to set the property is prohibited
2314 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2317 /// <since_tizen> 3 </since_tizen>
2318 public Size2D MinimumSize
2322 return (Size2D)GetValue(MinimumSizeProperty);
2328 throw new ArgumentNullException(nameof(value));
2332 // Note: it only works if minimum size is >= than natural size.
2333 // To force the size it should be done through the width&height spec or Size2D.
2334 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2335 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2336 layout.RequestLayout();
2338 SetValue(MinimumSizeProperty, value);
2339 NotifyPropertyChanged();
2344 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2347 /// This way is recommended for setting the property
2349 /// var view = new View();
2350 /// view.MaximumSize = new Size2D(100, 200);
2352 /// This way to set the property is prohibited
2354 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2357 /// <since_tizen> 3 </since_tizen>
2358 public Size2D MaximumSize
2362 return (Size2D)GetValue(MaximumSizeProperty);
2366 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2367 // MATCH_PARENT spec + parent container size can be used to limit
2370 layout.RequestLayout();
2372 SetValue(MaximumSizeProperty, value);
2373 NotifyPropertyChanged();
2378 /// Gets or sets whether a child view inherits it's parent's position.<br />
2379 /// Default is to inherit.<br />
2380 /// Switching this off means that using position sets the view's world position, i.e., translates from the world origin (0,0,0) to the pivot point of the view.<br />
2382 /// <since_tizen> 3 </since_tizen>
2383 public bool InheritPosition
2387 return (bool)GetValue(InheritPositionProperty);
2391 SetValue(InheritPositionProperty, value);
2392 NotifyPropertyChanged();
2397 /// Gets or sets the clipping behavior (mode) of it's children.
2399 /// <since_tizen> 3 </since_tizen>
2400 public ClippingModeType ClippingMode
2404 return (ClippingModeType)GetValue(ClippingModeProperty);
2408 SetValue(ClippingModeProperty, value);
2409 NotifyPropertyChanged();
2414 /// Gets the number of renderers held by the view.
2416 /// <since_tizen> 3 </since_tizen>
2417 public uint RendererCount
2421 return GetRendererCount();
2426 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2429 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2431 /// <since_tizen> 3 </since_tizen>
2432 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2434 "View view = new View(); " +
2435 "view.PivotPoint = PivotPoint.Center; " +
2436 "view.PositionUsesPivotPoint = true;")]
2437 [EditorBrowsable(EditorBrowsableState.Never)]
2438 public Position AnchorPoint
2442 return GetValue(AnchorPointProperty) as Position;
2446 SetValue(AnchorPointProperty, value);
2450 private Position InternalAnchorPoint
2454 return GetCurrentAnchorPoint();
2458 SetAnchorPoint(value);
2459 NotifyPropertyChanged();
2464 /// Sets the size of a view for the width, the height and the depth.<br />
2465 /// Geometry can be scaled to fit within this area.<br />
2466 /// This does not interfere with the view's scale factor.<br />
2467 /// The views default depth is the minimum of width and height.<br />
2471 /// Animatable - This property can be animated using <c>Animation</c> class.
2473 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2476 /// The property cascade chaining set is not recommended.
2479 /// This way is recommended for setting the property
2481 /// var view = new View();
2482 /// view.Size = new Size(100.5f, 200, 0);
2484 /// This way to set the property is prohibited
2486 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2489 /// <since_tizen> 5 </since_tizen>
2494 return (Size)GetValue(SizeProperty);
2498 SetValue(SizeProperty, value);
2499 NotifyPropertyChanged();
2504 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2506 /// <since_tizen> 3 </since_tizen>
2507 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2509 "Container parent = view.GetParent(); " +
2510 "View view = parent as View;")]
2511 [EditorBrowsable(EditorBrowsableState.Never)]
2512 public new View Parent
2517 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2518 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2519 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2521 if (basehandle is Layer layer)
2523 ret = new View(Layer.getCPtr(layer).Handle, false);
2524 NUILog.Error("This Parent property is deprecated, should do not be used");
2528 ret = basehandle as View;
2531 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2532 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2534 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2540 /// Gets/Sets whether inherit parent's the layout Direction.
2542 /// <since_tizen> 4 </since_tizen>
2543 public bool InheritLayoutDirection
2547 return (bool)GetValue(InheritLayoutDirectionProperty);
2551 SetValue(InheritLayoutDirectionProperty, value);
2552 NotifyPropertyChanged();
2557 /// Gets/Sets the layout Direction.
2559 /// <since_tizen> 4 </since_tizen>
2560 public ViewLayoutDirectionType LayoutDirection
2564 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2568 SetValue(LayoutDirectionProperty, value);
2569 NotifyPropertyChanged();
2570 layout?.RequestLayout();
2575 /// Gets or sets the Margin for use in layout.
2578 /// Margin property is supported by Layout algorithms and containers.
2579 /// Please Set Layout if you want to use Margin property.
2580 /// The property cascade chaining set is not recommended.
2583 /// This way is recommended for setting the property
2585 /// var view = new View();
2586 /// view.Margin = new Extents(10, 5, 15, 20);
2588 /// This way to set the property is prohibited
2590 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2593 /// <since_tizen> 4 </since_tizen>
2594 public Extents Margin
2598 return (Extents)GetValue(MarginProperty);
2602 SetValue(MarginProperty, value);
2603 NotifyPropertyChanged();
2608 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2612 /// // matchParentView matches its size to its parent size.
2613 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2614 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2616 /// // wrapContentView wraps its children with their desired size.
2617 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2618 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2620 /// // exactSizeView shows itself with an exact size.
2621 /// exactSizeView.WidthSpecification = 100;
2622 /// exactSizeView.HeightSpecification = 100;
2625 /// <since_tizen> 6 </since_tizen>
2626 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2627 public int WidthSpecification
2631 return (int)GetValue(WidthSpecificationProperty);
2635 SetValue(WidthSpecificationProperty, value);
2636 NotifyPropertyChanged();
2640 private int InternalWidthSpecification
2648 if (value == widthPolicy)
2651 widthPolicy = value;
2652 if (widthPolicy >= 0)
2654 SizeWidth = widthPolicy;
2656 layout?.RequestLayout();
2661 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2665 /// // matchParentView matches its size to its parent size.
2666 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2667 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2669 /// // wrapContentView wraps its children with their desired size.
2670 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2671 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2673 /// // exactSizeView shows itself with an exact size.
2674 /// exactSizeView.WidthSpecification = 100;
2675 /// exactSizeView.HeightSpecification = 100;
2678 /// <since_tizen> 6 </since_tizen>
2679 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2680 public int HeightSpecification
2684 return (int)GetValue(HeightSpecificationProperty);
2688 SetValue(HeightSpecificationProperty, value);
2689 NotifyPropertyChanged();
2693 private int InternalHeightSpecification
2697 return heightPolicy;
2701 if (value == heightPolicy)
2704 heightPolicy = value;
2705 if (heightPolicy >= 0)
2707 SizeHeight = heightPolicy;
2709 layout?.RequestLayout();
2714 /// Gets the List of transitions for this View.
2716 /// <since_tizen> 6 </since_tizen>
2717 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2721 if (layoutTransitions == null)
2723 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2725 return layoutTransitions;
2730 /// Sets a layout transitions for this View.
2732 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2734 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2736 /// <since_tizen> 6 </since_tizen>
2737 public LayoutTransition LayoutTransition
2741 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2745 SetValue(LayoutTransitionProperty, value);
2746 NotifyPropertyChanged();
2750 private LayoutTransition InternalLayoutTransition
2754 return layoutTransition;
2760 throw new global::System.ArgumentNullException(nameof(value));
2762 if (layoutTransitions == null)
2764 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2767 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2769 AttachTransitionsToChildren(value);
2771 layoutTransition = value;
2776 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2779 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2781 /// <since_tizen> 4 </since_tizen>
2782 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2783 [EditorBrowsable(EditorBrowsableState.Never)]
2784 public Extents PaddingEX
2788 return GetValue(PaddingEXProperty) as Extents;
2792 SetValue(PaddingEXProperty, value);
2796 private Extents InternalPaddingEX
2800 Extents temp = new Extents(0, 0, 0, 0);
2801 var pValue = GetProperty(View.Property.PADDING);
2804 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2810 var temp = new Tizen.NUI.PropertyValue(value);
2811 SetProperty(View.Property.PADDING, temp);
2813 NotifyPropertyChanged();
2814 layout?.RequestLayout();
2819 /// The Color of View. This is an RGBA value.
2820 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2821 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2822 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2823 /// Inherient of color value depend on <see cref="ColorMode"/>.
2827 /// Animatable - This property can be animated using <c>Animation</c> class.
2829 /// The property cascade chaining set is not recommended.
2832 /// This way is recommended for setting the property
2834 /// var view = new View();
2835 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2837 /// This way to set the property is prohibited
2839 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2842 [EditorBrowsable(EditorBrowsableState.Never)]
2847 return (Color)GetValue(ColorProperty);
2851 SetValue(ColorProperty, value);
2852 NotifyPropertyChanged();
2857 /// The Red component of View.Color.
2861 /// Animatable - This property can be animated using <c>Animation</c> class.
2864 [EditorBrowsable(EditorBrowsableState.Never)]
2865 public float ColorRed
2869 return (float)GetValue(ColorRedProperty);
2873 SetValue(ColorRedProperty, value);
2874 NotifyPropertyChanged();
2879 /// The Green component of View.Color.
2883 /// Animatable - This property can be animated using <c>Animation</c> class.
2886 [EditorBrowsable(EditorBrowsableState.Never)]
2887 public float ColorGreen
2891 return (float)GetValue(ColorGreenProperty);
2895 SetValue(ColorGreenProperty, value);
2896 NotifyPropertyChanged();
2901 /// The Blue component of View.Color.
2905 /// Animatable - This property can be animated using <c>Animation</c> class.
2908 [EditorBrowsable(EditorBrowsableState.Never)]
2909 public float ColorBlue
2913 return (float)GetValue(ColorBlueProperty);
2917 SetValue(ColorBlueProperty, value);
2918 NotifyPropertyChanged();
2923 /// Set the layout on this View. Replaces any existing Layout.
2926 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2928 /// <since_tizen> 6 </since_tizen>
2929 public LayoutItem Layout
2933 return GetValue(LayoutProperty) as LayoutItem;
2937 SetValue(LayoutProperty, value);
2941 private LayoutItem InternalLayout
2949 // Do nothing if layout provided is already set on this View.
2950 if (value == layout)
2955 LayoutingDisabled = false;
2958 // If new layout being set already has a owner then that owner receives a replacement default layout.
2959 // First check if the layout to be set already has a owner.
2960 if (value?.Owner != null)
2962 // Previous owner of the layout gets a default layout as a replacement.
2963 value.Owner.Layout = new AbsoluteLayout()
2965 // Copy Margin and Padding to replacement LayoutGroup.
2966 Margin = value.Margin,
2967 Padding = value.Padding,
2971 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2972 // View if no replacement. Previously margin and padding values would have been moved from
2973 // the View to the layout.
2974 if (layout != null) // Existing layout
2978 // Existing layout being replaced so copy over margin and padding values.
2979 value.Margin = layout.Margin;
2980 value.Padding = layout.Padding;
2981 value.SetPositionByLayout = !excludeLayouting;
2985 // Layout not being replaced so restore margin and padding to View.
2986 SetValue(MarginProperty, layout.Margin);
2987 SetValue(PaddingProperty, layout.Padding);
2988 NotifyPropertyChanged();
2993 // First Layout to be added to the View hence copy
2995 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2998 Extents margin = Margin;
2999 Extents padding = Padding;
3000 bool setMargin = false;
3001 bool setPadding = false;
3003 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
3005 // If View already has a margin set then store it in Layout instead.
3006 value.Margin = margin;
3007 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
3011 // The calculation of the native size of the text component requires padding.
3012 // Don't overwrite the zero padding.
3013 bool isTextLayout = (value is Tizen.NUI.BaseComponents.TextLabel.TextLabelLayout) ||
3014 (value is Tizen.NUI.BaseComponents.TextField.TextFieldLayout) ||
3015 (value is Tizen.NUI.BaseComponents.TextEditor.TextEditorLayout);
3017 if (!isTextLayout && (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0))
3019 // If View already has a padding set then store it in Layout instead.
3020 value.Padding = padding;
3021 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
3025 if (setMargin || setPadding)
3027 NotifyPropertyChanged();
3030 value.SetPositionByLayout = !excludeLayouting;
3034 // Remove existing layout from it's parent layout group.
3037 // Set layout to this view
3043 /// The weight of the View, used to share available space in a layout with siblings.
3045 /// <since_tizen> 6 </since_tizen>
3055 layout?.RequestLayout();
3060 /// Whether to load the BackgroundImage synchronously.
3061 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3062 /// Note: For Normal Quad images only.
3064 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3065 [EditorBrowsable(EditorBrowsableState.Never)]
3066 public bool BackgroundImageSynchronosLoading
3070 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3074 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3075 NotifyPropertyChanged();
3079 private bool InternalBackgroundImageSynchronosLoading
3083 return BackgroundImageSynchronousLoading;
3087 BackgroundImageSynchronousLoading = value;
3092 /// Whether to load the BackgroundImage synchronously.
3093 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3094 /// Note: For Normal Quad images only.
3096 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3097 [EditorBrowsable(EditorBrowsableState.Never)]
3098 public bool BackgroundImageSynchronousLoading
3102 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3106 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3107 NotifyPropertyChanged();
3111 private bool InternalBackgroundImageSynchronousLoading
3115 return backgroundImageSynchronousLoading;
3119 backgroundImageSynchronousLoading = value;
3121 if (!string.IsNullOrEmpty(BackgroundImage))
3123 PropertyMap bgMap = this.Background;
3124 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3125 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3132 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3133 [EditorBrowsable(EditorBrowsableState.Never)]
3134 public Vector4 UpdateAreaHint
3138 return (Vector4)GetValue(UpdateAreaHintProperty);
3142 SetValue(UpdateAreaHintProperty, value);
3143 NotifyPropertyChanged();
3148 /// Enable/Disable ControlState propagation for children.
3149 /// It is false by default.
3150 /// If the View needs to share ControlState with descendants, please set it true.
3151 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3153 [EditorBrowsable(EditorBrowsableState.Never)]
3154 public bool EnableControlStatePropagation
3158 return (bool)GetValue(EnableControlStatePropagationProperty);
3162 SetValue(EnableControlStatePropagationProperty, value);
3163 NotifyPropertyChanged();
3167 private bool InternalEnableControlStatePropagation
3169 get => themeData?.ControlStatePropagation ?? false;
3172 if (InternalEnableControlStatePropagation == value) return;
3174 if (themeData == null) themeData = new ThemeData();
3176 themeData.ControlStatePropagation = value;
3178 foreach (View child in Children)
3180 child.EnableControlStatePropagation = value;
3186 /// The ControlStates can propagate from the parent.
3187 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3188 /// if parent view EnableControlState is true.
3189 /// <see cref="EnableControlState"/>.
3190 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3192 [EditorBrowsable(EditorBrowsableState.Never)]
3193 public ControlState PropagatableControlStates
3197 return (ControlState)GetValue(PropagatableControlStatesProperty);
3201 SetValue(PropagatableControlStatesProperty, value);
3202 NotifyPropertyChanged();
3206 private ControlState InternalPropagatableControlStates
3208 get => propagatableControlStates;
3209 set => propagatableControlStates = value;
3213 /// By default, it is false in View, true in Control.
3214 /// Note that if the value is true, the View will be a touch receptor.
3216 [EditorBrowsable(EditorBrowsableState.Never)]
3217 public bool EnableControlState
3221 return (bool)GetValue(EnableControlStateProperty);
3225 SetValue(EnableControlStateProperty, value);
3230 /// Whether the actor grab all touches even if touch leaves its boundary.
3232 /// <returns>true, if it grab all touch after start</returns>
3233 [EditorBrowsable(EditorBrowsableState.Never)]
3234 public bool GrabTouchAfterLeave
3238 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3242 SetValue(GrabTouchAfterLeaveProperty, value);
3246 private bool InternalGrabTouchAfterLeave
3250 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
3254 Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
3255 NotifyPropertyChanged();
3260 /// Whether the view will only receive own touch.
3262 /// <returns>true, if it only receives touches that started from itself.</returns>
3263 [EditorBrowsable(EditorBrowsableState.Never)]
3264 public bool AllowOnlyOwnTouch
3268 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3272 SetValue(AllowOnlyOwnTouchProperty, value);
3276 private bool InternalAllowOnlyOwnTouch
3280 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
3284 Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
3285 NotifyPropertyChanged();
3290 /// Determines which blend equation will be used to render renderers of this actor.
3292 /// <returns>blend equation enum currently assigned</returns>
3293 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3294 [EditorBrowsable(EditorBrowsableState.Never)]
3295 public BlendEquationType BlendEquation
3299 return (BlendEquationType)GetValue(BlendEquationProperty);
3303 SetValue(BlendEquationProperty, value);
3307 private BlendEquationType InternalBlendEquation
3311 return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
3315 Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
3316 NotifyPropertyChanged();
3321 /// If the value is true, the View will change its style as the theme changes.
3322 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3324 /// <since_tizen> 9 </since_tizen>
3325 public bool ThemeChangeSensitive
3327 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3328 set => SetValue(ThemeChangeSensitiveProperty, value);
3332 /// Create Style, it is abstract function and must be override.
3334 [EditorBrowsable(EditorBrowsableState.Never)]
3335 protected virtual ViewStyle CreateViewStyle()
3337 return new ViewStyle();
3341 /// Called after the View's ControlStates changed.
3343 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3344 [EditorBrowsable(EditorBrowsableState.Never)]
3345 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3351 [EditorBrowsable(EditorBrowsableState.Never)]
3352 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3354 isThemeChanged = true;
3355 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3356 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3357 isThemeChanged = false;
3361 /// Apply style instance to the view.
3362 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3364 /// <since_tizen> 9 </since_tizen>
3365 public virtual void ApplyStyle(ViewStyle viewStyle)
3367 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3369 if (themeData == null) themeData = new ThemeData();
3371 themeData.viewStyle = viewStyle;
3373 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3379 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3381 if (bindablePropertyOfView == null)
3386 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3387 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3389 foreach (var sourceProperty in dirtyStyleProperties)
3391 var sourceValue = viewStyle.GetValue(sourceProperty);
3393 if (sourceValue == null)
3398 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3400 // Do not set value again when theme is changed and the value has been set already.
3401 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3406 if (destinationProperty != null)
3408 InternalSetValue(destinationProperty, sourceValue);
3414 /// Get whether the View is culled or not.
3415 /// True means that the View is out of the view frustum.
3418 /// Hidden-API (Inhouse-API).
3420 [EditorBrowsable(EditorBrowsableState.Never)]
3425 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
3430 /// Set or Get TransitionOptions for the page transition.
3431 /// This property is used to define how this view will be transitioned during Page switching.
3433 /// <since_tizen> 9 </since_tizen>
3434 public TransitionOptions TransitionOptions
3438 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3442 SetValue(TransitionOptionsProperty, value);
3443 NotifyPropertyChanged();
3447 private TransitionOptions InternalTransitionOptions
3451 transitionOptions = value;
3455 return transitionOptions;
3460 /// Gets or sets the status of whether the view should emit key event signals.
3461 /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
3463 [EditorBrowsable(EditorBrowsableState.Never)]
3464 public bool DispatchKeyEvents
3468 return (bool)GetValue(DispatchKeyEventsProperty);
3472 SetValue(DispatchKeyEventsProperty, value);
3473 NotifyPropertyChanged();
3478 /// Gets or sets the status of whether touch events can be dispatched.
3479 /// 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.
3480 /// This works without adding a TouchEvent callback in the View.
3482 /// 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.
3485 [EditorBrowsable(EditorBrowsableState.Never)]
3486 public bool DispatchTouchEvents
3490 return dispatchTouchEvents;
3494 if (dispatchTouchEvents != value)
3496 dispatchTouchEvents = value;
3497 if (dispatchTouchEvents == false)
3499 TouchEvent += OnDispatchTouchEvent;
3503 TouchEvent -= OnDispatchTouchEvent;
3509 private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
3515 /// Gets or sets the status of whether the view should emit Gesture event signals.
3516 /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
3517 /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3519 [EditorBrowsable(EditorBrowsableState.Never)]
3520 public bool DispatchGestureEvents
3524 return dispatchGestureEvents;
3528 if (dispatchGestureEvents != value)
3530 dispatchGestureEvents = value;
3531 ConfigGestureDetector(dispatchGestureEvents);
3537 /// Gets or sets the status of whether the view should emit Gesture event signals.
3538 /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
3539 /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3541 [EditorBrowsable(EditorBrowsableState.Never)]
3542 public bool DispatchParentGestureEvents
3546 return dispatchParentGestureEvents;
3550 if (dispatchParentGestureEvents != value)
3552 dispatchParentGestureEvents = value;
3553 ConfigGestureDetector(dispatchParentGestureEvents);
3558 private void ConfigGestureDetector(bool dispatch)
3560 if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
3561 if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
3562 if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
3563 if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
3564 if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
3566 if (dispatch == true)
3568 configGestureCount = configGestureCount > 0 ? configGestureCount - 1 : 0;
3569 if (configGestureCount == 0)
3571 panGestureDetector.Detach(this);
3572 longGestureDetector.Detach(this);
3573 pinchGestureDetector.Detach(this);
3574 tapGestureDetector.Detach(this);
3575 rotationGestureDetector.Detach(this);
3577 panGestureDetector.Detected -= OnGestureDetected;
3578 longGestureDetector.Detected -= OnGestureDetected;
3579 pinchGestureDetector.Detected -= OnGestureDetected;
3580 tapGestureDetector.Detected -= OnGestureDetected;
3581 rotationGestureDetector.Detected -= OnGestureDetected;
3586 if (configGestureCount == 0)
3588 panGestureDetector.Attach(this);
3589 longGestureDetector.Attach(this);
3590 pinchGestureDetector.Attach(this);
3591 tapGestureDetector.Attach(this);
3592 rotationGestureDetector.Attach(this);
3594 panGestureDetector.Detected += OnGestureDetected;
3595 longGestureDetector.Detected += OnGestureDetected;
3596 pinchGestureDetector.Detected += OnGestureDetected;
3597 tapGestureDetector.Detected += OnGestureDetected;
3598 rotationGestureDetector.Detected += OnGestureDetected;
3600 configGestureCount++;
3604 private void OnGestureDetected(object source, EventArgs e)
3606 // Does notting. This is to consume the gesture.
3610 /// Called when the view is hit through TouchEvent or GestureEvent.
3611 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3612 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3613 /// User can override whether hit or not in HitTest.
3614 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3615 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3617 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3618 [EditorBrowsable(EditorBrowsableState.Never)]
3619 protected virtual bool HitTest(Touch touch)
3625 /// Retrieve the View's current Color.
3628 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3629 /// 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).
3630 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3631 /// and users can get the current actual values through them.
3633 [EditorBrowsable(EditorBrowsableState.Never)]
3634 public Color CurrentColor => GetCurrentColor();
3637 /// Retrieve the current scale factor applied to the View.
3640 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3641 /// 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).
3642 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3643 /// and users can get the current actual values through them.
3645 [EditorBrowsable(EditorBrowsableState.Never)]
3646 public Vector3 CurrentScale => GetCurrentScale();