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;
86 #if NUI_PROPERTY_CHANGE_1
87 private string internalName = string.Empty;
89 #if NUI_PROPERTY_CHANGE_3
90 private Vector3 internalCurrentParentOrigin = null;
91 private Vector3 internalCurrentAnchorPoint = null;
92 private Vector3 internalTargetSize = null;
93 private Size2D internalCurrentSize = null;
94 private Vector3 internalNaturalSize = null;
95 private Position internalCurrentPosition = null;
96 private Vector3 internalCurrentWorldPosition = null;
97 private Vector3 internalCurrentScale = null;
98 private Vector3 internalCurrentWorldScale = null;
99 private Vector4 internalCurrentColor = null;
100 private Vector4 internalCurrentWorldColor = null;
105 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
106 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
107 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
108 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
110 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
111 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
112 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
113 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
115 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
116 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
117 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
118 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
120 RegisterAccessibilityDelegate();
124 /// Creates a new instance of a view.
126 /// <since_tizen> 3 </since_tizen>
127 public View() : this(Interop.View.New(), true)
129 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
132 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
133 [EditorBrowsable(EditorBrowsableState.Never)]
134 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
139 /// Create a new instance of a View with setting the status of shown or hidden.
141 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
142 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
143 [EditorBrowsable(EditorBrowsableState.Never)]
144 public View(bool shown) : this(Interop.View.New(), true)
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
161 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
163 InitializeStyle(viewStyle);
166 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
170 PositionUsesPivotPoint = false;
173 onWindowSendEventCallback = SendViewAddedEventToWindow;
174 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
175 signal?.Connect(onWindowSendEventCallback);
177 hitTestResultDataCallback = OnHitTestResult;
178 using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
179 touchDataSignal?.Connect(hitTestResultDataCallback);
186 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
187 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
190 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
201 /// The event that is triggered when the View's ControlState is changed.
203 [EditorBrowsable(EditorBrowsableState.Never)]
204 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
206 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
210 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
212 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
213 [EditorBrowsable(EditorBrowsableState.Never)]
214 public bool LayoutSet
223 /// Flag to allow Layouting to be disabled for Views.
224 /// Once a View has a Layout set then any children added to Views from then on will receive
225 /// automatic Layouts.
227 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
228 [EditorBrowsable(EditorBrowsableState.Never)]
229 public static bool LayoutingDisabled { get; set; } = true;
232 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
234 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
235 [EditorBrowsable(EditorBrowsableState.Never)]
236 public static void SetDefaultGrabTouchAfterLeave(bool enable)
238 defaultGrabTouchAfterLeave = enable;
242 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
244 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
245 [EditorBrowsable(EditorBrowsableState.Never)]
246 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
248 defaultAllowOnlyOwnTouch = enable;
252 /// Deprecate. Do not use this.
253 /// The style instance applied to this view.
254 /// Note that do not modify the ViewStyle.
255 /// Modifying ViewStyle will affect other views with same ViewStyle.
257 [EditorBrowsable(EditorBrowsableState.Never)]
258 protected ViewStyle ViewStyle
262 if (themeData == null) themeData = new ThemeData();
264 if (themeData.viewStyle == null)
266 ApplyStyle(CreateViewStyle());
268 return themeData.viewStyle;
273 /// Get/Set the control state.
274 /// Note that the ControlState only available for the classes derived from Control.
275 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
276 /// please set <see cref="EnableControlState"/> to true.
278 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
279 [EditorBrowsable(EditorBrowsableState.Never)]
280 public ControlState ControlState
284 return themeData == null ? ControlState.Normal : themeData.controlStates;
288 if (ControlState == value)
293 var prevState = ControlState;
295 if (themeData == null) themeData = new ThemeData();
296 themeData.controlStates = value;
298 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
300 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
302 if (themeData.ControlStatePropagation)
304 foreach (View child in Children)
306 ControlState allowed = child.PropagatableControlStates;
307 if (allowed.Contains(ControlState.All))
309 child.ControlState = value;
313 ControlState newControlState = child.ControlState;
315 if (allowed.Contains(ControlState.Normal))
317 if (value.Contains(ControlState.Normal))
319 newControlState += ControlState.Normal;
323 newControlState -= ControlState.Normal;
327 if (allowed.Contains(ControlState.Disabled))
329 if (value.Contains(ControlState.Disabled))
331 newControlState += ControlState.Disabled;
335 newControlState -= ControlState.Disabled;
339 if (allowed.Contains(ControlState.Selected))
341 if (value.Contains(ControlState.Selected))
343 newControlState += ControlState.Selected;
347 newControlState -= ControlState.Selected;
351 if (allowed.Contains(ControlState.Pressed))
353 if (value.Contains(ControlState.Pressed))
355 newControlState += ControlState.Pressed;
359 newControlState -= ControlState.Pressed;
363 if (allowed.Contains(ControlState.Focused))
365 if (value.Contains(ControlState.Focused))
367 newControlState += ControlState.Focused;
371 newControlState -= ControlState.Focused;
375 if (allowed.Contains(ControlState.Other))
377 if (value.Contains(ControlState.Other))
379 newControlState += ControlState.Other;
383 newControlState -= ControlState.Other;
387 if (child.ControlState != newControlState)
388 child.ControlState = newControlState;
393 OnControlStateChanged(changeInfo);
395 ControlStateChangedEvent?.Invoke(this, changeInfo);
400 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
402 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
403 [EditorBrowsable(EditorBrowsableState.Never)]
404 public bool ExcludeLayouting
408 return (bool)GetValue(ExcludeLayoutingProperty);
412 SetValue(ExcludeLayoutingProperty, value);
413 NotifyPropertyChanged();
417 private bool InternalExcludeLayouting
421 return excludeLayouting;
425 excludeLayouting = value;
426 if (Layout != null && Layout.SetPositionByLayout == value)
428 Layout.SetPositionByLayout = !value;
429 Layout.RequestLayout();
435 /// The StyleName, type string.
436 /// The value indicates DALi style name defined in json theme file.
438 /// <since_tizen> 3 </since_tizen>
439 public string StyleName
443 return (string)GetValue(StyleNameProperty);
447 SetValue(StyleNameProperty, value);
448 NotifyPropertyChanged();
453 /// The KeyInputFocus, type bool.
455 [EditorBrowsable(EditorBrowsableState.Never)]
456 public bool KeyInputFocus
460 return (bool)GetValue(KeyInputFocusProperty);
464 SetValue(KeyInputFocusProperty, value);
465 NotifyPropertyChanged();
470 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
474 /// The property cascade chaining set is not recommended.
477 /// Animatable - This property can be animated using <c>Animation</c> class.
479 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
484 /// This way is recommended for setting the property
486 /// var view = new View();
487 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
489 /// This way to set the property is prohibited
491 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
494 /// <since_tizen> 3 </since_tizen>
495 public Color BackgroundColor
499 return (Color)GetValue(BackgroundColorProperty);
503 SetValue(BackgroundColorProperty, value);
504 NotifyPropertyChanged();
509 /// The mutually exclusive with "backgroundColor" and "background" type Map.
511 /// <since_tizen> 3 </since_tizen>
512 public string BackgroundImage
516 return (string)GetValue(BackgroundImageProperty);
520 SetValue(BackgroundImageProperty, value);
521 NotifyPropertyChanged();
526 /// Get or set the border of background image.
528 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
529 [EditorBrowsable(EditorBrowsableState.Never)]
530 public Rectangle BackgroundImageBorder
534 return (Rectangle)GetValue(BackgroundImageBorderProperty);
538 SetValue(BackgroundImageBorderProperty, value);
539 NotifyPropertyChanged();
544 /// The background of view.
546 /// <since_tizen> 3 </since_tizen>
547 public Tizen.NUI.PropertyMap Background
551 return (PropertyMap)GetValue(BackgroundProperty);
555 SetValue(BackgroundProperty, value);
556 NotifyPropertyChanged();
561 /// Describes a shadow as an image for a View.
562 /// It is null by default.
565 /// Getter returns copied instance of current shadow.
568 /// The mutually exclusive with "BoxShadow".
572 /// Animatable - This property can be animated using <c>Animation</c> class.
573 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
575 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
577 /// Animatable sub-property : Offset.
580 [EditorBrowsable(EditorBrowsableState.Never)]
581 public ImageShadow ImageShadow
585 return (ImageShadow)GetValue(ImageShadowProperty);
589 SetValue(ImageShadowProperty, value);
590 NotifyPropertyChanged();
595 /// Describes a box shaped shadow drawing for a View.
596 /// It is null by default.
599 /// The mutually exclusive with "ImageShadow".
603 /// Animatable - This property can be animated using <c>Animation</c> class.
604 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
606 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
608 /// Animatable sub-property : Offset, Color, BlurRadius.
611 /// <since_tizen> 9 </since_tizen>
612 public Shadow BoxShadow
616 return (Shadow)GetValue(BoxShadowProperty);
620 SetValue(BoxShadowProperty, value);
621 NotifyPropertyChanged();
626 /// The radius for the rounded corners of the View.
627 /// This will rounds background and shadow edges.
628 /// 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).
629 /// Each radius will clamp internally to the half of smaller of the view's width or height.
630 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
634 /// Animatable - This property can be animated using <c>Animation</c> class.
636 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
640 /// <since_tizen> 9 </since_tizen>
641 public Vector4 CornerRadius
645 return (Vector4)GetValue(CornerRadiusProperty);
649 SetValue(CornerRadiusProperty, value);
650 NotifyPropertyChanged();
655 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
656 /// It is absolute by default.
657 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
659 /// <since_tizen> 9 </since_tizen>
660 public VisualTransformPolicyType CornerRadiusPolicy
662 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
663 set => SetValue(CornerRadiusPolicyProperty, value);
667 /// The width for the borderline of the View.
671 /// Animatable - This property can be animated using <c>Animation</c> class.
673 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
676 /// Note that, an image background may not have borderline if it uses the Border property.
678 /// <since_tizen> 9 </since_tizen>
679 public float BorderlineWidth
683 return (float)GetValue(BorderlineWidthProperty);
687 SetValue(BorderlineWidthProperty, value);
688 NotifyPropertyChanged();
693 /// The color for the borderline of the View.
694 /// It is Color.Black by default.
698 /// Animatable - This property can be animated using <c>Animation</c> class.
700 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
704 /// <since_tizen> 9 </since_tizen>
705 public Color BorderlineColor
709 return (Color)GetValue(BorderlineColorProperty);
713 SetValue(BorderlineColorProperty, value);
714 NotifyPropertyChanged();
719 /// The color selector for the borderline of the View.
720 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
721 /// So this API is internally used only.
723 internal Selector<Color> BorderlineColorSelector
727 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
731 SetValue(BorderlineColorSelectorProperty, value);
732 NotifyPropertyChanged();
737 /// The Relative offset for the borderline of the View.
738 /// Recommended range : [-1.0f to 1.0f].
739 /// If -1.0f, draw borderline inside of the View.
740 /// If 1.0f, draw borderline outside of the View.
741 /// If 0.0f, draw borderline half inside and half outside.
742 /// It is 0.0f by default.
746 /// Animatable - This property can be animated using <c>Animation</c> class.
748 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
752 /// <since_tizen> 9 </since_tizen>
753 public float BorderlineOffset
757 return (float)GetValue(BorderlineOffsetProperty);
761 SetValue(BorderlineOffsetProperty, value);
762 NotifyPropertyChanged();
767 /// The current state of the view.
769 /// <since_tizen> 3 </since_tizen>
774 return (States)GetValue(StateProperty);
778 SetValue(StateProperty, value);
779 NotifyPropertyChanged();
784 /// The current sub state of the view.
786 /// <since_tizen> 3 </since_tizen>
787 public States SubState
791 return (States)GetValue(SubStateProperty);
795 SetValue(SubStateProperty, value);
796 NotifyPropertyChanged();
801 /// Displays a tooltip
803 /// <since_tizen> 3 </since_tizen>
804 public Tizen.NUI.PropertyMap Tooltip
808 return (PropertyMap)GetValue(TooltipProperty);
812 SetValue(TooltipProperty, value);
813 NotifyPropertyChanged();
818 /// Displays a tooltip as a text.
820 /// <since_tizen> 3 </since_tizen>
821 public string TooltipText
825 return GetValue(TooltipTextProperty) as string;
829 SetValue(TooltipTextProperty, value);
833 private string InternalTooltipText
837 using (var propertyValue = GetProperty(Property.TOOLTIP))
839 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
841 return retrivedValue;
843 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
844 return "error to get TooltipText";
849 var temp = new Tizen.NUI.PropertyValue(value);
850 SetProperty(View.Property.TOOLTIP, temp);
852 NotifyPropertyChanged();
857 /// The Child property of FlexContainer.<br />
858 /// The proportion of the free space in the container, the flex item will receive.<br />
859 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
861 /// <since_tizen> 3 </since_tizen>
862 [Obsolete("Deprecated in API8, will be removed in API10.")]
867 return (float)GetValue(FlexProperty);
871 SetValue(FlexProperty, value);
872 NotifyPropertyChanged();
877 /// The Child property of FlexContainer.<br />
878 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
880 /// <since_tizen> 3 </since_tizen>
881 [Obsolete("Deprecated in API8, will be removed in API10.")]
886 return (int)GetValue(AlignSelfProperty);
890 SetValue(AlignSelfProperty, value);
891 NotifyPropertyChanged();
896 /// The Child property of FlexContainer.<br />
897 /// The space around the flex item.<br />
900 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
902 /// <since_tizen> 3 </since_tizen>
903 [Obsolete("Deprecated in API8, will be removed in API10.")]
904 public Vector4 FlexMargin
908 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
909 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
913 SetValue(FlexMarginProperty, value);
914 NotifyPropertyChanged();
919 /// The top-left cell this child occupies, if not set, the first available cell is used.
922 /// The property cascade chaining set is not recommended.
923 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
926 /// This way is recommended for setting the property
928 /// var view = new View();
929 /// view.CellIndex = new Vector2(1, 3);
931 /// This way to set the property is prohibited
933 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
936 /// <since_tizen> 3 </since_tizen>
937 public Vector2 CellIndex
941 return (Vector2)GetValue(CellIndexProperty);
945 SetValue(CellIndexProperty, value);
946 NotifyPropertyChanged();
951 /// The number of rows this child occupies, if not set, the default value is 1.
954 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
956 /// <since_tizen> 3 </since_tizen>
961 return (float)GetValue(RowSpanProperty);
965 SetValue(RowSpanProperty, value);
966 NotifyPropertyChanged();
971 /// The number of columns this child occupies, if not set, the default value is 1.
974 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
976 /// <since_tizen> 3 </since_tizen>
977 public float ColumnSpan
981 return (float)GetValue(ColumnSpanProperty);
985 SetValue(ColumnSpanProperty, value);
986 NotifyPropertyChanged();
991 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
994 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
996 /// <since_tizen> 3 </since_tizen>
997 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1001 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1005 SetValue(CellHorizontalAlignmentProperty, value);
1006 NotifyPropertyChanged();
1011 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1014 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1016 /// <since_tizen> 3 </since_tizen>
1017 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1021 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1025 SetValue(CellVerticalAlignmentProperty, value);
1026 NotifyPropertyChanged();
1031 /// The left focusable view.<br />
1032 /// This will return null if not set.<br />
1033 /// This will also return null if the specified left focusable view is not on a window.<br />
1035 /// <since_tizen> 3 </since_tizen>
1036 public View LeftFocusableView
1038 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1041 return (View)GetValue(LeftFocusableViewProperty);
1045 SetValue(LeftFocusableViewProperty, value);
1046 NotifyPropertyChanged();
1051 /// The right focusable view.<br />
1052 /// This will return null if not set.<br />
1053 /// This will also return null if the specified right focusable view is not on a window.<br />
1055 /// <since_tizen> 3 </since_tizen>
1056 public View RightFocusableView
1058 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1061 return (View)GetValue(RightFocusableViewProperty);
1065 SetValue(RightFocusableViewProperty, value);
1066 NotifyPropertyChanged();
1071 /// The up focusable view.<br />
1072 /// This will return null if not set.<br />
1073 /// This will also return null if the specified up focusable view is not on a window.<br />
1075 /// <since_tizen> 3 </since_tizen>
1076 public View UpFocusableView
1078 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1081 return (View)GetValue(UpFocusableViewProperty);
1085 SetValue(UpFocusableViewProperty, value);
1086 NotifyPropertyChanged();
1091 /// The down focusable view.<br />
1092 /// This will return null if not set.<br />
1093 /// This will also return null if the specified down focusable view is not on a window.<br />
1095 /// <since_tizen> 3 </since_tizen>
1096 public View DownFocusableView
1098 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1101 return (View)GetValue(DownFocusableViewProperty);
1105 SetValue(DownFocusableViewProperty, value);
1106 NotifyPropertyChanged();
1111 /// The clockwise focusable view by rotary wheel.<br />
1112 /// This will return null if not set.<br />
1113 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1115 [EditorBrowsable(EditorBrowsableState.Never)]
1116 public View ClockwiseFocusableView
1118 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1121 return (View)GetValue(ClockwiseFocusableViewProperty);
1125 SetValue(ClockwiseFocusableViewProperty, value);
1126 NotifyPropertyChanged();
1131 /// The counter clockwise focusable view by rotary wheel.<br />
1132 /// This will return null if not set.<br />
1133 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1135 [EditorBrowsable(EditorBrowsableState.Never)]
1136 public View CounterClockwiseFocusableView
1138 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1141 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1145 SetValue(CounterClockwiseFocusableViewProperty, value);
1146 NotifyPropertyChanged();
1151 /// Whether the view should be focusable by keyboard navigation.
1153 /// <since_tizen> 3 </since_tizen>
1154 public bool Focusable
1158 SetValue(FocusableProperty, value);
1159 NotifyPropertyChanged();
1163 return (bool)GetValue(FocusableProperty);
1168 /// 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.
1169 /// Note : Default value is true.
1171 [EditorBrowsable(EditorBrowsableState.Never)]
1172 public bool FocusableChildren
1176 SetValue(FocusableChildrenProperty, value);
1177 NotifyPropertyChanged();
1181 return (bool)GetValue(FocusableChildrenProperty);
1186 /// Whether this view can focus by touch.
1187 /// If Focusable is false, FocusableInTouch is disabled.
1188 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1190 [EditorBrowsable(EditorBrowsableState.Never)]
1191 public bool FocusableInTouch
1195 SetValue(FocusableInTouchProperty, value);
1196 NotifyPropertyChanged();
1200 return (bool)GetValue(FocusableInTouchProperty);
1205 /// Retrieves the position of the view.
1206 /// The coordinates are relative to the view's parent.
1209 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1210 /// 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).
1211 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1212 /// and users can get the current actual values through them.
1214 /// <since_tizen> 3 </since_tizen>
1215 public Position CurrentPosition
1219 return GetCurrentPosition();
1224 /// Sets the size of a view for the width and the height.<br />
1225 /// Geometry can be scaled to fit within this area.<br />
1226 /// This does not interfere with the view's scale factor.<br />
1227 /// The views default depth is the minimum of width and height.<br />
1230 /// The property cascade chaining set is not recommended.
1233 /// This way is recommended for setting the property
1235 /// var view = new View();
1236 /// view.Size2D = new Size2D(100, 200);
1238 /// This way to set the property is prohibited
1240 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1243 /// <since_tizen> 3 </since_tizen>
1244 public Size2D Size2D
1248 var temp = (Size2D)GetValue(Size2DProperty);
1250 if (this.Layout == null)
1252 if (temp.Width < 0) { temp.Width = 0; }
1253 if (temp.Height < 0) { temp.Height = 0; }
1260 SetValue(Size2DProperty, value);
1262 NotifyPropertyChanged();
1267 /// Retrieves the size of the view.
1268 /// The coordinates are relative to the view's parent.
1271 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1272 /// 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).
1273 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1274 /// and users can get the current actual values through them.
1276 /// <since_tizen> 3 </since_tizen>
1277 public Size2D CurrentSize
1281 return GetCurrentSize();
1286 /// Retrieves and sets the view's opacity.<br />
1290 /// Animatable - This property can be animated using <c>Animation</c> class.
1292 /// animation.AnimateTo(view, "Opacity", 0.5f);
1296 /// <since_tizen> 3 </since_tizen>
1297 public float Opacity
1301 return (float)GetValue(OpacityProperty);
1305 SetValue(OpacityProperty, value);
1306 NotifyPropertyChanged();
1311 /// Sets the position of the view for X and Y.<br />
1312 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1313 /// If the position inheritance is disabled, sets the world position.<br />
1316 /// The property cascade chaining set is not recommended.
1319 /// This way is recommended for setting the property
1321 /// var view = new View();
1322 /// view.Position2D = new Position2D(100, 200);
1324 /// This way to set the property is prohibited
1326 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1329 /// <since_tizen> 3 </since_tizen>
1330 public Position2D Position2D
1334 return (Position2D)GetValue(Position2DProperty);
1338 SetValue(Position2DProperty, value);
1339 NotifyPropertyChanged();
1344 /// Retrieves the screen position of the view.<br />
1346 /// <since_tizen> 3 </since_tizen>
1347 public Vector2 ScreenPosition
1351 Vector2 temp = new Vector2(0.0f, 0.0f);
1352 var pValue = GetProperty(View.Property.ScreenPosition);
1360 /// Determines whether the pivot point should be used to determine the position of the view.
1361 /// This is false by default.
1363 /// <remarks>If false, then the top-left of the view is used for the position.
1364 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1366 /// <since_tizen> 3 </since_tizen>
1367 public bool PositionUsesPivotPoint
1371 return (bool)GetValue(PositionUsesPivotPointProperty);
1375 SetValue(PositionUsesPivotPointProperty, value);
1376 NotifyPropertyChanged();
1381 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1383 /// <since_tizen> 3 </since_tizen>
1384 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1386 "View view = new View(); " +
1387 "view.PivotPoint = PivotPoint.Center; " +
1388 "view.PositionUsesPivotPoint = true;" +
1389 " This has been deprecated in API5 and will be removed in API8")]
1390 [EditorBrowsable(EditorBrowsableState.Never)]
1391 public bool PositionUsesAnchorPoint
1395 return (bool)GetValue(PositionUsesAnchorPointProperty);
1399 SetValue(PositionUsesAnchorPointProperty, value);
1403 private bool InternalPositionUsesAnchorPoint
1408 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1409 pValue.Get(out temp);
1415 var temp = new Tizen.NUI.PropertyValue(value);
1416 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1418 NotifyPropertyChanged();
1423 /// Queries whether the view is connected to the stage.<br />
1424 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1426 /// <since_tizen> 3 </since_tizen>
1427 public bool IsOnWindow
1436 /// Gets the depth in the hierarchy for the view.
1438 /// <since_tizen> 3 </since_tizen>
1439 public int HierarchyDepth
1443 return GetHierarchyDepth();
1448 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1451 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1452 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1453 /// The values set by this property will likely change.
1455 /// <since_tizen> 3 </since_tizen>
1456 public int SiblingOrder
1460 return (int)GetValue(SiblingOrderProperty);
1464 SetValue(SiblingOrderProperty, value);
1466 Layout?.ChangeLayoutSiblingOrder(value);
1468 NotifyPropertyChanged();
1473 /// Returns the natural size of the view.
1476 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1478 /// <since_tizen> 5 </since_tizen>
1479 public Vector3 NaturalSize
1483 Vector3 ret = GetNaturalSize();
1484 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1490 /// Returns the natural size (Size2D) of the view.
1493 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1495 /// <since_tizen> 4 </since_tizen>
1496 public Size2D NaturalSize2D
1500 Vector3 temp = GetNaturalSize();
1501 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1503 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1510 /// Gets or sets the origin of a view within its parent's area.<br />
1511 /// 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 />
1512 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1513 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1515 /// <pre>The view has been initialized.</pre>
1516 /// <since_tizen> 3 </since_tizen>
1517 public Position ParentOrigin
1521 Position tmp = (Position)GetValue(ParentOriginProperty);
1522 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1526 SetValue(ParentOriginProperty, value);
1527 NotifyPropertyChanged();
1532 /// Gets or sets the anchor-point of a view.<br />
1533 /// 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 />
1534 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1535 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1536 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1537 /// <pre>The view has been initialized.</pre>
1540 /// The property cascade chaining set is not recommended.
1543 /// This way is recommended for setting the property
1545 /// var view = new View();
1546 /// view.PivotPoint = PivotPoint.Center;
1548 /// This way to set the property is prohibited
1550 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1553 /// <since_tizen> 3 </since_tizen>
1554 public Position PivotPoint
1558 return (Position)GetValue(PivotPointProperty);
1562 SetValue(PivotPointProperty, value);
1563 NotifyPropertyChanged();
1568 /// Gets or sets the size width of the view.
1572 /// Animatable - This property can be animated using <c>Animation</c> class.
1574 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1578 /// <since_tizen> 3 </since_tizen>
1579 public float SizeWidth
1583 return (float)GetValue(SizeWidthProperty);
1587 SetValue(SizeWidthProperty, value);
1588 NotifyPropertyChanged();
1593 /// Gets or sets the size height of the view.
1597 /// Animatable - This property can be animated using <c>Animation</c> class.
1600 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1603 /// <since_tizen> 3 </since_tizen>
1604 public float SizeHeight
1608 return (float)GetValue(SizeHeightProperty);
1612 SetValue(SizeHeightProperty, value);
1613 NotifyPropertyChanged();
1618 /// Gets or sets the position of the view.<br />
1619 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1620 /// If the position inheritance is disabled, sets the world position.<br />
1624 /// Animatable - This property can be animated using <c>Animation</c> class.
1626 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1629 /// The property cascade chaining set is not recommended.
1632 /// This way is recommended for setting the property
1634 /// var view = new View();
1635 /// view.Position = new Position(100, 200.5f, 0);
1637 /// This way to set the property is prohibited
1639 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1642 /// <since_tizen> 3 </since_tizen>
1643 public Position Position
1647 return (Position)GetValue(PositionProperty);
1651 SetValue(PositionProperty, value);
1652 NotifyPropertyChanged();
1657 /// Gets or sets the position X of the view.
1661 /// Animatable - This property can be animated using <c>Animation</c> class.
1663 /// animation.AnimateTo(view, "PositionX", 50.0f);
1667 /// <since_tizen> 3 </since_tizen>
1668 public float PositionX
1672 return (float)GetValue(PositionXProperty);
1676 SetValue(PositionXProperty, value);
1677 NotifyPropertyChanged();
1682 /// Gets or sets the position Y of the view.
1686 /// Animatable - This property can be animated using <c>Animation</c> class.
1688 /// animation.AnimateTo(view, "PositionY", 50.0f);
1692 /// <since_tizen> 3 </since_tizen>
1693 public float PositionY
1697 return (float)GetValue(PositionYProperty);
1701 SetValue(PositionYProperty, value);
1702 NotifyPropertyChanged();
1707 /// Gets or sets the position Z of the view.
1711 /// Animatable - This property can be animated using <c>Animation</c> class.
1713 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1717 /// <since_tizen> 3 </since_tizen>
1718 public float PositionZ
1722 return (float)GetValue(PositionZProperty);
1726 SetValue(PositionZProperty, value);
1727 NotifyPropertyChanged();
1732 /// Gets or sets the world position of the view.
1734 /// <since_tizen> 3 </since_tizen>
1735 public Vector3 WorldPosition
1739 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1740 var pValue = GetProperty(View.Property.WorldPosition);
1748 /// Gets or sets the orientation of the view.<br />
1749 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1753 /// This is an asynchronous method.
1756 /// Animatable - This property can be animated using <c>Animation</c> class.
1758 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1762 /// <since_tizen> 3 </since_tizen>
1763 public Rotation Orientation
1767 return (Rotation)GetValue(OrientationProperty);
1771 SetValue(OrientationProperty, value);
1772 NotifyPropertyChanged();
1777 /// Gets or sets the world orientation of the view.<br />
1779 /// <since_tizen> 3 </since_tizen>
1780 public Rotation WorldOrientation
1784 Rotation temp = new Rotation();
1785 var pValue = GetProperty(View.Property.WorldOrientation);
1793 /// Gets or sets the scale factor applied to the view.<br />
1797 /// Animatable - This property can be animated using <c>Animation</c> class.
1799 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1802 /// The property cascade chaining set is not recommended.
1805 /// This way is recommended for setting the property
1807 /// var view = new View();
1808 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1810 /// This way to set the property is prohibited
1812 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1815 /// <since_tizen> 3 </since_tizen>
1816 public Vector3 Scale
1820 return (Vector3)GetValue(ScaleProperty);
1824 SetValue(ScaleProperty, value);
1825 NotifyPropertyChanged();
1830 /// Gets or sets the scale X factor applied to the view.
1834 /// Animatable - This property can be animated using <c>Animation</c> class.
1836 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1840 /// <since_tizen> 3 </since_tizen>
1845 return (float)GetValue(ScaleXProperty);
1849 SetValue(ScaleXProperty, value);
1850 NotifyPropertyChanged();
1855 /// Gets or sets the scale Y factor applied to the view.
1859 /// Animatable - This property can be animated using <c>Animation</c> class.
1861 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1865 /// <since_tizen> 3 </since_tizen>
1870 return (float)GetValue(ScaleYProperty);
1874 SetValue(ScaleYProperty, value);
1875 NotifyPropertyChanged();
1880 /// Gets or sets the scale Z factor applied to the view.
1884 /// Animatable - This property can be animated using <c>Animation</c> class.
1886 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1890 /// <since_tizen> 3 </since_tizen>
1895 return (float)GetValue(ScaleZProperty);
1899 SetValue(ScaleZProperty, value);
1900 NotifyPropertyChanged();
1905 /// Gets the world scale of the view.
1907 /// <since_tizen> 3 </since_tizen>
1908 public Vector3 WorldScale
1912 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1913 var pValue = GetProperty(View.Property.WorldScale);
1921 /// Retrieves the visibility flag of the view.
1925 /// If the view is not visible, then the view and its children will not be rendered.
1926 /// 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.
1929 /// Animatable - This property can be animated using <c>Animation</c> class.
1931 /// animation.AnimateTo(view, "Visibility", false);
1935 /// <since_tizen> 3 </since_tizen>
1936 public bool Visibility
1941 var pValue = GetProperty(View.Property.VISIBLE);
1942 pValue.Get(out temp);
1949 /// Gets the view's world color.
1951 /// <since_tizen> 3 </since_tizen>
1952 public Vector4 WorldColor
1956 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1957 var pValue = GetProperty(View.Property.WorldColor);
1965 /// Gets or sets the view's name.
1967 /// <since_tizen> 3 </since_tizen>
1972 return (string)GetValue(NameProperty);
1976 SetValue(NameProperty, value);
1977 NotifyPropertyChanged();
1982 /// Get the number of children held by the view.
1984 /// <since_tizen> 3 </since_tizen>
1985 public new uint ChildCount
1989 return Convert.ToUInt32(Children.Count);
1994 /// Gets the view's ID.
1997 /// <since_tizen> 3 </since_tizen>
2007 /// Gets or sets the status of whether the view should emit touch or hover signals.
2008 /// If a View is made insensitive, then the View and its children are not hittable.
2010 /// <since_tizen> 3 </since_tizen>
2011 public bool Sensitive
2015 return (bool)GetValue(SensitiveProperty);
2019 SetValue(SensitiveProperty, value);
2020 NotifyPropertyChanged();
2025 /// Gets or sets the status of whether the view should be enabled user interactions.
2026 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2028 /// <since_tizen> tizen_next </since_tizen>
2029 [EditorBrowsable(EditorBrowsableState.Never)]
2030 public bool IsEnabled
2034 return (bool)GetValue(IsEnabledProperty);
2038 SetValue(IsEnabledProperty, value);
2039 NotifyPropertyChanged();
2044 /// 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.
2046 /// <since_tizen> 3 </since_tizen>
2047 public bool LeaveRequired
2051 return (bool)GetValue(LeaveRequiredProperty);
2055 SetValue(LeaveRequiredProperty, value);
2056 NotifyPropertyChanged();
2061 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2063 /// <since_tizen> 3 </since_tizen>
2064 public bool InheritOrientation
2068 return (bool)GetValue(InheritOrientationProperty);
2072 SetValue(InheritOrientationProperty, value);
2073 NotifyPropertyChanged();
2078 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2080 /// <since_tizen> 3 </since_tizen>
2081 public bool InheritScale
2085 return (bool)GetValue(InheritScaleProperty);
2089 SetValue(InheritScaleProperty, value);
2090 NotifyPropertyChanged();
2095 /// Gets or sets the status of how the view and its children should be drawn.<br />
2096 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2097 /// 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 />
2098 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2099 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2100 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2102 /// <since_tizen> 3 </since_tizen>
2103 public DrawModeType DrawMode
2107 return (DrawModeType)GetValue(DrawModeProperty);
2111 SetValue(DrawModeProperty, value);
2112 NotifyPropertyChanged();
2117 /// Gets or sets the relative to parent size factor of the view.<br />
2118 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2119 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2122 /// The property cascade chaining set is not recommended.
2125 /// This way is recommended for setting the property
2127 /// var text = new TextField();
2128 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2130 /// This way to set the property is prohibited
2132 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2135 /// <since_tizen> 3 </since_tizen>
2136 public Vector3 SizeModeFactor
2140 return (Vector3)GetValue(SizeModeFactorProperty);
2144 SetValue(SizeModeFactorProperty, value);
2145 NotifyPropertyChanged();
2150 /// Gets or sets the width resize policy to be used.
2152 /// <since_tizen> 3 </since_tizen>
2153 public ResizePolicyType WidthResizePolicy
2157 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2161 SetValue(WidthResizePolicyProperty, value);
2162 NotifyPropertyChanged();
2167 /// Gets or sets the height resize policy to be used.
2169 /// <since_tizen> 3 </since_tizen>
2170 public ResizePolicyType HeightResizePolicy
2174 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2178 SetValue(HeightResizePolicyProperty, value);
2179 NotifyPropertyChanged();
2184 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2185 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2187 /// <since_tizen> 3 </since_tizen>
2188 public SizeScalePolicyType SizeScalePolicy
2192 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2196 SetValue(SizeScalePolicyProperty, value);
2197 NotifyPropertyChanged();
2202 /// Gets or sets the status of whether the width size is dependent on the height size.
2204 /// <since_tizen> 3 </since_tizen>
2205 public bool WidthForHeight
2209 return (bool)GetValue(WidthForHeightProperty);
2213 SetValue(WidthForHeightProperty, value);
2214 NotifyPropertyChanged();
2219 /// Gets or sets the status of whether the height size is dependent on the width size.
2221 /// <since_tizen> 3 </since_tizen>
2222 public bool HeightForWidth
2226 return (bool)GetValue(HeightForWidthProperty);
2230 SetValue(HeightForWidthProperty, value);
2231 NotifyPropertyChanged();
2236 /// Gets or sets the padding for use in layout.
2239 /// The property cascade chaining set is not recommended.
2242 /// This way is recommended for setting the property
2244 /// var view = new View();
2245 /// view.Padding = new Extents(5, 5, 5, 5);
2247 /// This way to set the property is prohibited
2249 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2252 /// <since_tizen> 5 </since_tizen>
2253 public Extents Padding
2257 return (Extents)GetValue(PaddingProperty);
2261 SetValue(PaddingProperty, value);
2262 NotifyPropertyChanged();
2267 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2269 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2271 /// The property cascade chaining set is not recommended.
2274 /// This way is recommended for setting the property
2276 /// var view = new View();
2277 /// view.MinimumSize = new Size2D(100, 200);
2279 /// This way to set the property is prohibited
2281 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2284 /// <since_tizen> 3 </since_tizen>
2285 public Size2D MinimumSize
2289 return (Size2D)GetValue(MinimumSizeProperty);
2295 throw new ArgumentNullException(nameof(value));
2299 // Note: it only works if minimum size is >= than natural size.
2300 // To force the size it should be done through the width&height spec or Size2D.
2301 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2302 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2303 layout.RequestLayout();
2305 SetValue(MinimumSizeProperty, value);
2306 NotifyPropertyChanged();
2311 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2314 /// This way is recommended for setting the property
2316 /// var view = new View();
2317 /// view.MaximumSize = new Size2D(100, 200);
2319 /// This way to set the property is prohibited
2321 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2324 /// <since_tizen> 3 </since_tizen>
2325 public Size2D MaximumSize
2329 return (Size2D)GetValue(MaximumSizeProperty);
2333 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2334 // MATCH_PARENT spec + parent container size can be used to limit
2337 layout.RequestLayout();
2339 SetValue(MaximumSizeProperty, value);
2340 NotifyPropertyChanged();
2345 /// Gets or sets whether a child view inherits it's parent's position.<br />
2346 /// Default is to inherit.<br />
2347 /// 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 />
2349 /// <since_tizen> 3 </since_tizen>
2350 public bool InheritPosition
2354 return (bool)GetValue(InheritPositionProperty);
2358 SetValue(InheritPositionProperty, value);
2359 NotifyPropertyChanged();
2364 /// Gets or sets the clipping behavior (mode) of it's children.
2366 /// <since_tizen> 3 </since_tizen>
2367 public ClippingModeType ClippingMode
2371 return (ClippingModeType)GetValue(ClippingModeProperty);
2375 SetValue(ClippingModeProperty, value);
2376 NotifyPropertyChanged();
2381 /// Gets the number of renderers held by the view.
2383 /// <since_tizen> 3 </since_tizen>
2384 public uint RendererCount
2388 return GetRendererCount();
2393 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2396 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2398 /// <since_tizen> 3 </since_tizen>
2399 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2401 "View view = new View(); " +
2402 "view.PivotPoint = PivotPoint.Center; " +
2403 "view.PositionUsesPivotPoint = true;")]
2404 [EditorBrowsable(EditorBrowsableState.Never)]
2405 public Position AnchorPoint
2409 return GetValue(AnchorPointProperty) as Position;
2413 SetValue(AnchorPointProperty, value);
2417 private Position InternalAnchorPoint
2421 Position temp = new Position(0.0f, 0.0f, 0.0f);
2422 var pValue = GetProperty(View.Property.AnchorPoint);
2425 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2431 var temp = new Tizen.NUI.PropertyValue(value);
2432 SetProperty(View.Property.AnchorPoint, temp);
2434 NotifyPropertyChanged();
2439 /// Sets the size of a view for the width, the height and the depth.<br />
2440 /// Geometry can be scaled to fit within this area.<br />
2441 /// This does not interfere with the view's scale factor.<br />
2442 /// The views default depth is the minimum of width and height.<br />
2446 /// Animatable - This property can be animated using <c>Animation</c> class.
2448 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2451 /// The property cascade chaining set is not recommended.
2454 /// This way is recommended for setting the property
2456 /// var view = new View();
2457 /// view.Size = new Size(100.5f, 200, 0);
2459 /// This way to set the property is prohibited
2461 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2464 /// <since_tizen> 5 </since_tizen>
2469 return (Size)GetValue(SizeProperty);
2473 SetValue(SizeProperty, value);
2474 NotifyPropertyChanged();
2479 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2481 /// <since_tizen> 3 </since_tizen>
2482 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2484 "Container parent = view.GetParent(); " +
2485 "View view = parent as View;")]
2486 [EditorBrowsable(EditorBrowsableState.Never)]
2487 public new View Parent
2492 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2493 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2494 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2496 if (basehandle is Layer layer)
2498 ret = new View(Layer.getCPtr(layer).Handle, false);
2499 NUILog.Error("This Parent property is deprecated, should do not be used");
2503 ret = basehandle as View;
2506 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2507 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2509 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2515 /// Gets/Sets whether inherit parent's the layout Direction.
2517 /// <since_tizen> 4 </since_tizen>
2518 public bool InheritLayoutDirection
2522 return (bool)GetValue(InheritLayoutDirectionProperty);
2526 SetValue(InheritLayoutDirectionProperty, value);
2527 NotifyPropertyChanged();
2532 /// Gets/Sets the layout Direction.
2534 /// <since_tizen> 4 </since_tizen>
2535 public ViewLayoutDirectionType LayoutDirection
2539 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2543 SetValue(LayoutDirectionProperty, value);
2544 NotifyPropertyChanged();
2545 layout?.RequestLayout();
2550 /// Gets or sets the Margin for use in layout.
2553 /// Margin property is supported by Layout algorithms and containers.
2554 /// Please Set Layout if you want to use Margin property.
2555 /// The property cascade chaining set is not recommended.
2558 /// This way is recommended for setting the property
2560 /// var view = new View();
2561 /// view.Margin = new Extents(10, 5, 15, 20);
2563 /// This way to set the property is prohibited
2565 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2568 /// <since_tizen> 4 </since_tizen>
2569 public Extents Margin
2573 return (Extents)GetValue(MarginProperty);
2577 SetValue(MarginProperty, value);
2578 NotifyPropertyChanged();
2583 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2587 /// // matchParentView matches its size to its parent size.
2588 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2589 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2591 /// // wrapContentView wraps its children with their desired size.
2592 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2593 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2595 /// // exactSizeView shows itself with an exact size.
2596 /// exactSizeView.WidthSpecification = 100;
2597 /// exactSizeView.HeightSpecification = 100;
2600 /// <since_tizen> 6 </since_tizen>
2601 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2602 public int WidthSpecification
2606 return (int)GetValue(WidthSpecificationProperty);
2610 SetValue(WidthSpecificationProperty, value);
2611 NotifyPropertyChanged();
2615 private int InternalWidthSpecification
2623 if (value == widthPolicy)
2626 widthPolicy = value;
2627 if (widthPolicy >= 0)
2629 if (heightPolicy >= 0) // Policy an exact value
2631 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2632 Size2D = new Size2D(widthPolicy, heightPolicy);
2635 layout?.RequestLayout();
2640 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2644 /// // matchParentView matches its size to its parent size.
2645 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2646 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2648 /// // wrapContentView wraps its children with their desired size.
2649 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2650 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2652 /// // exactSizeView shows itself with an exact size.
2653 /// exactSizeView.WidthSpecification = 100;
2654 /// exactSizeView.HeightSpecification = 100;
2657 /// <since_tizen> 6 </since_tizen>
2658 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2659 public int HeightSpecification
2663 return (int)GetValue(HeightSpecificationProperty);
2667 SetValue(HeightSpecificationProperty, value);
2668 NotifyPropertyChanged();
2672 private int InternalHeightSpecification
2676 return heightPolicy;
2680 if (value == heightPolicy)
2683 heightPolicy = value;
2684 if (heightPolicy >= 0)
2686 if (widthPolicy >= 0) // Policy an exact value
2688 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2689 Size2D = new Size2D(widthPolicy, heightPolicy);
2692 layout?.RequestLayout();
2697 /// Gets the List of transitions for this View.
2699 /// <since_tizen> 6 </since_tizen>
2700 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2704 if (layoutTransitions == null)
2706 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2708 return layoutTransitions;
2713 /// Sets a layout transitions for this View.
2715 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2717 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2719 /// <since_tizen> 6 </since_tizen>
2720 public LayoutTransition LayoutTransition
2724 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2728 SetValue(LayoutTransitionProperty, value);
2729 NotifyPropertyChanged();
2733 private LayoutTransition InternalLayoutTransition
2737 return layoutTransition;
2743 throw new global::System.ArgumentNullException(nameof(value));
2745 if (layoutTransitions == null)
2747 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2750 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2752 AttachTransitionsToChildren(value);
2754 layoutTransition = value;
2759 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2762 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2764 /// <since_tizen> 4 </since_tizen>
2765 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2766 [EditorBrowsable(EditorBrowsableState.Never)]
2767 public Extents PaddingEX
2771 return GetValue(PaddingEXProperty) as Extents;
2775 SetValue(PaddingEXProperty, value);
2779 private Extents InternalPaddingEX
2783 Extents temp = new Extents(0, 0, 0, 0);
2784 var pValue = GetProperty(View.Property.PADDING);
2787 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2793 var temp = new Tizen.NUI.PropertyValue(value);
2794 SetProperty(View.Property.PADDING, temp);
2796 NotifyPropertyChanged();
2797 layout?.RequestLayout();
2802 /// The Color of View. This is an RGBA value.
2803 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2804 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2805 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2806 /// Inherient of color value depend on <see cref="ColorMode"/>.
2810 /// Animatable - This property can be animated using <c>Animation</c> class.
2812 /// The property cascade chaining set is not recommended.
2815 /// This way is recommended for setting the property
2817 /// var view = new View();
2818 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2820 /// This way to set the property is prohibited
2822 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2825 [EditorBrowsable(EditorBrowsableState.Never)]
2830 return (Color)GetValue(ColorProperty);
2834 SetValue(ColorProperty, value);
2835 NotifyPropertyChanged();
2840 /// The Red component of View.Color.
2844 /// Animatable - This property can be animated using <c>Animation</c> class.
2847 [EditorBrowsable(EditorBrowsableState.Never)]
2848 public float ColorRed
2852 return (float)GetValue(ColorRedProperty);
2856 SetValue(ColorRedProperty, value);
2857 NotifyPropertyChanged();
2862 /// The Green component of View.Color.
2866 /// Animatable - This property can be animated using <c>Animation</c> class.
2869 [EditorBrowsable(EditorBrowsableState.Never)]
2870 public float ColorGreen
2874 return (float)GetValue(ColorGreenProperty);
2878 SetValue(ColorGreenProperty, value);
2879 NotifyPropertyChanged();
2884 /// The Blue component of View.Color.
2888 /// Animatable - This property can be animated using <c>Animation</c> class.
2891 [EditorBrowsable(EditorBrowsableState.Never)]
2892 public float ColorBlue
2896 return (float)GetValue(ColorBlueProperty);
2900 SetValue(ColorBlueProperty, value);
2901 NotifyPropertyChanged();
2906 /// Set the layout on this View. Replaces any existing Layout.
2909 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2911 /// <since_tizen> 6 </since_tizen>
2912 public LayoutItem Layout
2916 return GetValue(LayoutProperty) as LayoutItem;
2920 SetValue(LayoutProperty, value);
2924 private LayoutItem InternalLayout
2932 // Do nothing if layout provided is already set on this View.
2933 if (value == layout)
2938 LayoutingDisabled = false;
2941 // If new layout being set already has a owner then that owner receives a replacement default layout.
2942 // First check if the layout to be set already has a owner.
2943 if (value?.Owner != null)
2945 // Previous owner of the layout gets a default layout as a replacement.
2946 value.Owner.Layout = new AbsoluteLayout()
2948 // Copy Margin and Padding to replacement LayoutGroup.
2949 Margin = value.Margin,
2950 Padding = value.Padding,
2954 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2955 // View if no replacement. Previously margin and padding values would have been moved from
2956 // the View to the layout.
2957 if (layout != null) // Existing layout
2961 // Existing layout being replaced so copy over margin and padding values.
2962 value.Margin = layout.Margin;
2963 value.Padding = layout.Padding;
2964 value.SetPositionByLayout = !excludeLayouting;
2968 // Layout not being replaced so restore margin and padding to View.
2969 SetValue(MarginProperty, layout.Margin);
2970 SetValue(PaddingProperty, layout.Padding);
2971 NotifyPropertyChanged();
2976 // First Layout to be added to the View hence copy
2978 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2981 Extents margin = Margin;
2982 Extents padding = Padding;
2983 bool setMargin = false;
2984 bool setPadding = false;
2986 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2988 // If View already has a margin set then store it in Layout instead.
2989 value.Margin = margin;
2990 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2994 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
2996 // If View already has a padding set then store it in Layout instead.
2997 value.Padding = padding;
2998 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
3002 if (setMargin || setPadding)
3004 NotifyPropertyChanged();
3007 value.SetPositionByLayout = !excludeLayouting;
3011 // Remove existing layout from it's parent layout group.
3014 // Set layout to this view
3020 /// The weight of the View, used to share available space in a layout with siblings.
3022 /// <since_tizen> 6 </since_tizen>
3032 layout?.RequestLayout();
3037 /// Whether to load the BackgroundImage synchronously.
3038 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3039 /// Note: For Normal Quad images only.
3041 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3042 [EditorBrowsable(EditorBrowsableState.Never)]
3043 public bool BackgroundImageSynchronosLoading
3047 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3051 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3052 NotifyPropertyChanged();
3056 private bool InternalBackgroundImageSynchronosLoading
3060 return BackgroundImageSynchronousLoading;
3064 BackgroundImageSynchronousLoading = value;
3069 /// Whether to load the BackgroundImage synchronously.
3070 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3071 /// Note: For Normal Quad images only.
3073 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3074 [EditorBrowsable(EditorBrowsableState.Never)]
3075 public bool BackgroundImageSynchronousLoading
3079 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3083 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3084 NotifyPropertyChanged();
3088 private bool InternalBackgroundImageSynchronousLoading
3092 return backgroundImageSynchronousLoading;
3096 backgroundImageSynchronousLoading = value;
3098 string bgUrl = null;
3099 var pValue = Background.Find(ImageVisualProperty.URL);
3100 pValue?.Get(out bgUrl);
3103 if (!string.IsNullOrEmpty(bgUrl))
3105 PropertyMap bgMap = this.Background;
3106 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3107 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3114 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3115 [EditorBrowsable(EditorBrowsableState.Never)]
3116 public Vector4 UpdateAreaHint
3120 return (Vector4)GetValue(UpdateAreaHintProperty);
3124 SetValue(UpdateAreaHintProperty, value);
3125 NotifyPropertyChanged();
3130 /// Enable/Disable ControlState propagation for children.
3131 /// It is false by default.
3132 /// If the View needs to share ControlState with descendants, please set it true.
3133 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3135 [EditorBrowsable(EditorBrowsableState.Never)]
3136 public bool EnableControlStatePropagation
3140 return (bool)GetValue(EnableControlStatePropagationProperty);
3144 SetValue(EnableControlStatePropagationProperty, value);
3145 NotifyPropertyChanged();
3149 private bool InternalEnableControlStatePropagation
3151 get => themeData?.ControlStatePropagation ?? false;
3154 if (InternalEnableControlStatePropagation == value) return;
3156 if (themeData == null) themeData = new ThemeData();
3158 themeData.ControlStatePropagation = value;
3160 foreach (View child in Children)
3162 child.EnableControlStatePropagation = value;
3168 /// The ControlStates can propagate from the parent.
3169 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3170 /// if parent view EnableControlState is true.
3171 /// <see cref="EnableControlState"/>.
3172 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3174 [EditorBrowsable(EditorBrowsableState.Never)]
3175 public ControlState PropagatableControlStates
3179 return (ControlState)GetValue(PropagatableControlStatesProperty);
3183 SetValue(PropagatableControlStatesProperty, value);
3184 NotifyPropertyChanged();
3188 private ControlState InternalPropagatableControlStates
3190 get => propagatableControlStates;
3191 set => propagatableControlStates = value;
3195 /// By default, it is false in View, true in Control.
3196 /// Note that if the value is true, the View will be a touch receptor.
3198 [EditorBrowsable(EditorBrowsableState.Never)]
3199 public bool EnableControlState
3203 return (bool)GetValue(EnableControlStateProperty);
3207 SetValue(EnableControlStateProperty, value);
3212 /// Whether the actor grab all touches even if touch leaves its boundary.
3214 /// <returns>true, if it grab all touch after start</returns>
3215 [EditorBrowsable(EditorBrowsableState.Never)]
3216 public bool GrabTouchAfterLeave
3220 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3224 SetValue(GrabTouchAfterLeaveProperty, value);
3228 private bool InternalGrabTouchAfterLeave
3233 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
3234 pValue.Get(out temp);
3240 var temp = new Tizen.NUI.PropertyValue(value);
3241 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
3243 NotifyPropertyChanged();
3248 /// Whether the view will only receive own touch.
3250 /// <returns>true, if it only receives touches that started from itself.</returns>
3251 [EditorBrowsable(EditorBrowsableState.Never)]
3252 public bool AllowOnlyOwnTouch
3256 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3260 SetValue(AllowOnlyOwnTouchProperty, value);
3264 private bool InternalAllowOnlyOwnTouch
3269 var pValue = GetProperty(View.Property.AllowOnlyOwnTouch);
3270 pValue.Get(out temp);
3276 var temp = new Tizen.NUI.PropertyValue(value);
3277 SetProperty(View.Property.AllowOnlyOwnTouch, temp);
3279 NotifyPropertyChanged();
3284 /// Determines which blend equation will be used to render renderers of this actor.
3286 /// <returns>blend equation enum currently assigned</returns>
3287 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3288 [EditorBrowsable(EditorBrowsableState.Never)]
3289 public BlendEquationType BlendEquation
3293 return (BlendEquationType)GetValue(BlendEquationProperty);
3297 SetValue(BlendEquationProperty, value);
3301 private BlendEquationType InternalBlendEquation
3306 var pValue = GetProperty(View.Property.BlendEquation);
3307 pValue.Get(out temp);
3309 return (BlendEquationType)temp;
3313 var temp = new Tizen.NUI.PropertyValue((int)value);
3314 SetProperty(View.Property.BlendEquation, temp);
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)]
3426 var pValue = GetProperty(View.Property.Culled);
3427 pValue.Get(out temp);
3434 /// Set or Get TransitionOptions for the page transition.
3435 /// This property is used to define how this view will be transitioned during Page switching.
3437 /// <since_tizen> 9 </since_tizen>
3438 public TransitionOptions TransitionOptions
3442 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3446 SetValue(TransitionOptionsProperty, value);
3447 NotifyPropertyChanged();
3451 private TransitionOptions InternalTransitionOptions
3455 transitionOptions = value;
3459 return transitionOptions;
3464 /// Gets or sets the status of whether the view should emit key event signals.
3465 /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
3467 [EditorBrowsable(EditorBrowsableState.Never)]
3468 public bool DispatchKeyEvents
3472 return (bool)GetValue(DispatchKeyEventsProperty);
3476 SetValue(DispatchKeyEventsProperty, value);
3477 NotifyPropertyChanged();
3482 /// Gets or sets the status of whether touch events can be dispatched.
3483 /// 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.
3484 /// This works without adding a TouchEvent callback in the View.
3486 /// 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.
3489 [EditorBrowsable(EditorBrowsableState.Never)]
3490 public bool DispatchTouchEvents
3494 return dispatchTouchEvents;
3498 if (dispatchTouchEvents != value)
3500 dispatchTouchEvents = value;
3501 if (dispatchTouchEvents == false)
3503 TouchEvent += OnDispatchTouchEvent;
3507 TouchEvent -= OnDispatchTouchEvent;
3513 private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
3519 /// Gets or sets the status of whether the view should emit Gesture event signals.
3520 /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
3521 /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3523 [EditorBrowsable(EditorBrowsableState.Never)]
3524 public bool DispatchGestureEvents
3528 return dispatchGestureEvents;
3532 if (dispatchGestureEvents != value)
3534 dispatchGestureEvents = value;
3535 ConfigGestureDetector(dispatchGestureEvents);
3541 /// Gets or sets the status of whether the view should emit Gesture event signals.
3542 /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
3543 /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3545 [EditorBrowsable(EditorBrowsableState.Never)]
3546 public bool DispatchParentGestureEvents
3550 return dispatchParentGestureEvents;
3554 if (dispatchParentGestureEvents != value)
3556 dispatchParentGestureEvents = value;
3557 ConfigGestureDetector(dispatchParentGestureEvents);
3562 private void ConfigGestureDetector(bool dispatch)
3564 if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
3565 if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
3566 if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
3567 if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
3568 if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
3570 if (dispatch == true)
3572 configGestureCount = configGestureCount > 0 ? configGestureCount-- : 0;
3573 if (configGestureCount == 0)
3575 panGestureDetector.Detach(this);
3576 longGestureDetector.Detach(this);
3577 pinchGestureDetector.Detach(this);
3578 tapGestureDetector.Detach(this);
3579 rotationGestureDetector.Detach(this);
3581 panGestureDetector.Detected -= OnGestureDetected;
3582 longGestureDetector.Detected -= OnGestureDetected;
3583 pinchGestureDetector.Detected -= OnGestureDetected;
3584 tapGestureDetector.Detected -= OnGestureDetected;
3585 rotationGestureDetector.Detected -= OnGestureDetected;
3587 panGestureDetector = null;
3588 longGestureDetector = null;
3589 pinchGestureDetector = null;
3590 tapGestureDetector = null;
3591 rotationGestureDetector = null;
3596 if (configGestureCount == 0)
3598 panGestureDetector.Attach(this);
3599 longGestureDetector.Attach(this);
3600 pinchGestureDetector.Attach(this);
3601 tapGestureDetector.Attach(this);
3602 rotationGestureDetector.Attach(this);
3604 panGestureDetector.Detected += OnGestureDetected;
3605 longGestureDetector.Detected += OnGestureDetected;
3606 pinchGestureDetector.Detected += OnGestureDetected;
3607 tapGestureDetector.Detected += OnGestureDetected;
3608 rotationGestureDetector.Detected += OnGestureDetected;
3610 configGestureCount++;
3614 private void OnGestureDetected(object source, EventArgs e)
3616 // Does notting. This is to consume the gesture.
3620 /// Called when the view is hit through TouchEvent or GestureEvent.
3621 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3622 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3623 /// User can override whether hit or not in HitTest.
3624 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3625 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3627 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3628 [EditorBrowsable(EditorBrowsableState.Never)]
3629 protected virtual bool HitTest(Touch touch)
3635 /// Retrieve the View's current Color.
3638 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3639 /// 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).
3640 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3641 /// and users can get the current actual values through them.
3643 [EditorBrowsable(EditorBrowsableState.Never)]
3644 public Color CurrentColor => GetCurrentColor();
3647 /// Retrieve the current scale factor applied to the View.
3650 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3651 /// 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).
3652 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3653 /// and users can get the current actual values through them.
3655 [EditorBrowsable(EditorBrowsableState.Never)]
3656 public Vector3 CurrentScale => GetCurrentScale();