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 /// Creates a new instance of a view.
121 /// <since_tizen> 3 </since_tizen>
122 public View() : this(Interop.View.New(), true)
124 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
127 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
128 [EditorBrowsable(EditorBrowsableState.Never)]
129 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
134 /// Create a new instance of a View with setting the status of shown or hidden.
136 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
137 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
138 [EditorBrowsable(EditorBrowsableState.Never)]
139 public View(bool shown) : this(Interop.View.New(), true)
141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
147 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
156 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
158 InitializeStyle(viewStyle);
161 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
165 PositionUsesPivotPoint = false;
168 onWindowSendEventCallback = SendViewAddedEventToWindow;
169 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
170 signal?.Connect(onWindowSendEventCallback);
172 hitTestResultDataCallback = OnHitTestResult;
173 using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
174 touchDataSignal?.Connect(hitTestResultDataCallback);
181 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
182 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
185 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196 /// The event that is triggered when the View's ControlState is changed.
198 [EditorBrowsable(EditorBrowsableState.Never)]
199 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
201 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
205 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
207 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
208 [EditorBrowsable(EditorBrowsableState.Never)]
209 public bool LayoutSet
218 /// Flag to allow Layouting to be disabled for Views.
219 /// Once a View has a Layout set then any children added to Views from then on will receive
220 /// automatic Layouts.
222 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
223 [EditorBrowsable(EditorBrowsableState.Never)]
224 public static bool LayoutingDisabled { get; set; } = true;
227 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
229 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
230 [EditorBrowsable(EditorBrowsableState.Never)]
231 public static void SetDefaultGrabTouchAfterLeave(bool enable)
233 defaultGrabTouchAfterLeave = enable;
237 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
239 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
240 [EditorBrowsable(EditorBrowsableState.Never)]
241 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
243 defaultAllowOnlyOwnTouch = enable;
247 /// Deprecate. Do not use this.
248 /// The style instance applied to this view.
249 /// Note that do not modify the ViewStyle.
250 /// Modifying ViewStyle will affect other views with same ViewStyle.
252 [EditorBrowsable(EditorBrowsableState.Never)]
253 protected ViewStyle ViewStyle
257 if (themeData == null) themeData = new ThemeData();
259 if (themeData.viewStyle == null)
261 ApplyStyle(CreateViewStyle());
263 return themeData.viewStyle;
268 /// Get/Set the control state.
269 /// Note that the ControlState only available for the classes derived from Control.
270 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
271 /// please set <see cref="EnableControlState"/> to true.
273 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
274 [EditorBrowsable(EditorBrowsableState.Never)]
275 public ControlState ControlState
279 return themeData == null ? ControlState.Normal : themeData.controlStates;
283 if (ControlState == value)
288 var prevState = ControlState;
290 if (themeData == null) themeData = new ThemeData();
291 themeData.controlStates = value;
293 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
295 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
297 if (themeData.ControlStatePropagation)
299 foreach (View child in Children)
301 ControlState allowed = child.PropagatableControlStates;
302 if (allowed.Contains(ControlState.All))
304 child.ControlState = value;
308 ControlState newControlState = child.ControlState;
310 if (allowed.Contains(ControlState.Normal))
312 if (value.Contains(ControlState.Normal))
314 newControlState += ControlState.Normal;
318 newControlState -= ControlState.Normal;
322 if (allowed.Contains(ControlState.Disabled))
324 if (value.Contains(ControlState.Disabled))
326 newControlState += ControlState.Disabled;
330 newControlState -= ControlState.Disabled;
334 if (allowed.Contains(ControlState.Selected))
336 if (value.Contains(ControlState.Selected))
338 newControlState += ControlState.Selected;
342 newControlState -= ControlState.Selected;
346 if (allowed.Contains(ControlState.Pressed))
348 if (value.Contains(ControlState.Pressed))
350 newControlState += ControlState.Pressed;
354 newControlState -= ControlState.Pressed;
358 if (allowed.Contains(ControlState.Focused))
360 if (value.Contains(ControlState.Focused))
362 newControlState += ControlState.Focused;
366 newControlState -= ControlState.Focused;
370 if (allowed.Contains(ControlState.Other))
372 if (value.Contains(ControlState.Other))
374 newControlState += ControlState.Other;
378 newControlState -= ControlState.Other;
382 if (child.ControlState != newControlState)
383 child.ControlState = newControlState;
388 OnControlStateChanged(changeInfo);
390 ControlStateChangedEvent?.Invoke(this, changeInfo);
395 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
397 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
398 [EditorBrowsable(EditorBrowsableState.Never)]
399 public bool ExcludeLayouting
403 return (bool)GetValue(ExcludeLayoutingProperty);
407 SetValue(ExcludeLayoutingProperty, value);
408 NotifyPropertyChanged();
412 private bool InternalExcludeLayouting
416 return excludeLayouting;
420 excludeLayouting = value;
421 if (Layout != null && Layout.SetPositionByLayout == value)
423 Layout.SetPositionByLayout = !value;
424 Layout.RequestLayout();
430 /// The StyleName, type string.
431 /// The value indicates DALi style name defined in json theme file.
433 /// <since_tizen> 3 </since_tizen>
434 public string StyleName
438 return (string)GetValue(StyleNameProperty);
442 SetValue(StyleNameProperty, value);
443 NotifyPropertyChanged();
448 /// The KeyInputFocus, type bool.
450 [EditorBrowsable(EditorBrowsableState.Never)]
451 public bool KeyInputFocus
455 return (bool)GetValue(KeyInputFocusProperty);
459 SetValue(KeyInputFocusProperty, value);
460 NotifyPropertyChanged();
465 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
469 /// The property cascade chaining set is not recommended.
472 /// Animatable - This property can be animated using <c>Animation</c> class.
474 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
479 /// This way is recommended for setting the property
481 /// var view = new View();
482 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
484 /// This way to set the property is prohibited
486 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
489 /// <since_tizen> 3 </since_tizen>
490 public Color BackgroundColor
494 return (Color)GetValue(BackgroundColorProperty);
498 SetValue(BackgroundColorProperty, value);
499 NotifyPropertyChanged();
504 /// The mutually exclusive with "backgroundColor" and "background" type Map.
506 /// <since_tizen> 3 </since_tizen>
507 public string BackgroundImage
511 return (string)GetValue(BackgroundImageProperty);
515 SetValue(BackgroundImageProperty, value);
516 NotifyPropertyChanged();
521 /// Get or set the border of background image.
523 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
524 [EditorBrowsable(EditorBrowsableState.Never)]
525 public Rectangle BackgroundImageBorder
529 return (Rectangle)GetValue(BackgroundImageBorderProperty);
533 SetValue(BackgroundImageBorderProperty, value);
534 NotifyPropertyChanged();
539 /// The background of view.
541 /// <since_tizen> 3 </since_tizen>
542 public Tizen.NUI.PropertyMap Background
546 return (PropertyMap)GetValue(BackgroundProperty);
550 SetValue(BackgroundProperty, value);
551 NotifyPropertyChanged();
556 /// Describes a shadow as an image for a View.
557 /// It is null by default.
560 /// Getter returns copied instance of current shadow.
563 /// The mutually exclusive with "BoxShadow".
567 /// Animatable - This property can be animated using <c>Animation</c> class.
568 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
570 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
572 /// Animatable sub-property : Offset.
575 [EditorBrowsable(EditorBrowsableState.Never)]
576 public ImageShadow ImageShadow
580 return (ImageShadow)GetValue(ImageShadowProperty);
584 SetValue(ImageShadowProperty, value);
585 NotifyPropertyChanged();
590 /// Describes a box shaped shadow drawing for a View.
591 /// It is null by default.
594 /// The mutually exclusive with "ImageShadow".
598 /// Animatable - This property can be animated using <c>Animation</c> class.
599 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
601 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
603 /// Animatable sub-property : Offset, Color, BlurRadius.
606 /// <since_tizen> 9 </since_tizen>
607 public Shadow BoxShadow
611 return (Shadow)GetValue(BoxShadowProperty);
615 SetValue(BoxShadowProperty, value);
616 NotifyPropertyChanged();
621 /// The radius for the rounded corners of the View.
622 /// This will rounds background and shadow edges.
623 /// 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).
624 /// Each radius will clamp internally to the half of smaller of the view's width or height.
625 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
629 /// Animatable - This property can be animated using <c>Animation</c> class.
631 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
635 /// <since_tizen> 9 </since_tizen>
636 public Vector4 CornerRadius
640 return (Vector4)GetValue(CornerRadiusProperty);
644 SetValue(CornerRadiusProperty, value);
645 NotifyPropertyChanged();
650 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
651 /// It is absolute by default.
652 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
654 /// <since_tizen> 9 </since_tizen>
655 public VisualTransformPolicyType CornerRadiusPolicy
657 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
658 set => SetValue(CornerRadiusPolicyProperty, value);
662 /// The width for the borderline of the View.
666 /// Animatable - This property can be animated using <c>Animation</c> class.
668 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
671 /// Note that, an image background may not have borderline if it uses the Border property.
673 /// <since_tizen> 9 </since_tizen>
674 public float BorderlineWidth
678 return (float)GetValue(BorderlineWidthProperty);
682 SetValue(BorderlineWidthProperty, value);
683 NotifyPropertyChanged();
688 /// The color for the borderline of the View.
689 /// It is Color.Black by default.
693 /// Animatable - This property can be animated using <c>Animation</c> class.
695 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
699 /// <since_tizen> 9 </since_tizen>
700 public Color BorderlineColor
704 return (Color)GetValue(BorderlineColorProperty);
708 SetValue(BorderlineColorProperty, value);
709 NotifyPropertyChanged();
714 /// The color selector for the borderline of the View.
715 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
716 /// So this API is internally used only.
718 internal Selector<Color> BorderlineColorSelector
722 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
726 SetValue(BorderlineColorSelectorProperty, value);
727 NotifyPropertyChanged();
732 /// The Relative offset for the borderline of the View.
733 /// Recommended range : [-1.0f to 1.0f].
734 /// If -1.0f, draw borderline inside of the View.
735 /// If 1.0f, draw borderline outside of the View.
736 /// If 0.0f, draw borderline half inside and half outside.
737 /// It is 0.0f by default.
741 /// Animatable - This property can be animated using <c>Animation</c> class.
743 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
747 /// <since_tizen> 9 </since_tizen>
748 public float BorderlineOffset
752 return (float)GetValue(BorderlineOffsetProperty);
756 SetValue(BorderlineOffsetProperty, value);
757 NotifyPropertyChanged();
762 /// The current state of the view.
764 /// <since_tizen> 3 </since_tizen>
769 return (States)GetValue(StateProperty);
773 SetValue(StateProperty, value);
774 NotifyPropertyChanged();
779 /// The current sub state of the view.
781 /// <since_tizen> 3 </since_tizen>
782 public States SubState
786 return (States)GetValue(SubStateProperty);
790 SetValue(SubStateProperty, value);
791 NotifyPropertyChanged();
796 /// Displays a tooltip
798 /// <since_tizen> 3 </since_tizen>
799 public Tizen.NUI.PropertyMap Tooltip
803 return (PropertyMap)GetValue(TooltipProperty);
807 SetValue(TooltipProperty, value);
808 NotifyPropertyChanged();
813 /// Displays a tooltip as a text.
815 /// <since_tizen> 3 </since_tizen>
816 public string TooltipText
820 return GetValue(TooltipTextProperty) as string;
824 SetValue(TooltipTextProperty, value);
828 private string InternalTooltipText
832 using (var propertyValue = GetProperty(Property.TOOLTIP))
834 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
836 return retrivedValue;
838 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
839 return "error to get TooltipText";
844 var temp = new Tizen.NUI.PropertyValue(value);
845 SetProperty(View.Property.TOOLTIP, temp);
847 NotifyPropertyChanged();
852 /// The Child property of FlexContainer.<br />
853 /// The proportion of the free space in the container, the flex item will receive.<br />
854 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
856 /// <since_tizen> 3 </since_tizen>
857 [Obsolete("Deprecated in API8, will be removed in API10.")]
862 return (float)GetValue(FlexProperty);
866 SetValue(FlexProperty, value);
867 NotifyPropertyChanged();
872 /// The Child property of FlexContainer.<br />
873 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
875 /// <since_tizen> 3 </since_tizen>
876 [Obsolete("Deprecated in API8, will be removed in API10.")]
881 return (int)GetValue(AlignSelfProperty);
885 SetValue(AlignSelfProperty, value);
886 NotifyPropertyChanged();
891 /// The Child property of FlexContainer.<br />
892 /// The space around the flex item.<br />
895 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
897 /// <since_tizen> 3 </since_tizen>
898 [Obsolete("Deprecated in API8, will be removed in API10.")]
899 public Vector4 FlexMargin
903 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
904 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
908 SetValue(FlexMarginProperty, value);
909 NotifyPropertyChanged();
914 /// The top-left cell this child occupies, if not set, the first available cell is used.
917 /// The property cascade chaining set is not recommended.
918 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
921 /// This way is recommended for setting the property
923 /// var view = new View();
924 /// view.CellIndex = new Vector2(1, 3);
926 /// This way to set the property is prohibited
928 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
931 /// <since_tizen> 3 </since_tizen>
932 public Vector2 CellIndex
936 return (Vector2)GetValue(CellIndexProperty);
940 SetValue(CellIndexProperty, value);
941 NotifyPropertyChanged();
946 /// The number of rows this child occupies, if not set, the default value is 1.
949 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
951 /// <since_tizen> 3 </since_tizen>
956 return (float)GetValue(RowSpanProperty);
960 SetValue(RowSpanProperty, value);
961 NotifyPropertyChanged();
966 /// The number of columns this child occupies, if not set, the default value is 1.
969 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
971 /// <since_tizen> 3 </since_tizen>
972 public float ColumnSpan
976 return (float)GetValue(ColumnSpanProperty);
980 SetValue(ColumnSpanProperty, value);
981 NotifyPropertyChanged();
986 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
989 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
991 /// <since_tizen> 3 </since_tizen>
992 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
996 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1000 SetValue(CellHorizontalAlignmentProperty, value);
1001 NotifyPropertyChanged();
1006 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1009 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1011 /// <since_tizen> 3 </since_tizen>
1012 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1016 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1020 SetValue(CellVerticalAlignmentProperty, value);
1021 NotifyPropertyChanged();
1026 /// The left focusable view.<br />
1027 /// This will return null if not set.<br />
1028 /// This will also return null if the specified left focusable view is not on a window.<br />
1030 /// <since_tizen> 3 </since_tizen>
1031 public View LeftFocusableView
1033 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1036 return (View)GetValue(LeftFocusableViewProperty);
1040 SetValue(LeftFocusableViewProperty, value);
1041 NotifyPropertyChanged();
1046 /// The right focusable view.<br />
1047 /// This will return null if not set.<br />
1048 /// This will also return null if the specified right focusable view is not on a window.<br />
1050 /// <since_tizen> 3 </since_tizen>
1051 public View RightFocusableView
1053 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1056 return (View)GetValue(RightFocusableViewProperty);
1060 SetValue(RightFocusableViewProperty, value);
1061 NotifyPropertyChanged();
1066 /// The up focusable view.<br />
1067 /// This will return null if not set.<br />
1068 /// This will also return null if the specified up focusable view is not on a window.<br />
1070 /// <since_tizen> 3 </since_tizen>
1071 public View UpFocusableView
1073 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1076 return (View)GetValue(UpFocusableViewProperty);
1080 SetValue(UpFocusableViewProperty, value);
1081 NotifyPropertyChanged();
1086 /// The down focusable view.<br />
1087 /// This will return null if not set.<br />
1088 /// This will also return null if the specified down focusable view is not on a window.<br />
1090 /// <since_tizen> 3 </since_tizen>
1091 public View DownFocusableView
1093 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1096 return (View)GetValue(DownFocusableViewProperty);
1100 SetValue(DownFocusableViewProperty, value);
1101 NotifyPropertyChanged();
1106 /// The clockwise focusable view by rotary wheel.<br />
1107 /// This will return null if not set.<br />
1108 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1110 [EditorBrowsable(EditorBrowsableState.Never)]
1111 public View ClockwiseFocusableView
1113 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1116 return (View)GetValue(ClockwiseFocusableViewProperty);
1120 SetValue(ClockwiseFocusableViewProperty, value);
1121 NotifyPropertyChanged();
1126 /// The counter clockwise focusable view by rotary wheel.<br />
1127 /// This will return null if not set.<br />
1128 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1130 [EditorBrowsable(EditorBrowsableState.Never)]
1131 public View CounterClockwiseFocusableView
1133 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1136 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1140 SetValue(CounterClockwiseFocusableViewProperty, value);
1141 NotifyPropertyChanged();
1146 /// Whether the view should be focusable by keyboard navigation.
1148 /// <since_tizen> 3 </since_tizen>
1149 public bool Focusable
1153 SetValue(FocusableProperty, value);
1154 NotifyPropertyChanged();
1158 return (bool)GetValue(FocusableProperty);
1163 /// 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.
1164 /// Note : Default value is true.
1166 [EditorBrowsable(EditorBrowsableState.Never)]
1167 public bool FocusableChildren
1171 SetValue(FocusableChildrenProperty, value);
1172 NotifyPropertyChanged();
1176 return (bool)GetValue(FocusableChildrenProperty);
1181 /// Whether this view can focus by touch.
1182 /// If Focusable is false, FocusableInTouch is disabled.
1183 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1185 [EditorBrowsable(EditorBrowsableState.Never)]
1186 public bool FocusableInTouch
1190 SetValue(FocusableInTouchProperty, value);
1191 NotifyPropertyChanged();
1195 return (bool)GetValue(FocusableInTouchProperty);
1200 /// Retrieves the position of the view.
1201 /// The coordinates are relative to the view's parent.
1204 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1205 /// 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).
1206 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1207 /// and users can get the current actual values through them.
1209 /// <since_tizen> 3 </since_tizen>
1210 public Position CurrentPosition
1214 return GetCurrentPosition();
1219 /// Sets the size of a view for the width and the height.<br />
1220 /// Geometry can be scaled to fit within this area.<br />
1221 /// This does not interfere with the view's scale factor.<br />
1222 /// The views default depth is the minimum of width and height.<br />
1225 /// The property cascade chaining set is not recommended.
1228 /// This way is recommended for setting the property
1230 /// var view = new View();
1231 /// view.Size2D = new Size2D(100, 200);
1233 /// This way to set the property is prohibited
1235 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1238 /// <since_tizen> 3 </since_tizen>
1239 public Size2D Size2D
1243 var temp = (Size2D)GetValue(Size2DProperty);
1245 if (this.Layout == null)
1247 if (temp.Width < 0) { temp.Width = 0; }
1248 if (temp.Height < 0) { temp.Height = 0; }
1255 SetValue(Size2DProperty, value);
1257 NotifyPropertyChanged();
1262 /// Retrieves the size of the view.
1263 /// The coordinates are relative to the view's parent.
1266 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1267 /// 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).
1268 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1269 /// and users can get the current actual values through them.
1271 /// <since_tizen> 3 </since_tizen>
1272 public Size2D CurrentSize
1276 return GetCurrentSize();
1281 /// Retrieves and sets the view's opacity.<br />
1285 /// Animatable - This property can be animated using <c>Animation</c> class.
1287 /// animation.AnimateTo(view, "Opacity", 0.5f);
1291 /// <since_tizen> 3 </since_tizen>
1292 public float Opacity
1296 return (float)GetValue(OpacityProperty);
1300 SetValue(OpacityProperty, value);
1301 NotifyPropertyChanged();
1306 /// Sets the position of the view for X and Y.<br />
1307 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1308 /// If the position inheritance is disabled, sets the world position.<br />
1311 /// The property cascade chaining set is not recommended.
1314 /// This way is recommended for setting the property
1316 /// var view = new View();
1317 /// view.Position2D = new Position2D(100, 200);
1319 /// This way to set the property is prohibited
1321 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1324 /// <since_tizen> 3 </since_tizen>
1325 public Position2D Position2D
1329 return (Position2D)GetValue(Position2DProperty);
1333 SetValue(Position2DProperty, value);
1334 NotifyPropertyChanged();
1339 /// Retrieves the screen position of the view.<br />
1341 /// <since_tizen> 3 </since_tizen>
1342 public Vector2 ScreenPosition
1346 return GetCurrentScreenPosition();
1351 /// Retrieves the screen position and size of the view.<br />
1354 /// The float type Rectangle class is not ready yet.
1355 /// Therefore, it transmits data in Vector4 class.
1356 /// This type should later be changed to the appropriate data type.
1358 [EditorBrowsable(EditorBrowsableState.Never)]
1359 public Vector4 ScreenPositionSize
1363 return GetCurrentScreenPositionSize();
1368 /// Determines whether the pivot point should be used to determine the position of the view.
1369 /// This is false by default.
1371 /// <remarks>If false, then the top-left of the view is used for the position.
1372 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1374 /// <since_tizen> 3 </since_tizen>
1375 public bool PositionUsesPivotPoint
1379 return (bool)GetValue(PositionUsesPivotPointProperty);
1383 SetValue(PositionUsesPivotPointProperty, value);
1384 NotifyPropertyChanged();
1389 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1391 /// <since_tizen> 3 </since_tizen>
1392 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1394 "View view = new View(); " +
1395 "view.PivotPoint = PivotPoint.Center; " +
1396 "view.PositionUsesPivotPoint = true;" +
1397 " This has been deprecated in API5 and will be removed in API8")]
1398 [EditorBrowsable(EditorBrowsableState.Never)]
1399 public bool PositionUsesAnchorPoint
1403 return (bool)GetValue(PositionUsesAnchorPointProperty);
1407 SetValue(PositionUsesAnchorPointProperty, value);
1411 private bool InternalPositionUsesAnchorPoint
1415 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
1419 Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
1420 NotifyPropertyChanged();
1425 /// Queries whether the view is connected to the stage.<br />
1426 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1428 /// <since_tizen> 3 </since_tizen>
1429 public bool IsOnWindow
1438 /// Gets the depth in the hierarchy for the view.
1440 /// <since_tizen> 3 </since_tizen>
1441 public int HierarchyDepth
1445 return GetHierarchyDepth();
1450 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1453 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1454 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1455 /// The values set by this property will likely change.
1457 /// <since_tizen> 3 </since_tizen>
1458 public int SiblingOrder
1462 return (int)GetValue(SiblingOrderProperty);
1466 SetValue(SiblingOrderProperty, value);
1468 Layout?.ChangeLayoutSiblingOrder(value);
1470 NotifyPropertyChanged();
1475 /// Returns the natural size of the view.
1478 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1480 /// <since_tizen> 5 </since_tizen>
1481 public Vector3 NaturalSize
1485 Vector3 ret = GetNaturalSize();
1486 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1492 /// Returns the natural size (Size2D) of the view.
1495 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1497 /// <since_tizen> 4 </since_tizen>
1498 public Size2D NaturalSize2D
1502 Vector3 temp = GetNaturalSize();
1503 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1505 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1512 /// Gets or sets the origin of a view within its parent's area.<br />
1513 /// 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 />
1514 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1515 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1517 /// <pre>The view has been initialized.</pre>
1518 /// <since_tizen> 3 </since_tizen>
1519 public Position ParentOrigin
1523 Position tmp = (Position)GetValue(ParentOriginProperty);
1524 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1528 SetValue(ParentOriginProperty, value);
1529 NotifyPropertyChanged();
1534 /// Gets or sets the anchor-point of a view.<br />
1535 /// 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 />
1536 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1537 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1538 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1539 /// <pre>The view has been initialized.</pre>
1542 /// The property cascade chaining set is not recommended.
1545 /// This way is recommended for setting the property
1547 /// var view = new View();
1548 /// view.PivotPoint = PivotPoint.Center;
1550 /// This way to set the property is prohibited
1552 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1555 /// <since_tizen> 3 </since_tizen>
1556 public Position PivotPoint
1560 return (Position)GetValue(PivotPointProperty);
1564 SetValue(PivotPointProperty, value);
1565 NotifyPropertyChanged();
1570 /// Gets or sets the size width of the view.
1574 /// Animatable - This property can be animated using <c>Animation</c> class.
1576 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1580 /// <since_tizen> 3 </since_tizen>
1581 public float SizeWidth
1585 return (float)GetValue(SizeWidthProperty);
1589 SetValue(SizeWidthProperty, value);
1590 NotifyPropertyChanged();
1595 /// Gets or sets the size height of the view.
1599 /// Animatable - This property can be animated using <c>Animation</c> class.
1602 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1605 /// <since_tizen> 3 </since_tizen>
1606 public float SizeHeight
1610 return (float)GetValue(SizeHeightProperty);
1614 SetValue(SizeHeightProperty, value);
1615 NotifyPropertyChanged();
1620 /// Gets or sets the position of the view.<br />
1621 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1622 /// If the position inheritance is disabled, sets the world position.<br />
1626 /// Animatable - This property can be animated using <c>Animation</c> class.
1628 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1631 /// The property cascade chaining set is not recommended.
1634 /// This way is recommended for setting the property
1636 /// var view = new View();
1637 /// view.Position = new Position(100, 200.5f, 0);
1639 /// This way to set the property is prohibited
1641 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1644 /// <since_tizen> 3 </since_tizen>
1645 public Position Position
1649 return (Position)GetValue(PositionProperty);
1653 SetValue(PositionProperty, value);
1654 NotifyPropertyChanged();
1659 /// Gets or sets the position X of the view.
1663 /// Animatable - This property can be animated using <c>Animation</c> class.
1665 /// animation.AnimateTo(view, "PositionX", 50.0f);
1669 /// <since_tizen> 3 </since_tizen>
1670 public float PositionX
1674 return (float)GetValue(PositionXProperty);
1678 SetValue(PositionXProperty, value);
1679 NotifyPropertyChanged();
1684 /// Gets or sets the position Y of the view.
1688 /// Animatable - This property can be animated using <c>Animation</c> class.
1690 /// animation.AnimateTo(view, "PositionY", 50.0f);
1694 /// <since_tizen> 3 </since_tizen>
1695 public float PositionY
1699 return (float)GetValue(PositionYProperty);
1703 SetValue(PositionYProperty, value);
1704 NotifyPropertyChanged();
1709 /// Gets or sets the position Z of the view.
1713 /// Animatable - This property can be animated using <c>Animation</c> class.
1715 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1719 /// <since_tizen> 3 </since_tizen>
1720 public float PositionZ
1724 return (float)GetValue(PositionZProperty);
1728 SetValue(PositionZProperty, value);
1729 NotifyPropertyChanged();
1734 /// Gets or sets the world position of the view.
1736 /// <since_tizen> 3 </since_tizen>
1737 public Vector3 WorldPosition
1741 return GetCurrentWorldPosition();
1746 /// Gets or sets the orientation of the view.<br />
1747 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1751 /// This is an asynchronous method.
1754 /// Animatable - This property can be animated using <c>Animation</c> class.
1756 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1760 /// <since_tizen> 3 </since_tizen>
1761 public Rotation Orientation
1765 return (Rotation)GetValue(OrientationProperty);
1769 SetValue(OrientationProperty, value);
1770 NotifyPropertyChanged();
1775 /// Gets or sets the world orientation of the view.<br />
1777 /// <since_tizen> 3 </since_tizen>
1778 public Rotation WorldOrientation
1782 Rotation temp = new Rotation();
1783 var pValue = GetProperty(View.Property.WorldOrientation);
1791 /// Gets or sets the scale factor applied to the view.<br />
1795 /// Animatable - This property can be animated using <c>Animation</c> class.
1797 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1800 /// The property cascade chaining set is not recommended.
1803 /// This way is recommended for setting the property
1805 /// var view = new View();
1806 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1808 /// This way to set the property is prohibited
1810 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1813 /// <since_tizen> 3 </since_tizen>
1814 public Vector3 Scale
1818 return (Vector3)GetValue(ScaleProperty);
1822 SetValue(ScaleProperty, value);
1823 NotifyPropertyChanged();
1828 /// Gets or sets the scale X factor applied to the view.
1832 /// Animatable - This property can be animated using <c>Animation</c> class.
1834 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1838 /// <since_tizen> 3 </since_tizen>
1843 return (float)GetValue(ScaleXProperty);
1847 SetValue(ScaleXProperty, value);
1848 NotifyPropertyChanged();
1853 /// Gets or sets the scale Y factor applied to the view.
1857 /// Animatable - This property can be animated using <c>Animation</c> class.
1859 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1863 /// <since_tizen> 3 </since_tizen>
1868 return (float)GetValue(ScaleYProperty);
1872 SetValue(ScaleYProperty, value);
1873 NotifyPropertyChanged();
1878 /// Gets or sets the scale Z factor applied to the view.
1882 /// Animatable - This property can be animated using <c>Animation</c> class.
1884 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1888 /// <since_tizen> 3 </since_tizen>
1893 return (float)GetValue(ScaleZProperty);
1897 SetValue(ScaleZProperty, value);
1898 NotifyPropertyChanged();
1903 /// Gets the world scale of the view.
1905 /// <since_tizen> 3 </since_tizen>
1906 public Vector3 WorldScale
1910 return GetCurrentWorldScale();
1915 /// Retrieves the visibility flag of the view.
1919 /// If the view is not visible, then the view and its children will not be rendered.
1920 /// 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.
1923 /// Animatable - This property can be animated using <c>Animation</c> class.
1925 /// animation.AnimateTo(view, "Visibility", false);
1929 /// <since_tizen> 3 </since_tizen>
1930 public bool Visibility
1934 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
1939 /// Gets the view's world color.
1941 /// <since_tizen> 3 </since_tizen>
1942 public Vector4 WorldColor
1946 return GetCurrentWorldColor();
1951 /// Gets or sets the view's name.
1953 /// <since_tizen> 3 </since_tizen>
1958 return (string)GetValue(NameProperty);
1962 SetValue(NameProperty, value);
1963 NotifyPropertyChanged();
1968 /// Get the number of children held by the view.
1970 /// <since_tizen> 3 </since_tizen>
1971 public new uint ChildCount
1975 return Convert.ToUInt32(Children.Count);
1980 /// Gets the view's ID.
1983 /// <since_tizen> 3 </since_tizen>
1993 /// Gets or sets the status of whether the view should emit touch or hover signals.
1994 /// If a View is made insensitive, then the View and its children are not hittable.
1996 /// <since_tizen> 3 </since_tizen>
1997 public bool Sensitive
2001 return (bool)GetValue(SensitiveProperty);
2005 SetValue(SensitiveProperty, value);
2006 NotifyPropertyChanged();
2011 /// Gets or sets the status of whether the view should be enabled user interactions.
2012 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2014 /// <since_tizen> tizen_next </since_tizen>
2015 [EditorBrowsable(EditorBrowsableState.Never)]
2016 public bool IsEnabled
2020 return (bool)GetValue(IsEnabledProperty);
2024 SetValue(IsEnabledProperty, value);
2025 NotifyPropertyChanged();
2030 /// 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.
2032 /// <since_tizen> 3 </since_tizen>
2033 public bool LeaveRequired
2037 return (bool)GetValue(LeaveRequiredProperty);
2041 SetValue(LeaveRequiredProperty, value);
2042 NotifyPropertyChanged();
2047 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2049 /// <since_tizen> 3 </since_tizen>
2050 public bool InheritOrientation
2054 return (bool)GetValue(InheritOrientationProperty);
2058 SetValue(InheritOrientationProperty, value);
2059 NotifyPropertyChanged();
2064 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2066 /// <since_tizen> 3 </since_tizen>
2067 public bool InheritScale
2071 return (bool)GetValue(InheritScaleProperty);
2075 SetValue(InheritScaleProperty, value);
2076 NotifyPropertyChanged();
2081 /// Gets or sets the status of how the view and its children should be drawn.<br />
2082 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2083 /// 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 />
2084 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2085 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2086 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2088 /// <since_tizen> 3 </since_tizen>
2089 public DrawModeType DrawMode
2093 return (DrawModeType)GetValue(DrawModeProperty);
2097 SetValue(DrawModeProperty, value);
2098 NotifyPropertyChanged();
2103 /// Gets or sets the relative to parent size factor of the view.<br />
2104 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2105 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2108 /// The property cascade chaining set is not recommended.
2111 /// This way is recommended for setting the property
2113 /// var text = new TextField();
2114 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2116 /// This way to set the property is prohibited
2118 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2121 /// <since_tizen> 3 </since_tizen>
2122 public Vector3 SizeModeFactor
2126 return (Vector3)GetValue(SizeModeFactorProperty);
2130 SetValue(SizeModeFactorProperty, value);
2131 NotifyPropertyChanged();
2136 /// Gets or sets the width resize policy to be used.
2138 /// <since_tizen> 3 </since_tizen>
2139 public ResizePolicyType WidthResizePolicy
2143 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2147 SetValue(WidthResizePolicyProperty, value);
2148 NotifyPropertyChanged();
2153 /// Gets or sets the height resize policy to be used.
2155 /// <since_tizen> 3 </since_tizen>
2156 public ResizePolicyType HeightResizePolicy
2160 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2164 SetValue(HeightResizePolicyProperty, value);
2165 NotifyPropertyChanged();
2170 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2171 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2173 /// <since_tizen> 3 </since_tizen>
2174 public SizeScalePolicyType SizeScalePolicy
2178 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2182 SetValue(SizeScalePolicyProperty, value);
2183 NotifyPropertyChanged();
2188 /// Gets or sets the status of whether the width size is dependent on the height size.
2190 /// <since_tizen> 3 </since_tizen>
2191 public bool WidthForHeight
2195 return (bool)GetValue(WidthForHeightProperty);
2199 SetValue(WidthForHeightProperty, value);
2200 NotifyPropertyChanged();
2205 /// Gets or sets the status of whether the height size is dependent on the width size.
2207 /// <since_tizen> 3 </since_tizen>
2208 public bool HeightForWidth
2212 return (bool)GetValue(HeightForWidthProperty);
2216 SetValue(HeightForWidthProperty, value);
2217 NotifyPropertyChanged();
2222 /// Gets or sets the padding for use in layout.
2225 /// The property cascade chaining set is not recommended.
2228 /// This way is recommended for setting the property
2230 /// var view = new View();
2231 /// view.Padding = new Extents(5, 5, 5, 5);
2233 /// This way to set the property is prohibited
2235 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2238 /// <since_tizen> 5 </since_tizen>
2239 public Extents Padding
2243 return (Extents)GetValue(PaddingProperty);
2247 SetValue(PaddingProperty, value);
2248 NotifyPropertyChanged();
2253 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2255 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2257 /// The property cascade chaining set is not recommended.
2260 /// This way is recommended for setting the property
2262 /// var view = new View();
2263 /// view.MinimumSize = new Size2D(100, 200);
2265 /// This way to set the property is prohibited
2267 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2270 /// <since_tizen> 3 </since_tizen>
2271 public Size2D MinimumSize
2275 return (Size2D)GetValue(MinimumSizeProperty);
2281 throw new ArgumentNullException(nameof(value));
2285 // Note: it only works if minimum size is >= than natural size.
2286 // To force the size it should be done through the width&height spec or Size2D.
2287 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2288 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2289 layout.RequestLayout();
2291 SetValue(MinimumSizeProperty, value);
2292 NotifyPropertyChanged();
2297 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2300 /// This way is recommended for setting the property
2302 /// var view = new View();
2303 /// view.MaximumSize = new Size2D(100, 200);
2305 /// This way to set the property is prohibited
2307 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2310 /// <since_tizen> 3 </since_tizen>
2311 public Size2D MaximumSize
2315 return (Size2D)GetValue(MaximumSizeProperty);
2319 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2320 // MATCH_PARENT spec + parent container size can be used to limit
2323 layout.RequestLayout();
2325 SetValue(MaximumSizeProperty, value);
2326 NotifyPropertyChanged();
2331 /// Gets or sets whether a child view inherits it's parent's position.<br />
2332 /// Default is to inherit.<br />
2333 /// 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 />
2335 /// <since_tizen> 3 </since_tizen>
2336 public bool InheritPosition
2340 return (bool)GetValue(InheritPositionProperty);
2344 SetValue(InheritPositionProperty, value);
2345 NotifyPropertyChanged();
2350 /// Gets or sets the clipping behavior (mode) of it's children.
2352 /// <since_tizen> 3 </since_tizen>
2353 public ClippingModeType ClippingMode
2357 return (ClippingModeType)GetValue(ClippingModeProperty);
2361 SetValue(ClippingModeProperty, value);
2362 NotifyPropertyChanged();
2367 /// Gets the number of renderers held by the view.
2369 /// <since_tizen> 3 </since_tizen>
2370 public uint RendererCount
2374 return GetRendererCount();
2379 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2382 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2384 /// <since_tizen> 3 </since_tizen>
2385 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2387 "View view = new View(); " +
2388 "view.PivotPoint = PivotPoint.Center; " +
2389 "view.PositionUsesPivotPoint = true;")]
2390 [EditorBrowsable(EditorBrowsableState.Never)]
2391 public Position AnchorPoint
2395 return GetValue(AnchorPointProperty) as Position;
2399 SetValue(AnchorPointProperty, value);
2403 private Position InternalAnchorPoint
2407 return GetCurrentAnchorPoint();
2411 SetAnchorPoint(value);
2412 NotifyPropertyChanged();
2417 /// Sets the size of a view for the width, the height and the depth.<br />
2418 /// Geometry can be scaled to fit within this area.<br />
2419 /// This does not interfere with the view's scale factor.<br />
2420 /// The views default depth is the minimum of width and height.<br />
2424 /// Animatable - This property can be animated using <c>Animation</c> class.
2426 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2429 /// The property cascade chaining set is not recommended.
2432 /// This way is recommended for setting the property
2434 /// var view = new View();
2435 /// view.Size = new Size(100.5f, 200, 0);
2437 /// This way to set the property is prohibited
2439 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2442 /// <since_tizen> 5 </since_tizen>
2447 return (Size)GetValue(SizeProperty);
2451 SetValue(SizeProperty, value);
2452 NotifyPropertyChanged();
2457 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2459 /// <since_tizen> 3 </since_tizen>
2460 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2462 "Container parent = view.GetParent(); " +
2463 "View view = parent as View;")]
2464 [EditorBrowsable(EditorBrowsableState.Never)]
2465 public new View Parent
2470 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2471 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2472 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2474 if (basehandle is Layer layer)
2476 ret = new View(Layer.getCPtr(layer).Handle, false);
2477 NUILog.Error("This Parent property is deprecated, should do not be used");
2481 ret = basehandle as View;
2484 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2485 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2487 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2493 /// Gets/Sets whether inherit parent's the layout Direction.
2495 /// <since_tizen> 4 </since_tizen>
2496 public bool InheritLayoutDirection
2500 return (bool)GetValue(InheritLayoutDirectionProperty);
2504 SetValue(InheritLayoutDirectionProperty, value);
2505 NotifyPropertyChanged();
2510 /// Gets/Sets the layout Direction.
2512 /// <since_tizen> 4 </since_tizen>
2513 public ViewLayoutDirectionType LayoutDirection
2517 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2521 SetValue(LayoutDirectionProperty, value);
2522 NotifyPropertyChanged();
2523 layout?.RequestLayout();
2528 /// Gets or sets the Margin for use in layout.
2531 /// Margin property is supported by Layout algorithms and containers.
2532 /// Please Set Layout if you want to use Margin property.
2533 /// The property cascade chaining set is not recommended.
2536 /// This way is recommended for setting the property
2538 /// var view = new View();
2539 /// view.Margin = new Extents(10, 5, 15, 20);
2541 /// This way to set the property is prohibited
2543 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2546 /// <since_tizen> 4 </since_tizen>
2547 public Extents Margin
2551 return (Extents)GetValue(MarginProperty);
2555 SetValue(MarginProperty, value);
2556 NotifyPropertyChanged();
2561 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2565 /// // matchParentView matches its size to its parent size.
2566 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2567 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2569 /// // wrapContentView wraps its children with their desired size.
2570 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2571 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2573 /// // exactSizeView shows itself with an exact size.
2574 /// exactSizeView.WidthSpecification = 100;
2575 /// exactSizeView.HeightSpecification = 100;
2578 /// <since_tizen> 6 </since_tizen>
2579 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2580 public int WidthSpecification
2584 return (int)GetValue(WidthSpecificationProperty);
2588 SetValue(WidthSpecificationProperty, value);
2589 NotifyPropertyChanged();
2593 private int InternalWidthSpecification
2601 if (value == widthPolicy)
2604 widthPolicy = value;
2605 if (widthPolicy >= 0)
2607 SizeWidth = widthPolicy;
2609 layout?.RequestLayout();
2614 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2618 /// // matchParentView matches its size to its parent size.
2619 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2620 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2622 /// // wrapContentView wraps its children with their desired size.
2623 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2624 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2626 /// // exactSizeView shows itself with an exact size.
2627 /// exactSizeView.WidthSpecification = 100;
2628 /// exactSizeView.HeightSpecification = 100;
2631 /// <since_tizen> 6 </since_tizen>
2632 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2633 public int HeightSpecification
2637 return (int)GetValue(HeightSpecificationProperty);
2641 SetValue(HeightSpecificationProperty, value);
2642 NotifyPropertyChanged();
2646 private int InternalHeightSpecification
2650 return heightPolicy;
2654 if (value == heightPolicy)
2657 heightPolicy = value;
2658 if (heightPolicy >= 0)
2660 SizeHeight = heightPolicy;
2662 layout?.RequestLayout();
2667 /// Gets the List of transitions for this View.
2669 /// <since_tizen> 6 </since_tizen>
2670 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2674 if (layoutTransitions == null)
2676 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2678 return layoutTransitions;
2683 /// Sets a layout transitions for this View.
2685 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2687 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2689 /// <since_tizen> 6 </since_tizen>
2690 public LayoutTransition LayoutTransition
2694 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2698 SetValue(LayoutTransitionProperty, value);
2699 NotifyPropertyChanged();
2703 private LayoutTransition InternalLayoutTransition
2707 return layoutTransition;
2713 throw new global::System.ArgumentNullException(nameof(value));
2715 if (layoutTransitions == null)
2717 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2720 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2722 AttachTransitionsToChildren(value);
2724 layoutTransition = value;
2729 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2732 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2734 /// <since_tizen> 4 </since_tizen>
2735 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2736 [EditorBrowsable(EditorBrowsableState.Never)]
2737 public Extents PaddingEX
2741 return GetValue(PaddingEXProperty) as Extents;
2745 SetValue(PaddingEXProperty, value);
2749 private Extents InternalPaddingEX
2753 Extents temp = new Extents(0, 0, 0, 0);
2754 var pValue = GetProperty(View.Property.PADDING);
2757 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2763 var temp = new Tizen.NUI.PropertyValue(value);
2764 SetProperty(View.Property.PADDING, temp);
2766 NotifyPropertyChanged();
2767 layout?.RequestLayout();
2772 /// The Color of View. This is an RGBA value.
2773 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2774 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2775 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2776 /// Inherient of color value depend on <see cref="ColorMode"/>.
2780 /// Animatable - This property can be animated using <c>Animation</c> class.
2782 /// The property cascade chaining set is not recommended.
2785 /// This way is recommended for setting the property
2787 /// var view = new View();
2788 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2790 /// This way to set the property is prohibited
2792 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2795 [EditorBrowsable(EditorBrowsableState.Never)]
2800 return (Color)GetValue(ColorProperty);
2804 SetValue(ColorProperty, value);
2805 NotifyPropertyChanged();
2810 /// The Red component of View.Color.
2814 /// Animatable - This property can be animated using <c>Animation</c> class.
2817 [EditorBrowsable(EditorBrowsableState.Never)]
2818 public float ColorRed
2822 return (float)GetValue(ColorRedProperty);
2826 SetValue(ColorRedProperty, value);
2827 NotifyPropertyChanged();
2832 /// The Green component of View.Color.
2836 /// Animatable - This property can be animated using <c>Animation</c> class.
2839 [EditorBrowsable(EditorBrowsableState.Never)]
2840 public float ColorGreen
2844 return (float)GetValue(ColorGreenProperty);
2848 SetValue(ColorGreenProperty, value);
2849 NotifyPropertyChanged();
2854 /// The Blue component of View.Color.
2858 /// Animatable - This property can be animated using <c>Animation</c> class.
2861 [EditorBrowsable(EditorBrowsableState.Never)]
2862 public float ColorBlue
2866 return (float)GetValue(ColorBlueProperty);
2870 SetValue(ColorBlueProperty, value);
2871 NotifyPropertyChanged();
2876 /// Set the layout on this View. Replaces any existing Layout.
2879 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2881 /// <since_tizen> 6 </since_tizen>
2882 public LayoutItem Layout
2886 return GetValue(LayoutProperty) as LayoutItem;
2890 SetValue(LayoutProperty, value);
2894 private LayoutItem InternalLayout
2902 // Do nothing if layout provided is already set on this View.
2903 if (value == layout)
2908 LayoutingDisabled = false;
2911 // If new layout being set already has a owner then that owner receives a replacement default layout.
2912 // First check if the layout to be set already has a owner.
2913 if (value?.Owner != null)
2915 // Previous owner of the layout gets a default layout as a replacement.
2916 value.Owner.Layout = new AbsoluteLayout()
2918 // Copy Margin and Padding to replacement LayoutGroup.
2919 Margin = value.Margin,
2920 Padding = value.Padding,
2924 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2925 // View if no replacement. Previously margin and padding values would have been moved from
2926 // the View to the layout.
2927 if (layout != null) // Existing layout
2931 // Existing layout being replaced so copy over margin and padding values.
2932 value.Margin = layout.Margin;
2933 value.Padding = layout.Padding;
2934 value.SetPositionByLayout = !excludeLayouting;
2938 // Layout not being replaced so restore margin and padding to View.
2939 SetValue(MarginProperty, layout.Margin);
2940 SetValue(PaddingProperty, layout.Padding);
2941 NotifyPropertyChanged();
2946 // First Layout to be added to the View hence copy
2948 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2951 Extents margin = Margin;
2952 Extents padding = Padding;
2953 bool setMargin = false;
2954 bool setPadding = false;
2956 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2958 // If View already has a margin set then store it in Layout instead.
2959 value.Margin = margin;
2960 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2964 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
2966 // If View already has a padding set then store it in Layout instead.
2967 value.Padding = padding;
2968 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
2972 if (setMargin || setPadding)
2974 NotifyPropertyChanged();
2977 value.SetPositionByLayout = !excludeLayouting;
2981 // Remove existing layout from it's parent layout group.
2984 // Set layout to this view
2990 /// The weight of the View, used to share available space in a layout with siblings.
2992 /// <since_tizen> 6 </since_tizen>
3002 layout?.RequestLayout();
3007 /// Whether to load the BackgroundImage synchronously.
3008 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3009 /// Note: For Normal Quad images only.
3011 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3012 [EditorBrowsable(EditorBrowsableState.Never)]
3013 public bool BackgroundImageSynchronosLoading
3017 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3021 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3022 NotifyPropertyChanged();
3026 private bool InternalBackgroundImageSynchronosLoading
3030 return BackgroundImageSynchronousLoading;
3034 BackgroundImageSynchronousLoading = value;
3039 /// Whether to load the BackgroundImage synchronously.
3040 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3041 /// Note: For Normal Quad images only.
3043 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3044 [EditorBrowsable(EditorBrowsableState.Never)]
3045 public bool BackgroundImageSynchronousLoading
3049 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3053 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3054 NotifyPropertyChanged();
3058 private bool InternalBackgroundImageSynchronousLoading
3062 return backgroundImageSynchronousLoading;
3066 backgroundImageSynchronousLoading = value;
3068 if (!string.IsNullOrEmpty(BackgroundImage))
3070 PropertyMap bgMap = this.Background;
3071 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3072 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3079 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3080 [EditorBrowsable(EditorBrowsableState.Never)]
3081 public Vector4 UpdateAreaHint
3085 return (Vector4)GetValue(UpdateAreaHintProperty);
3089 SetValue(UpdateAreaHintProperty, value);
3090 NotifyPropertyChanged();
3095 /// Enable/Disable ControlState propagation for children.
3096 /// It is false by default.
3097 /// If the View needs to share ControlState with descendants, please set it true.
3098 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3100 [EditorBrowsable(EditorBrowsableState.Never)]
3101 public bool EnableControlStatePropagation
3105 return (bool)GetValue(EnableControlStatePropagationProperty);
3109 SetValue(EnableControlStatePropagationProperty, value);
3110 NotifyPropertyChanged();
3114 private bool InternalEnableControlStatePropagation
3116 get => themeData?.ControlStatePropagation ?? false;
3119 if (InternalEnableControlStatePropagation == value) return;
3121 if (themeData == null) themeData = new ThemeData();
3123 themeData.ControlStatePropagation = value;
3125 foreach (View child in Children)
3127 child.EnableControlStatePropagation = value;
3133 /// The ControlStates can propagate from the parent.
3134 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3135 /// if parent view EnableControlState is true.
3136 /// <see cref="EnableControlState"/>.
3137 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3139 [EditorBrowsable(EditorBrowsableState.Never)]
3140 public ControlState PropagatableControlStates
3144 return (ControlState)GetValue(PropagatableControlStatesProperty);
3148 SetValue(PropagatableControlStatesProperty, value);
3149 NotifyPropertyChanged();
3153 private ControlState InternalPropagatableControlStates
3155 get => propagatableControlStates;
3156 set => propagatableControlStates = value;
3160 /// By default, it is false in View, true in Control.
3161 /// Note that if the value is true, the View will be a touch receptor.
3163 [EditorBrowsable(EditorBrowsableState.Never)]
3164 public bool EnableControlState
3168 return (bool)GetValue(EnableControlStateProperty);
3172 SetValue(EnableControlStateProperty, value);
3177 /// Whether the actor grab all touches even if touch leaves its boundary.
3179 /// <returns>true, if it grab all touch after start</returns>
3180 [EditorBrowsable(EditorBrowsableState.Never)]
3181 public bool GrabTouchAfterLeave
3185 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3189 SetValue(GrabTouchAfterLeaveProperty, value);
3193 private bool InternalGrabTouchAfterLeave
3197 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
3201 Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
3202 NotifyPropertyChanged();
3207 /// Whether the view will only receive own touch.
3209 /// <returns>true, if it only receives touches that started from itself.</returns>
3210 [EditorBrowsable(EditorBrowsableState.Never)]
3211 public bool AllowOnlyOwnTouch
3215 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3219 SetValue(AllowOnlyOwnTouchProperty, value);
3223 private bool InternalAllowOnlyOwnTouch
3227 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
3231 Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
3232 NotifyPropertyChanged();
3237 /// Determines which blend equation will be used to render renderers of this actor.
3239 /// <returns>blend equation enum currently assigned</returns>
3240 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3241 [EditorBrowsable(EditorBrowsableState.Never)]
3242 public BlendEquationType BlendEquation
3246 return (BlendEquationType)GetValue(BlendEquationProperty);
3250 SetValue(BlendEquationProperty, value);
3254 private BlendEquationType InternalBlendEquation
3258 return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
3262 Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
3263 NotifyPropertyChanged();
3268 /// If the value is true, the View will change its style as the theme changes.
3269 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3271 /// <since_tizen> 9 </since_tizen>
3272 public bool ThemeChangeSensitive
3274 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3275 set => SetValue(ThemeChangeSensitiveProperty, value);
3279 /// Create Style, it is abstract function and must be override.
3281 [EditorBrowsable(EditorBrowsableState.Never)]
3282 protected virtual ViewStyle CreateViewStyle()
3284 return new ViewStyle();
3288 /// Called after the View's ControlStates changed.
3290 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3291 [EditorBrowsable(EditorBrowsableState.Never)]
3292 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3298 [EditorBrowsable(EditorBrowsableState.Never)]
3299 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3301 isThemeChanged = true;
3302 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3303 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3304 isThemeChanged = false;
3308 /// Apply style instance to the view.
3309 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3311 /// <since_tizen> 9 </since_tizen>
3312 public virtual void ApplyStyle(ViewStyle viewStyle)
3314 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3316 if (themeData == null) themeData = new ThemeData();
3318 themeData.viewStyle = viewStyle;
3320 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3326 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3328 if (bindablePropertyOfView == null)
3333 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3334 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3336 foreach (var sourceProperty in dirtyStyleProperties)
3338 var sourceValue = viewStyle.GetValue(sourceProperty);
3340 if (sourceValue == null)
3345 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3347 // Do not set value again when theme is changed and the value has been set already.
3348 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3353 if (destinationProperty != null)
3355 InternalSetValue(destinationProperty, sourceValue);
3361 /// Get whether the View is culled or not.
3362 /// True means that the View is out of the view frustum.
3365 /// Hidden-API (Inhouse-API).
3367 [EditorBrowsable(EditorBrowsableState.Never)]
3372 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
3377 /// Set or Get TransitionOptions for the page transition.
3378 /// This property is used to define how this view will be transitioned during Page switching.
3380 /// <since_tizen> 9 </since_tizen>
3381 public TransitionOptions TransitionOptions
3385 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3389 SetValue(TransitionOptionsProperty, value);
3390 NotifyPropertyChanged();
3394 private TransitionOptions InternalTransitionOptions
3398 transitionOptions = value;
3402 return transitionOptions;
3407 /// Gets or sets the status of whether the view should emit key event signals.
3408 /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
3410 [EditorBrowsable(EditorBrowsableState.Never)]
3411 public bool DispatchKeyEvents
3415 return (bool)GetValue(DispatchKeyEventsProperty);
3419 SetValue(DispatchKeyEventsProperty, value);
3420 NotifyPropertyChanged();
3425 /// Gets or sets the status of whether touch events can be dispatched.
3426 /// 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.
3427 /// This works without adding a TouchEvent callback in the View.
3429 /// 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.
3432 [EditorBrowsable(EditorBrowsableState.Never)]
3433 public bool DispatchTouchEvents
3437 return dispatchTouchEvents;
3441 if (dispatchTouchEvents != value)
3443 dispatchTouchEvents = value;
3444 if (dispatchTouchEvents == false)
3446 TouchEvent += OnDispatchTouchEvent;
3450 TouchEvent -= OnDispatchTouchEvent;
3456 private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
3462 /// Gets or sets the status of whether the view should emit Gesture event signals.
3463 /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
3464 /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3466 [EditorBrowsable(EditorBrowsableState.Never)]
3467 public bool DispatchGestureEvents
3471 return dispatchGestureEvents;
3475 if (dispatchGestureEvents != value)
3477 dispatchGestureEvents = value;
3478 ConfigGestureDetector(dispatchGestureEvents);
3484 /// Gets or sets the status of whether the view should emit Gesture event signals.
3485 /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
3486 /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3488 [EditorBrowsable(EditorBrowsableState.Never)]
3489 public bool DispatchParentGestureEvents
3493 return dispatchParentGestureEvents;
3497 if (dispatchParentGestureEvents != value)
3499 dispatchParentGestureEvents = value;
3500 ConfigGestureDetector(dispatchParentGestureEvents);
3505 private void ConfigGestureDetector(bool dispatch)
3507 if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
3508 if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
3509 if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
3510 if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
3511 if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
3513 if (dispatch == true)
3515 configGestureCount = configGestureCount > 0 ? configGestureCount-- : 0;
3516 if (configGestureCount == 0)
3518 panGestureDetector.Detach(this);
3519 longGestureDetector.Detach(this);
3520 pinchGestureDetector.Detach(this);
3521 tapGestureDetector.Detach(this);
3522 rotationGestureDetector.Detach(this);
3524 panGestureDetector.Detected -= OnGestureDetected;
3525 longGestureDetector.Detected -= OnGestureDetected;
3526 pinchGestureDetector.Detected -= OnGestureDetected;
3527 tapGestureDetector.Detected -= OnGestureDetected;
3528 rotationGestureDetector.Detected -= OnGestureDetected;
3530 panGestureDetector = null;
3531 longGestureDetector = null;
3532 pinchGestureDetector = null;
3533 tapGestureDetector = null;
3534 rotationGestureDetector = null;
3539 if (configGestureCount == 0)
3541 panGestureDetector.Attach(this);
3542 longGestureDetector.Attach(this);
3543 pinchGestureDetector.Attach(this);
3544 tapGestureDetector.Attach(this);
3545 rotationGestureDetector.Attach(this);
3547 panGestureDetector.Detected += OnGestureDetected;
3548 longGestureDetector.Detected += OnGestureDetected;
3549 pinchGestureDetector.Detected += OnGestureDetected;
3550 tapGestureDetector.Detected += OnGestureDetected;
3551 rotationGestureDetector.Detected += OnGestureDetected;
3553 configGestureCount++;
3557 private void OnGestureDetected(object source, EventArgs e)
3559 // Does notting. This is to consume the gesture.
3563 /// Called when the view is hit through TouchEvent or GestureEvent.
3564 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3565 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3566 /// User can override whether hit or not in HitTest.
3567 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3568 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3570 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3571 [EditorBrowsable(EditorBrowsableState.Never)]
3572 protected virtual bool HitTest(Touch touch)
3578 /// Retrieve the View's current Color.
3581 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3582 /// 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).
3583 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3584 /// and users can get the current actual values through them.
3586 [EditorBrowsable(EditorBrowsableState.Never)]
3587 public Color CurrentColor => GetCurrentColor();
3590 /// Retrieve the current scale factor applied to the View.
3593 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3594 /// 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).
3595 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3596 /// and users can get the current actual values through them.
3598 [EditorBrowsable(EditorBrowsableState.Never)]
3599 public Vector3 CurrentScale => GetCurrentScale();