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;
166 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
167 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
169 // TODO : Can we call this function only for required subclass?
170 RegisterHitTestCallback();
179 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
181 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190 /// The event that is triggered when the View's ControlState is changed.
192 [EditorBrowsable(EditorBrowsableState.Never)]
193 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
195 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
199 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
201 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
202 [EditorBrowsable(EditorBrowsableState.Never)]
203 public bool LayoutSet
212 /// Flag to allow Layouting to be disabled for Views.
213 /// Once a View has a Layout set then any children added to Views from then on will receive
214 /// automatic Layouts.
216 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
217 [EditorBrowsable(EditorBrowsableState.Never)]
218 public static bool LayoutingDisabled { get; set; } = true;
221 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
223 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
224 [EditorBrowsable(EditorBrowsableState.Never)]
225 public static void SetDefaultGrabTouchAfterLeave(bool enable)
227 defaultGrabTouchAfterLeave = enable;
231 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
233 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
234 [EditorBrowsable(EditorBrowsableState.Never)]
235 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
237 defaultAllowOnlyOwnTouch = enable;
241 /// Deprecate. Do not use this.
242 /// The style instance applied to this view.
243 /// Note that do not modify the ViewStyle.
244 /// Modifying ViewStyle will affect other views with same ViewStyle.
246 [EditorBrowsable(EditorBrowsableState.Never)]
247 protected ViewStyle ViewStyle
251 if (themeData == null) themeData = new ThemeData();
253 if (themeData.viewStyle == null)
255 ApplyStyle(CreateViewStyle());
257 return themeData.viewStyle;
262 /// Get/Set the control state.
263 /// Note that the ControlState only available for the classes derived from Control.
264 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
265 /// please set <see cref="EnableControlState"/> to true.
267 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
268 [EditorBrowsable(EditorBrowsableState.Never)]
269 public ControlState ControlState
273 return themeData == null ? ControlState.Normal : themeData.controlStates;
277 if (ControlState == value)
282 var prevState = ControlState;
284 if (themeData == null) themeData = new ThemeData();
285 themeData.controlStates = value;
287 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
289 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
291 if (themeData.ControlStatePropagation)
293 foreach (View child in Children)
295 ControlState allowed = child.PropagatableControlStates;
296 if (allowed.Contains(ControlState.All))
298 child.ControlState = value;
302 ControlState newControlState = child.ControlState;
304 if (allowed.Contains(ControlState.Normal))
306 if (value.Contains(ControlState.Normal))
308 newControlState += ControlState.Normal;
312 newControlState -= ControlState.Normal;
316 if (allowed.Contains(ControlState.Disabled))
318 if (value.Contains(ControlState.Disabled))
320 newControlState += ControlState.Disabled;
324 newControlState -= ControlState.Disabled;
328 if (allowed.Contains(ControlState.Selected))
330 if (value.Contains(ControlState.Selected))
332 newControlState += ControlState.Selected;
336 newControlState -= ControlState.Selected;
340 if (allowed.Contains(ControlState.Pressed))
342 if (value.Contains(ControlState.Pressed))
344 newControlState += ControlState.Pressed;
348 newControlState -= ControlState.Pressed;
352 if (allowed.Contains(ControlState.Focused))
354 if (value.Contains(ControlState.Focused))
356 newControlState += ControlState.Focused;
360 newControlState -= ControlState.Focused;
364 if (allowed.Contains(ControlState.Other))
366 if (value.Contains(ControlState.Other))
368 newControlState += ControlState.Other;
372 newControlState -= ControlState.Other;
376 if (child.ControlState != newControlState)
377 child.ControlState = newControlState;
382 OnControlStateChanged(changeInfo);
384 ControlStateChangedEvent?.Invoke(this, changeInfo);
389 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
391 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
392 [EditorBrowsable(EditorBrowsableState.Never)]
393 public bool ExcludeLayouting
397 return (bool)GetValue(ExcludeLayoutingProperty);
401 SetValue(ExcludeLayoutingProperty, value);
402 NotifyPropertyChanged();
406 private bool InternalExcludeLayouting
410 return excludeLayouting;
414 excludeLayouting = value;
415 if (Layout != null && Layout.SetPositionByLayout == value)
417 Layout.SetPositionByLayout = !value;
418 Layout.RequestLayout();
424 /// The StyleName, type string.
425 /// The value indicates DALi style name defined in json theme file.
427 /// <since_tizen> 3 </since_tizen>
428 public string StyleName
432 return (string)GetValue(StyleNameProperty);
436 SetValue(StyleNameProperty, value);
437 NotifyPropertyChanged();
442 /// The KeyInputFocus, type bool.
444 [EditorBrowsable(EditorBrowsableState.Never)]
445 public bool KeyInputFocus
449 return (bool)GetValue(KeyInputFocusProperty);
453 SetValue(KeyInputFocusProperty, value);
454 NotifyPropertyChanged();
459 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
463 /// The property cascade chaining set is not recommended.
466 /// Animatable - This property can be animated using <c>Animation</c> class.
468 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
473 /// This way is recommended for setting the property
475 /// var view = new View();
476 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
478 /// This way to set the property is prohibited
480 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
483 /// <since_tizen> 3 </since_tizen>
484 public Color BackgroundColor
488 return (Color)GetValue(BackgroundColorProperty);
492 SetValue(BackgroundColorProperty, value);
493 NotifyPropertyChanged();
498 /// The mutually exclusive with "backgroundColor" and "background" type Map.
500 /// <since_tizen> 3 </since_tizen>
501 public string BackgroundImage
505 return (string)GetValue(BackgroundImageProperty);
509 SetValue(BackgroundImageProperty, value);
510 NotifyPropertyChanged();
515 /// Get or set the border of background image.
517 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
518 [EditorBrowsable(EditorBrowsableState.Never)]
519 public Rectangle BackgroundImageBorder
523 return (Rectangle)GetValue(BackgroundImageBorderProperty);
527 SetValue(BackgroundImageBorderProperty, value);
528 NotifyPropertyChanged();
533 /// The background of view.
535 /// <since_tizen> 3 </since_tizen>
536 public Tizen.NUI.PropertyMap Background
540 return (PropertyMap)GetValue(BackgroundProperty);
544 SetValue(BackgroundProperty, value);
545 NotifyPropertyChanged();
550 /// Describes a shadow as an image for a View.
551 /// It is null by default.
554 /// Getter returns copied instance of current shadow.
557 /// The mutually exclusive with "BoxShadow".
561 /// Animatable - This property can be animated using <c>Animation</c> class.
562 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
564 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
566 /// Animatable sub-property : Offset.
569 [EditorBrowsable(EditorBrowsableState.Never)]
570 public ImageShadow ImageShadow
574 return (ImageShadow)GetValue(ImageShadowProperty);
578 SetValue(ImageShadowProperty, value);
579 NotifyPropertyChanged();
584 /// Describes a box shaped shadow drawing for a View.
585 /// It is null by default.
588 /// The mutually exclusive with "ImageShadow".
592 /// Animatable - This property can be animated using <c>Animation</c> class.
593 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
595 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
597 /// Animatable sub-property : Offset, Color, BlurRadius.
600 /// <since_tizen> 9 </since_tizen>
601 public Shadow BoxShadow
605 return (Shadow)GetValue(BoxShadowProperty);
609 SetValue(BoxShadowProperty, value);
610 NotifyPropertyChanged();
615 /// The radius for the rounded corners of the View.
616 /// This will rounds background and shadow edges.
617 /// 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).
618 /// Each radius will clamp internally to the half of smaller of the view's width or height.
619 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
623 /// Animatable - This property can be animated using <c>Animation</c> class.
625 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
629 /// <since_tizen> 9 </since_tizen>
630 public Vector4 CornerRadius
634 return (Vector4)GetValue(CornerRadiusProperty);
638 SetValue(CornerRadiusProperty, value);
639 NotifyPropertyChanged();
644 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
645 /// It is absolute by default.
646 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
648 /// <since_tizen> 9 </since_tizen>
649 public VisualTransformPolicyType CornerRadiusPolicy
651 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
652 set => SetValue(CornerRadiusPolicyProperty, value);
656 /// The width for the borderline of the View.
660 /// Animatable - This property can be animated using <c>Animation</c> class.
662 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
665 /// Note that, an image background may not have borderline if it uses the Border property.
667 /// <since_tizen> 9 </since_tizen>
668 public float BorderlineWidth
672 return (float)GetValue(BorderlineWidthProperty);
676 SetValue(BorderlineWidthProperty, value);
677 NotifyPropertyChanged();
682 /// The color for the borderline of the View.
683 /// It is Color.Black by default.
687 /// Animatable - This property can be animated using <c>Animation</c> class.
689 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
693 /// <since_tizen> 9 </since_tizen>
694 public Color BorderlineColor
698 return (Color)GetValue(BorderlineColorProperty);
702 SetValue(BorderlineColorProperty, value);
703 NotifyPropertyChanged();
708 /// The color selector for the borderline of the View.
709 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
710 /// So this API is internally used only.
712 internal Selector<Color> BorderlineColorSelector
716 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
720 SetValue(BorderlineColorSelectorProperty, value);
721 NotifyPropertyChanged();
726 /// The Relative offset for the borderline of the View.
727 /// Recommended range : [-1.0f to 1.0f].
728 /// If -1.0f, draw borderline inside of the View.
729 /// If 1.0f, draw borderline outside of the View.
730 /// If 0.0f, draw borderline half inside and half outside.
731 /// It is 0.0f by default.
735 /// Animatable - This property can be animated using <c>Animation</c> class.
737 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
741 /// <since_tizen> 9 </since_tizen>
742 public float BorderlineOffset
746 return (float)GetValue(BorderlineOffsetProperty);
750 SetValue(BorderlineOffsetProperty, value);
751 NotifyPropertyChanged();
756 /// The current state of the view.
758 /// <since_tizen> 3 </since_tizen>
763 return (States)GetValue(StateProperty);
767 SetValue(StateProperty, value);
768 NotifyPropertyChanged();
773 /// The current sub state of the view.
775 /// <since_tizen> 3 </since_tizen>
776 public States SubState
780 return (States)GetValue(SubStateProperty);
784 SetValue(SubStateProperty, value);
785 NotifyPropertyChanged();
790 /// Displays a tooltip
792 /// <since_tizen> 3 </since_tizen>
793 public Tizen.NUI.PropertyMap Tooltip
797 return (PropertyMap)GetValue(TooltipProperty);
801 SetValue(TooltipProperty, value);
802 NotifyPropertyChanged();
807 /// Displays a tooltip as a text.
809 /// <since_tizen> 3 </since_tizen>
810 public string TooltipText
814 return GetValue(TooltipTextProperty) as string;
818 SetValue(TooltipTextProperty, value);
822 private string InternalTooltipText
826 using (var propertyValue = GetProperty(Property.TOOLTIP))
828 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
830 return retrivedValue;
832 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
833 return "error to get TooltipText";
838 var temp = new Tizen.NUI.PropertyValue(value);
839 SetProperty(View.Property.TOOLTIP, temp);
841 NotifyPropertyChanged();
846 /// The Child property of FlexContainer.<br />
847 /// The proportion of the free space in the container, the flex item will receive.<br />
848 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
850 /// <since_tizen> 3 </since_tizen>
851 [Obsolete("Deprecated in API8, will be removed in API10.")]
856 return (float)GetValue(FlexProperty);
860 SetValue(FlexProperty, value);
861 NotifyPropertyChanged();
866 /// The Child property of FlexContainer.<br />
867 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
869 /// <since_tizen> 3 </since_tizen>
870 [Obsolete("Deprecated in API8, will be removed in API10.")]
875 return (int)GetValue(AlignSelfProperty);
879 SetValue(AlignSelfProperty, value);
880 NotifyPropertyChanged();
885 /// The Child property of FlexContainer.<br />
886 /// The space around the flex item.<br />
889 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
891 /// <since_tizen> 3 </since_tizen>
892 [Obsolete("Deprecated in API8, will be removed in API10.")]
893 public Vector4 FlexMargin
897 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
898 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
902 SetValue(FlexMarginProperty, value);
903 NotifyPropertyChanged();
908 /// The top-left cell this child occupies, if not set, the first available cell is used.
911 /// The property cascade chaining set is not recommended.
912 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
915 /// This way is recommended for setting the property
917 /// var view = new View();
918 /// view.CellIndex = new Vector2(1, 3);
920 /// This way to set the property is prohibited
922 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
925 /// <since_tizen> 3 </since_tizen>
926 public Vector2 CellIndex
930 return (Vector2)GetValue(CellIndexProperty);
934 SetValue(CellIndexProperty, value);
935 NotifyPropertyChanged();
940 /// The number of rows this child occupies, if not set, the default value is 1.
943 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
945 /// <since_tizen> 3 </since_tizen>
950 return (float)GetValue(RowSpanProperty);
954 SetValue(RowSpanProperty, value);
955 NotifyPropertyChanged();
960 /// The number of columns this child occupies, if not set, the default value is 1.
963 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
965 /// <since_tizen> 3 </since_tizen>
966 public float ColumnSpan
970 return (float)GetValue(ColumnSpanProperty);
974 SetValue(ColumnSpanProperty, value);
975 NotifyPropertyChanged();
980 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
983 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
985 /// <since_tizen> 3 </since_tizen>
986 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
990 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
994 SetValue(CellHorizontalAlignmentProperty, value);
995 NotifyPropertyChanged();
1000 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1003 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1005 /// <since_tizen> 3 </since_tizen>
1006 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1010 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1014 SetValue(CellVerticalAlignmentProperty, value);
1015 NotifyPropertyChanged();
1020 /// The left focusable view.<br />
1021 /// This will return null if not set.<br />
1022 /// This will also return null if the specified left focusable view is not on a window.<br />
1024 /// <since_tizen> 3 </since_tizen>
1025 public View LeftFocusableView
1027 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1030 return (View)GetValue(LeftFocusableViewProperty);
1034 SetValue(LeftFocusableViewProperty, value);
1035 NotifyPropertyChanged();
1040 /// The right focusable view.<br />
1041 /// This will return null if not set.<br />
1042 /// This will also return null if the specified right focusable view is not on a window.<br />
1044 /// <since_tizen> 3 </since_tizen>
1045 public View RightFocusableView
1047 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1050 return (View)GetValue(RightFocusableViewProperty);
1054 SetValue(RightFocusableViewProperty, value);
1055 NotifyPropertyChanged();
1060 /// The up focusable view.<br />
1061 /// This will return null if not set.<br />
1062 /// This will also return null if the specified up focusable view is not on a window.<br />
1064 /// <since_tizen> 3 </since_tizen>
1065 public View UpFocusableView
1067 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1070 return (View)GetValue(UpFocusableViewProperty);
1074 SetValue(UpFocusableViewProperty, value);
1075 NotifyPropertyChanged();
1080 /// The down focusable view.<br />
1081 /// This will return null if not set.<br />
1082 /// This will also return null if the specified down focusable view is not on a window.<br />
1084 /// <since_tizen> 3 </since_tizen>
1085 public View DownFocusableView
1087 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1090 return (View)GetValue(DownFocusableViewProperty);
1094 SetValue(DownFocusableViewProperty, value);
1095 NotifyPropertyChanged();
1100 /// The clockwise focusable view by rotary wheel.<br />
1101 /// This will return null if not set.<br />
1102 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1104 [EditorBrowsable(EditorBrowsableState.Never)]
1105 public View ClockwiseFocusableView
1107 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1110 return (View)GetValue(ClockwiseFocusableViewProperty);
1114 SetValue(ClockwiseFocusableViewProperty, value);
1115 NotifyPropertyChanged();
1120 /// The counter clockwise focusable view by rotary wheel.<br />
1121 /// This will return null if not set.<br />
1122 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1124 [EditorBrowsable(EditorBrowsableState.Never)]
1125 public View CounterClockwiseFocusableView
1127 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1130 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1134 SetValue(CounterClockwiseFocusableViewProperty, value);
1135 NotifyPropertyChanged();
1140 /// Whether the view should be focusable by keyboard navigation.
1142 /// <since_tizen> 3 </since_tizen>
1143 public bool Focusable
1147 SetValue(FocusableProperty, value);
1148 NotifyPropertyChanged();
1152 return (bool)GetValue(FocusableProperty);
1157 /// 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.
1158 /// Note : Default value is true.
1160 [EditorBrowsable(EditorBrowsableState.Never)]
1161 public bool FocusableChildren
1165 SetValue(FocusableChildrenProperty, value);
1166 NotifyPropertyChanged();
1170 return (bool)GetValue(FocusableChildrenProperty);
1175 /// Whether this view can focus by touch.
1176 /// If Focusable is false, FocusableInTouch is disabled.
1177 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1179 [EditorBrowsable(EditorBrowsableState.Never)]
1180 public bool FocusableInTouch
1184 SetValue(FocusableInTouchProperty, value);
1185 NotifyPropertyChanged();
1189 return (bool)GetValue(FocusableInTouchProperty);
1194 /// Retrieves the position of the view.
1195 /// The coordinates are relative to the view's parent.
1198 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1199 /// 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).
1200 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1201 /// and users can get the current actual values through them.
1203 /// <since_tizen> 3 </since_tizen>
1204 public Position CurrentPosition
1208 return GetCurrentPosition();
1213 /// Sets the size of a view for the width and the height.<br />
1214 /// Geometry can be scaled to fit within this area.<br />
1215 /// This does not interfere with the view's scale factor.<br />
1216 /// The views default depth is the minimum of width and height.<br />
1219 /// The property cascade chaining set is not recommended.
1222 /// This way is recommended for setting the property
1224 /// var view = new View();
1225 /// view.Size2D = new Size2D(100, 200);
1227 /// This way to set the property is prohibited
1229 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1232 /// <since_tizen> 3 </since_tizen>
1233 public Size2D Size2D
1237 var temp = (Size2D)GetValue(Size2DProperty);
1239 if (this.Layout == null)
1241 if (temp.Width < 0) { temp.Width = 0; }
1242 if (temp.Height < 0) { temp.Height = 0; }
1249 SetValue(Size2DProperty, value);
1251 NotifyPropertyChanged();
1256 /// Retrieves the size of the view.
1257 /// The coordinates are relative to the view's parent.
1260 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1261 /// 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).
1262 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1263 /// and users can get the current actual values through them.
1265 /// <since_tizen> 3 </since_tizen>
1266 public Size2D CurrentSize
1270 return GetCurrentSize();
1275 /// Retrieves and sets the view's opacity.<br />
1279 /// Animatable - This property can be animated using <c>Animation</c> class.
1281 /// animation.AnimateTo(view, "Opacity", 0.5f);
1285 /// <since_tizen> 3 </since_tizen>
1286 public float Opacity
1290 return (float)GetValue(OpacityProperty);
1294 SetValue(OpacityProperty, value);
1295 NotifyPropertyChanged();
1300 /// Sets the position of the view for X and Y.<br />
1301 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1302 /// If the position inheritance is disabled, sets the world position.<br />
1305 /// The property cascade chaining set is not recommended.
1308 /// This way is recommended for setting the property
1310 /// var view = new View();
1311 /// view.Position2D = new Position2D(100, 200);
1313 /// This way to set the property is prohibited
1315 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1318 /// <since_tizen> 3 </since_tizen>
1319 public Position2D Position2D
1323 return (Position2D)GetValue(Position2DProperty);
1327 SetValue(Position2DProperty, value);
1328 NotifyPropertyChanged();
1333 /// Retrieves the screen position of the view.<br />
1335 /// <since_tizen> 3 </since_tizen>
1336 public Vector2 ScreenPosition
1340 return GetCurrentScreenPosition();
1345 /// Retrieves the screen position and size of the view.<br />
1348 /// The float type Rectangle class is not ready yet.
1349 /// Therefore, it transmits data in Vector4 class.
1350 /// This type should later be changed to the appropriate data type.
1352 [EditorBrowsable(EditorBrowsableState.Never)]
1353 public Vector4 ScreenPositionSize
1357 return GetCurrentScreenPositionSize();
1362 /// Determines whether the pivot point should be used to determine the position of the view.
1363 /// This is false by default.
1365 /// <remarks>If false, then the top-left of the view is used for the position.
1366 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1368 /// <since_tizen> 3 </since_tizen>
1369 public bool PositionUsesPivotPoint
1373 return (bool)GetValue(PositionUsesPivotPointProperty);
1377 SetValue(PositionUsesPivotPointProperty, value);
1378 NotifyPropertyChanged();
1383 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1385 /// <since_tizen> 3 </since_tizen>
1386 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1388 "View view = new View(); " +
1389 "view.PivotPoint = PivotPoint.Center; " +
1390 "view.PositionUsesPivotPoint = true;" +
1391 " This has been deprecated in API5 and will be removed in API8")]
1392 [EditorBrowsable(EditorBrowsableState.Never)]
1393 public bool PositionUsesAnchorPoint
1397 return (bool)GetValue(PositionUsesAnchorPointProperty);
1401 SetValue(PositionUsesAnchorPointProperty, value);
1405 private bool InternalPositionUsesAnchorPoint
1409 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
1413 Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
1414 NotifyPropertyChanged();
1419 /// Queries whether the view is connected to the stage.<br />
1420 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1422 /// <since_tizen> 3 </since_tizen>
1423 public bool IsOnWindow
1432 /// Gets the depth in the hierarchy for the view.
1434 /// <since_tizen> 3 </since_tizen>
1435 public int HierarchyDepth
1439 return GetHierarchyDepth();
1444 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1447 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1448 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1449 /// The values set by this property will likely change.
1451 /// <since_tizen> 3 </since_tizen>
1452 public int SiblingOrder
1456 return (int)GetValue(SiblingOrderProperty);
1460 SetValue(SiblingOrderProperty, value);
1462 Layout?.ChangeLayoutSiblingOrder(value);
1464 NotifyPropertyChanged();
1469 /// Returns the natural size of the view.
1472 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1474 /// <since_tizen> 5 </since_tizen>
1475 public Vector3 NaturalSize
1479 Vector3 ret = GetNaturalSize();
1480 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1486 /// Returns the natural size (Size2D) of the view.
1489 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1491 /// <since_tizen> 4 </since_tizen>
1492 public Size2D NaturalSize2D
1496 Vector3 temp = GetNaturalSize();
1497 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1499 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1506 /// Gets or sets the origin of a view within its parent's area.<br />
1507 /// 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 />
1508 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1509 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1511 /// <pre>The view has been initialized.</pre>
1512 /// <since_tizen> 3 </since_tizen>
1513 public Position ParentOrigin
1517 Position tmp = (Position)GetValue(ParentOriginProperty);
1518 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1522 SetValue(ParentOriginProperty, value);
1523 NotifyPropertyChanged();
1528 /// Gets or sets the anchor-point of a view.<br />
1529 /// 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 />
1530 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1531 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1532 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1533 /// <pre>The view has been initialized.</pre>
1536 /// The property cascade chaining set is not recommended.
1539 /// This way is recommended for setting the property
1541 /// var view = new View();
1542 /// view.PivotPoint = PivotPoint.Center;
1544 /// This way to set the property is prohibited
1546 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1549 /// <since_tizen> 3 </since_tizen>
1550 public Position PivotPoint
1554 return (Position)GetValue(PivotPointProperty);
1558 SetValue(PivotPointProperty, value);
1559 NotifyPropertyChanged();
1564 /// Gets or sets the size width of the view.
1568 /// Animatable - This property can be animated using <c>Animation</c> class.
1570 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1574 /// <since_tizen> 3 </since_tizen>
1575 public float SizeWidth
1579 return (float)GetValue(SizeWidthProperty);
1583 SetValue(SizeWidthProperty, value);
1584 NotifyPropertyChanged();
1589 /// Gets or sets the size height of the view.
1593 /// Animatable - This property can be animated using <c>Animation</c> class.
1596 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1599 /// <since_tizen> 3 </since_tizen>
1600 public float SizeHeight
1604 return (float)GetValue(SizeHeightProperty);
1608 SetValue(SizeHeightProperty, value);
1609 NotifyPropertyChanged();
1614 /// Gets or sets the position of the view.<br />
1615 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1616 /// If the position inheritance is disabled, sets the world position.<br />
1620 /// Animatable - This property can be animated using <c>Animation</c> class.
1622 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1625 /// The property cascade chaining set is not recommended.
1628 /// This way is recommended for setting the property
1630 /// var view = new View();
1631 /// view.Position = new Position(100, 200.5f, 0);
1633 /// This way to set the property is prohibited
1635 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1638 /// <since_tizen> 3 </since_tizen>
1639 public Position Position
1643 return (Position)GetValue(PositionProperty);
1647 SetValue(PositionProperty, value);
1648 NotifyPropertyChanged();
1653 /// Gets or sets the position X of the view.
1657 /// Animatable - This property can be animated using <c>Animation</c> class.
1659 /// animation.AnimateTo(view, "PositionX", 50.0f);
1663 /// <since_tizen> 3 </since_tizen>
1664 public float PositionX
1668 return (float)GetValue(PositionXProperty);
1672 SetValue(PositionXProperty, value);
1673 NotifyPropertyChanged();
1678 /// Gets or sets the position Y of the view.
1682 /// Animatable - This property can be animated using <c>Animation</c> class.
1684 /// animation.AnimateTo(view, "PositionY", 50.0f);
1688 /// <since_tizen> 3 </since_tizen>
1689 public float PositionY
1693 return (float)GetValue(PositionYProperty);
1697 SetValue(PositionYProperty, value);
1698 NotifyPropertyChanged();
1703 /// Gets or sets the position Z of the view.
1707 /// Animatable - This property can be animated using <c>Animation</c> class.
1709 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1713 /// <since_tizen> 3 </since_tizen>
1714 public float PositionZ
1718 return (float)GetValue(PositionZProperty);
1722 SetValue(PositionZProperty, value);
1723 NotifyPropertyChanged();
1728 /// Gets or sets the world position of the view.
1730 /// <since_tizen> 3 </since_tizen>
1731 public Vector3 WorldPosition
1735 return GetCurrentWorldPosition();
1740 /// Gets or sets the orientation of the view.<br />
1741 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1745 /// This is an asynchronous method.
1748 /// Animatable - This property can be animated using <c>Animation</c> class.
1750 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1754 /// <since_tizen> 3 </since_tizen>
1755 public Rotation Orientation
1759 return (Rotation)GetValue(OrientationProperty);
1763 SetValue(OrientationProperty, value);
1764 NotifyPropertyChanged();
1769 /// Gets or sets the world orientation of the view.<br />
1771 /// <since_tizen> 3 </since_tizen>
1772 public Rotation WorldOrientation
1776 Rotation temp = new Rotation();
1777 var pValue = GetProperty(View.Property.WorldOrientation);
1785 /// Gets or sets the scale factor applied to the view.<br />
1789 /// Animatable - This property can be animated using <c>Animation</c> class.
1791 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1794 /// The property cascade chaining set is not recommended.
1797 /// This way is recommended for setting the property
1799 /// var view = new View();
1800 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1802 /// This way to set the property is prohibited
1804 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1807 /// <since_tizen> 3 </since_tizen>
1808 public Vector3 Scale
1812 return (Vector3)GetValue(ScaleProperty);
1816 SetValue(ScaleProperty, value);
1817 NotifyPropertyChanged();
1822 /// Gets or sets the scale X factor applied to the view.
1826 /// Animatable - This property can be animated using <c>Animation</c> class.
1828 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1832 /// <since_tizen> 3 </since_tizen>
1837 return (float)GetValue(ScaleXProperty);
1841 SetValue(ScaleXProperty, value);
1842 NotifyPropertyChanged();
1847 /// Gets or sets the scale Y factor applied to the view.
1851 /// Animatable - This property can be animated using <c>Animation</c> class.
1853 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1857 /// <since_tizen> 3 </since_tizen>
1862 return (float)GetValue(ScaleYProperty);
1866 SetValue(ScaleYProperty, value);
1867 NotifyPropertyChanged();
1872 /// Gets or sets the scale Z factor applied to the view.
1876 /// Animatable - This property can be animated using <c>Animation</c> class.
1878 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1882 /// <since_tizen> 3 </since_tizen>
1887 return (float)GetValue(ScaleZProperty);
1891 SetValue(ScaleZProperty, value);
1892 NotifyPropertyChanged();
1897 /// Gets the world scale of the view.
1899 /// <since_tizen> 3 </since_tizen>
1900 public Vector3 WorldScale
1904 return GetCurrentWorldScale();
1909 /// Retrieves the visibility flag of the view.
1913 /// If the view is not visible, then the view and its children will not be rendered.
1914 /// 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.
1917 /// Animatable - This property can be animated using <c>Animation</c> class.
1919 /// animation.AnimateTo(view, "Visibility", false);
1923 /// <since_tizen> 3 </since_tizen>
1924 public bool Visibility
1928 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
1933 /// Gets the view's world color.
1935 /// <since_tizen> 3 </since_tizen>
1936 public Vector4 WorldColor
1940 return GetCurrentWorldColor();
1945 /// Gets or sets the view's name.
1947 /// <since_tizen> 3 </since_tizen>
1952 return (string)GetValue(NameProperty);
1956 SetValue(NameProperty, value);
1957 NotifyPropertyChanged();
1962 /// Get the number of children held by the view.
1964 /// <since_tizen> 3 </since_tizen>
1965 public new uint ChildCount
1969 return Convert.ToUInt32(Children.Count);
1974 /// Gets the view's ID.
1977 /// <since_tizen> 3 </since_tizen>
1987 /// Gets or sets the status of whether the view should emit touch or hover signals.
1988 /// If a View is made insensitive, then the View and its children are not hittable.
1990 /// <since_tizen> 3 </since_tizen>
1991 public bool Sensitive
1995 return (bool)GetValue(SensitiveProperty);
1999 SetValue(SensitiveProperty, value);
2000 NotifyPropertyChanged();
2005 /// Gets or sets the status of whether the view should be enabled user interactions.
2006 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2008 /// <since_tizen> tizen_next </since_tizen>
2009 [EditorBrowsable(EditorBrowsableState.Never)]
2010 public bool IsEnabled
2014 return (bool)GetValue(IsEnabledProperty);
2018 SetValue(IsEnabledProperty, value);
2019 NotifyPropertyChanged();
2024 /// 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.
2026 /// <since_tizen> 3 </since_tizen>
2027 public bool LeaveRequired
2031 return (bool)GetValue(LeaveRequiredProperty);
2035 SetValue(LeaveRequiredProperty, value);
2036 NotifyPropertyChanged();
2041 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2043 /// <since_tizen> 3 </since_tizen>
2044 public bool InheritOrientation
2048 return (bool)GetValue(InheritOrientationProperty);
2052 SetValue(InheritOrientationProperty, value);
2053 NotifyPropertyChanged();
2058 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2060 /// <since_tizen> 3 </since_tizen>
2061 public bool InheritScale
2065 return (bool)GetValue(InheritScaleProperty);
2069 SetValue(InheritScaleProperty, value);
2070 NotifyPropertyChanged();
2075 /// Gets or sets the status of how the view and its children should be drawn.<br />
2076 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2077 /// 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 />
2078 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2079 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2080 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2082 /// <since_tizen> 3 </since_tizen>
2083 public DrawModeType DrawMode
2087 return (DrawModeType)GetValue(DrawModeProperty);
2091 SetValue(DrawModeProperty, value);
2092 NotifyPropertyChanged();
2097 /// Gets or sets the relative to parent size factor of the view.<br />
2098 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2099 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2102 /// The property cascade chaining set is not recommended.
2105 /// This way is recommended for setting the property
2107 /// var text = new TextField();
2108 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2110 /// This way to set the property is prohibited
2112 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2115 /// <since_tizen> 3 </since_tizen>
2116 public Vector3 SizeModeFactor
2120 return (Vector3)GetValue(SizeModeFactorProperty);
2124 SetValue(SizeModeFactorProperty, value);
2125 NotifyPropertyChanged();
2130 /// Gets or sets the width resize policy to be used.
2132 /// <since_tizen> 3 </since_tizen>
2133 public ResizePolicyType WidthResizePolicy
2137 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2141 SetValue(WidthResizePolicyProperty, value);
2142 NotifyPropertyChanged();
2147 /// Gets or sets the height resize policy to be used.
2149 /// <since_tizen> 3 </since_tizen>
2150 public ResizePolicyType HeightResizePolicy
2154 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2158 SetValue(HeightResizePolicyProperty, value);
2159 NotifyPropertyChanged();
2164 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2165 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2167 /// <since_tizen> 3 </since_tizen>
2168 public SizeScalePolicyType SizeScalePolicy
2172 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2176 SetValue(SizeScalePolicyProperty, value);
2177 NotifyPropertyChanged();
2182 /// Gets or sets the status of whether the width size is dependent on the height size.
2184 /// <since_tizen> 3 </since_tizen>
2185 public bool WidthForHeight
2189 return (bool)GetValue(WidthForHeightProperty);
2193 SetValue(WidthForHeightProperty, value);
2194 NotifyPropertyChanged();
2199 /// Gets or sets the status of whether the height size is dependent on the width size.
2201 /// <since_tizen> 3 </since_tizen>
2202 public bool HeightForWidth
2206 return (bool)GetValue(HeightForWidthProperty);
2210 SetValue(HeightForWidthProperty, value);
2211 NotifyPropertyChanged();
2216 /// Gets or sets the padding for use in layout.
2219 /// The property cascade chaining set is not recommended.
2222 /// This way is recommended for setting the property
2224 /// var view = new View();
2225 /// view.Padding = new Extents(5, 5, 5, 5);
2227 /// This way to set the property is prohibited
2229 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2232 /// <since_tizen> 5 </since_tizen>
2233 public Extents Padding
2237 return (Extents)GetValue(PaddingProperty);
2241 SetValue(PaddingProperty, value);
2242 NotifyPropertyChanged();
2247 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2249 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2251 /// The property cascade chaining set is not recommended.
2254 /// This way is recommended for setting the property
2256 /// var view = new View();
2257 /// view.MinimumSize = new Size2D(100, 200);
2259 /// This way to set the property is prohibited
2261 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2264 /// <since_tizen> 3 </since_tizen>
2265 public Size2D MinimumSize
2269 return (Size2D)GetValue(MinimumSizeProperty);
2275 throw new ArgumentNullException(nameof(value));
2279 // Note: it only works if minimum size is >= than natural size.
2280 // To force the size it should be done through the width&height spec or Size2D.
2281 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2282 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2283 layout.RequestLayout();
2285 SetValue(MinimumSizeProperty, value);
2286 NotifyPropertyChanged();
2291 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2294 /// This way is recommended for setting the property
2296 /// var view = new View();
2297 /// view.MaximumSize = new Size2D(100, 200);
2299 /// This way to set the property is prohibited
2301 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2304 /// <since_tizen> 3 </since_tizen>
2305 public Size2D MaximumSize
2309 return (Size2D)GetValue(MaximumSizeProperty);
2313 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2314 // MATCH_PARENT spec + parent container size can be used to limit
2317 layout.RequestLayout();
2319 SetValue(MaximumSizeProperty, value);
2320 NotifyPropertyChanged();
2325 /// Gets or sets whether a child view inherits it's parent's position.<br />
2326 /// Default is to inherit.<br />
2327 /// 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 />
2329 /// <since_tizen> 3 </since_tizen>
2330 public bool InheritPosition
2334 return (bool)GetValue(InheritPositionProperty);
2338 SetValue(InheritPositionProperty, value);
2339 NotifyPropertyChanged();
2344 /// Gets or sets the clipping behavior (mode) of it's children.
2346 /// <since_tizen> 3 </since_tizen>
2347 public ClippingModeType ClippingMode
2351 return (ClippingModeType)GetValue(ClippingModeProperty);
2355 SetValue(ClippingModeProperty, value);
2356 NotifyPropertyChanged();
2361 /// Gets the number of renderers held by the view.
2363 /// <since_tizen> 3 </since_tizen>
2364 public uint RendererCount
2368 return GetRendererCount();
2373 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2376 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2378 /// <since_tizen> 3 </since_tizen>
2379 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2381 "View view = new View(); " +
2382 "view.PivotPoint = PivotPoint.Center; " +
2383 "view.PositionUsesPivotPoint = true;")]
2384 [EditorBrowsable(EditorBrowsableState.Never)]
2385 public Position AnchorPoint
2389 return GetValue(AnchorPointProperty) as Position;
2393 SetValue(AnchorPointProperty, value);
2397 private Position InternalAnchorPoint
2401 return GetCurrentAnchorPoint();
2405 SetAnchorPoint(value);
2406 NotifyPropertyChanged();
2411 /// Sets the size of a view for the width, the height and the depth.<br />
2412 /// Geometry can be scaled to fit within this area.<br />
2413 /// This does not interfere with the view's scale factor.<br />
2414 /// The views default depth is the minimum of width and height.<br />
2418 /// Animatable - This property can be animated using <c>Animation</c> class.
2420 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2423 /// The property cascade chaining set is not recommended.
2426 /// This way is recommended for setting the property
2428 /// var view = new View();
2429 /// view.Size = new Size(100.5f, 200, 0);
2431 /// This way to set the property is prohibited
2433 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2436 /// <since_tizen> 5 </since_tizen>
2441 return (Size)GetValue(SizeProperty);
2445 SetValue(SizeProperty, value);
2446 NotifyPropertyChanged();
2451 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2453 /// <since_tizen> 3 </since_tizen>
2454 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2456 "Container parent = view.GetParent(); " +
2457 "View view = parent as View;")]
2458 [EditorBrowsable(EditorBrowsableState.Never)]
2459 public new View Parent
2464 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2465 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2466 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2468 if (basehandle is Layer layer)
2470 ret = new View(Layer.getCPtr(layer).Handle, false);
2471 NUILog.Error("This Parent property is deprecated, should do not be used");
2475 ret = basehandle as View;
2478 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2479 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2481 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2487 /// Gets/Sets whether inherit parent's the layout Direction.
2489 /// <since_tizen> 4 </since_tizen>
2490 public bool InheritLayoutDirection
2494 return (bool)GetValue(InheritLayoutDirectionProperty);
2498 SetValue(InheritLayoutDirectionProperty, value);
2499 NotifyPropertyChanged();
2504 /// Gets/Sets the layout Direction.
2506 /// <since_tizen> 4 </since_tizen>
2507 public ViewLayoutDirectionType LayoutDirection
2511 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2515 SetValue(LayoutDirectionProperty, value);
2516 NotifyPropertyChanged();
2517 layout?.RequestLayout();
2522 /// Gets or sets the Margin for use in layout.
2525 /// Margin property is supported by Layout algorithms and containers.
2526 /// Please Set Layout if you want to use Margin property.
2527 /// The property cascade chaining set is not recommended.
2530 /// This way is recommended for setting the property
2532 /// var view = new View();
2533 /// view.Margin = new Extents(10, 5, 15, 20);
2535 /// This way to set the property is prohibited
2537 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2540 /// <since_tizen> 4 </since_tizen>
2541 public Extents Margin
2545 return (Extents)GetValue(MarginProperty);
2549 SetValue(MarginProperty, value);
2550 NotifyPropertyChanged();
2555 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2559 /// // matchParentView matches its size to its parent size.
2560 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2561 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2563 /// // wrapContentView wraps its children with their desired size.
2564 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2565 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2567 /// // exactSizeView shows itself with an exact size.
2568 /// exactSizeView.WidthSpecification = 100;
2569 /// exactSizeView.HeightSpecification = 100;
2572 /// <since_tizen> 6 </since_tizen>
2573 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2574 public int WidthSpecification
2578 return (int)GetValue(WidthSpecificationProperty);
2582 SetValue(WidthSpecificationProperty, value);
2583 NotifyPropertyChanged();
2587 private int InternalWidthSpecification
2595 if (value == widthPolicy)
2598 widthPolicy = value;
2599 if (widthPolicy >= 0)
2601 SizeWidth = widthPolicy;
2603 layout?.RequestLayout();
2608 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2612 /// // matchParentView matches its size to its parent size.
2613 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2614 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2616 /// // wrapContentView wraps its children with their desired size.
2617 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2618 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2620 /// // exactSizeView shows itself with an exact size.
2621 /// exactSizeView.WidthSpecification = 100;
2622 /// exactSizeView.HeightSpecification = 100;
2625 /// <since_tizen> 6 </since_tizen>
2626 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2627 public int HeightSpecification
2631 return (int)GetValue(HeightSpecificationProperty);
2635 SetValue(HeightSpecificationProperty, value);
2636 NotifyPropertyChanged();
2640 private int InternalHeightSpecification
2644 return heightPolicy;
2648 if (value == heightPolicy)
2651 heightPolicy = value;
2652 if (heightPolicy >= 0)
2654 SizeHeight = heightPolicy;
2656 layout?.RequestLayout();
2661 /// Gets the List of transitions for this View.
2663 /// <since_tizen> 6 </since_tizen>
2664 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2668 if (layoutTransitions == null)
2670 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2672 return layoutTransitions;
2677 /// Sets a layout transitions for this View.
2679 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2681 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2683 /// <since_tizen> 6 </since_tizen>
2684 public LayoutTransition LayoutTransition
2688 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2692 SetValue(LayoutTransitionProperty, value);
2693 NotifyPropertyChanged();
2697 private LayoutTransition InternalLayoutTransition
2701 return layoutTransition;
2707 throw new global::System.ArgumentNullException(nameof(value));
2709 if (layoutTransitions == null)
2711 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2714 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2716 AttachTransitionsToChildren(value);
2718 layoutTransition = value;
2723 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2726 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2728 /// <since_tizen> 4 </since_tizen>
2729 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2730 [EditorBrowsable(EditorBrowsableState.Never)]
2731 public Extents PaddingEX
2735 return GetValue(PaddingEXProperty) as Extents;
2739 SetValue(PaddingEXProperty, value);
2743 private Extents InternalPaddingEX
2747 Extents temp = new Extents(0, 0, 0, 0);
2748 var pValue = GetProperty(View.Property.PADDING);
2751 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2757 var temp = new Tizen.NUI.PropertyValue(value);
2758 SetProperty(View.Property.PADDING, temp);
2760 NotifyPropertyChanged();
2761 layout?.RequestLayout();
2766 /// The Color of View. This is an RGBA value.
2767 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2768 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2769 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2770 /// Inherient of color value depend on <see cref="ColorMode"/>.
2774 /// Animatable - This property can be animated using <c>Animation</c> class.
2776 /// The property cascade chaining set is not recommended.
2779 /// This way is recommended for setting the property
2781 /// var view = new View();
2782 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2784 /// This way to set the property is prohibited
2786 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2789 [EditorBrowsable(EditorBrowsableState.Never)]
2794 return (Color)GetValue(ColorProperty);
2798 SetValue(ColorProperty, value);
2799 NotifyPropertyChanged();
2804 /// The Red component of View.Color.
2808 /// Animatable - This property can be animated using <c>Animation</c> class.
2811 [EditorBrowsable(EditorBrowsableState.Never)]
2812 public float ColorRed
2816 return (float)GetValue(ColorRedProperty);
2820 SetValue(ColorRedProperty, value);
2821 NotifyPropertyChanged();
2826 /// The Green component of View.Color.
2830 /// Animatable - This property can be animated using <c>Animation</c> class.
2833 [EditorBrowsable(EditorBrowsableState.Never)]
2834 public float ColorGreen
2838 return (float)GetValue(ColorGreenProperty);
2842 SetValue(ColorGreenProperty, value);
2843 NotifyPropertyChanged();
2848 /// The Blue component of View.Color.
2852 /// Animatable - This property can be animated using <c>Animation</c> class.
2855 [EditorBrowsable(EditorBrowsableState.Never)]
2856 public float ColorBlue
2860 return (float)GetValue(ColorBlueProperty);
2864 SetValue(ColorBlueProperty, value);
2865 NotifyPropertyChanged();
2870 /// Set the layout on this View. Replaces any existing Layout.
2873 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2875 /// <since_tizen> 6 </since_tizen>
2876 public LayoutItem Layout
2880 return GetValue(LayoutProperty) as LayoutItem;
2884 SetValue(LayoutProperty, value);
2888 private LayoutItem InternalLayout
2896 // Do nothing if layout provided is already set on this View.
2897 if (value == layout)
2902 LayoutingDisabled = false;
2905 // If new layout being set already has a owner then that owner receives a replacement default layout.
2906 // First check if the layout to be set already has a owner.
2907 if (value?.Owner != null)
2909 // Previous owner of the layout gets a default layout as a replacement.
2910 value.Owner.Layout = new AbsoluteLayout()
2912 // Copy Margin and Padding to replacement LayoutGroup.
2913 Margin = value.Margin,
2914 Padding = value.Padding,
2918 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2919 // View if no replacement. Previously margin and padding values would have been moved from
2920 // the View to the layout.
2921 if (layout != null) // Existing layout
2925 // Existing layout being replaced so copy over margin and padding values.
2926 value.Margin = layout.Margin;
2927 value.Padding = layout.Padding;
2928 value.SetPositionByLayout = !excludeLayouting;
2932 // Layout not being replaced so restore margin and padding to View.
2933 SetValue(MarginProperty, layout.Margin);
2934 SetValue(PaddingProperty, layout.Padding);
2935 NotifyPropertyChanged();
2940 // First Layout to be added to the View hence copy
2942 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2945 Extents margin = Margin;
2946 Extents padding = Padding;
2947 bool setMargin = false;
2948 bool setPadding = false;
2950 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2952 // If View already has a margin set then store it in Layout instead.
2953 value.Margin = margin;
2954 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2958 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
2960 // If View already has a padding set then store it in Layout instead.
2961 value.Padding = padding;
2962 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
2966 if (setMargin || setPadding)
2968 NotifyPropertyChanged();
2971 value.SetPositionByLayout = !excludeLayouting;
2975 // Remove existing layout from it's parent layout group.
2978 // Set layout to this view
2984 /// The weight of the View, used to share available space in a layout with siblings.
2986 /// <since_tizen> 6 </since_tizen>
2996 layout?.RequestLayout();
3001 /// Whether to load the BackgroundImage synchronously.
3002 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3003 /// Note: For Normal Quad images only.
3005 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3006 [EditorBrowsable(EditorBrowsableState.Never)]
3007 public bool BackgroundImageSynchronosLoading
3011 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3015 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3016 NotifyPropertyChanged();
3020 private bool InternalBackgroundImageSynchronosLoading
3024 return BackgroundImageSynchronousLoading;
3028 BackgroundImageSynchronousLoading = value;
3033 /// Whether to load the BackgroundImage synchronously.
3034 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3035 /// Note: For Normal Quad images only.
3037 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3038 [EditorBrowsable(EditorBrowsableState.Never)]
3039 public bool BackgroundImageSynchronousLoading
3043 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3047 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3048 NotifyPropertyChanged();
3052 private bool InternalBackgroundImageSynchronousLoading
3056 return backgroundImageSynchronousLoading;
3060 backgroundImageSynchronousLoading = value;
3062 if (!string.IsNullOrEmpty(BackgroundImage))
3064 PropertyMap bgMap = this.Background;
3065 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3066 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3073 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3074 [EditorBrowsable(EditorBrowsableState.Never)]
3075 public Vector4 UpdateAreaHint
3079 return (Vector4)GetValue(UpdateAreaHintProperty);
3083 SetValue(UpdateAreaHintProperty, value);
3084 NotifyPropertyChanged();
3089 /// Enable/Disable ControlState propagation for children.
3090 /// It is false by default.
3091 /// If the View needs to share ControlState with descendants, please set it true.
3092 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3094 [EditorBrowsable(EditorBrowsableState.Never)]
3095 public bool EnableControlStatePropagation
3099 return (bool)GetValue(EnableControlStatePropagationProperty);
3103 SetValue(EnableControlStatePropagationProperty, value);
3104 NotifyPropertyChanged();
3108 private bool InternalEnableControlStatePropagation
3110 get => themeData?.ControlStatePropagation ?? false;
3113 if (InternalEnableControlStatePropagation == value) return;
3115 if (themeData == null) themeData = new ThemeData();
3117 themeData.ControlStatePropagation = value;
3119 foreach (View child in Children)
3121 child.EnableControlStatePropagation = value;
3127 /// The ControlStates can propagate from the parent.
3128 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3129 /// if parent view EnableControlState is true.
3130 /// <see cref="EnableControlState"/>.
3131 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3133 [EditorBrowsable(EditorBrowsableState.Never)]
3134 public ControlState PropagatableControlStates
3138 return (ControlState)GetValue(PropagatableControlStatesProperty);
3142 SetValue(PropagatableControlStatesProperty, value);
3143 NotifyPropertyChanged();
3147 private ControlState InternalPropagatableControlStates
3149 get => propagatableControlStates;
3150 set => propagatableControlStates = value;
3154 /// By default, it is false in View, true in Control.
3155 /// Note that if the value is true, the View will be a touch receptor.
3157 [EditorBrowsable(EditorBrowsableState.Never)]
3158 public bool EnableControlState
3162 return (bool)GetValue(EnableControlStateProperty);
3166 SetValue(EnableControlStateProperty, value);
3171 /// Whether the actor grab all touches even if touch leaves its boundary.
3173 /// <returns>true, if it grab all touch after start</returns>
3174 [EditorBrowsable(EditorBrowsableState.Never)]
3175 public bool GrabTouchAfterLeave
3179 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3183 SetValue(GrabTouchAfterLeaveProperty, value);
3187 private bool InternalGrabTouchAfterLeave
3191 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
3195 Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
3196 NotifyPropertyChanged();
3201 /// Whether the view will only receive own touch.
3203 /// <returns>true, if it only receives touches that started from itself.</returns>
3204 [EditorBrowsable(EditorBrowsableState.Never)]
3205 public bool AllowOnlyOwnTouch
3209 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3213 SetValue(AllowOnlyOwnTouchProperty, value);
3217 private bool InternalAllowOnlyOwnTouch
3221 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
3225 Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
3226 NotifyPropertyChanged();
3231 /// Determines which blend equation will be used to render renderers of this actor.
3233 /// <returns>blend equation enum currently assigned</returns>
3234 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3235 [EditorBrowsable(EditorBrowsableState.Never)]
3236 public BlendEquationType BlendEquation
3240 return (BlendEquationType)GetValue(BlendEquationProperty);
3244 SetValue(BlendEquationProperty, value);
3248 private BlendEquationType InternalBlendEquation
3252 return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
3256 Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
3257 NotifyPropertyChanged();
3262 /// If the value is true, the View will change its style as the theme changes.
3263 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3265 /// <since_tizen> 9 </since_tizen>
3266 public bool ThemeChangeSensitive
3268 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3269 set => SetValue(ThemeChangeSensitiveProperty, value);
3273 /// Create Style, it is abstract function and must be override.
3275 [EditorBrowsable(EditorBrowsableState.Never)]
3276 protected virtual ViewStyle CreateViewStyle()
3278 return new ViewStyle();
3282 /// Called after the View's ControlStates changed.
3284 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3285 [EditorBrowsable(EditorBrowsableState.Never)]
3286 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3292 [EditorBrowsable(EditorBrowsableState.Never)]
3293 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3295 isThemeChanged = true;
3296 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3297 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3298 isThemeChanged = false;
3302 /// Apply style instance to the view.
3303 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3305 /// <since_tizen> 9 </since_tizen>
3306 public virtual void ApplyStyle(ViewStyle viewStyle)
3308 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3310 if (themeData == null) themeData = new ThemeData();
3312 themeData.viewStyle = viewStyle;
3314 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3320 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3322 if (bindablePropertyOfView == null)
3327 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3328 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3330 foreach (var sourceProperty in dirtyStyleProperties)
3332 var sourceValue = viewStyle.GetValue(sourceProperty);
3334 if (sourceValue == null)
3339 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3341 // Do not set value again when theme is changed and the value has been set already.
3342 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3347 if (destinationProperty != null)
3349 InternalSetValue(destinationProperty, sourceValue);
3355 /// Get whether the View is culled or not.
3356 /// True means that the View is out of the view frustum.
3359 /// Hidden-API (Inhouse-API).
3361 [EditorBrowsable(EditorBrowsableState.Never)]
3366 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
3371 /// Set or Get TransitionOptions for the page transition.
3372 /// This property is used to define how this view will be transitioned during Page switching.
3374 /// <since_tizen> 9 </since_tizen>
3375 public TransitionOptions TransitionOptions
3379 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3383 SetValue(TransitionOptionsProperty, value);
3384 NotifyPropertyChanged();
3388 private TransitionOptions InternalTransitionOptions
3392 transitionOptions = value;
3396 return transitionOptions;
3401 /// Gets or sets the status of whether the view should emit key event signals.
3402 /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
3404 [EditorBrowsable(EditorBrowsableState.Never)]
3405 public bool DispatchKeyEvents
3409 return (bool)GetValue(DispatchKeyEventsProperty);
3413 SetValue(DispatchKeyEventsProperty, value);
3414 NotifyPropertyChanged();
3419 /// Gets or sets the status of whether touch events can be dispatched.
3420 /// 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.
3421 /// This works without adding a TouchEvent callback in the View.
3423 /// 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.
3426 [EditorBrowsable(EditorBrowsableState.Never)]
3427 public bool DispatchTouchEvents
3431 return dispatchTouchEvents;
3435 if (dispatchTouchEvents != value)
3437 dispatchTouchEvents = value;
3438 if (dispatchTouchEvents == false)
3440 TouchEvent += OnDispatchTouchEvent;
3444 TouchEvent -= OnDispatchTouchEvent;
3450 private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
3456 /// Gets or sets the status of whether the view should emit Gesture event signals.
3457 /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
3458 /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3460 [EditorBrowsable(EditorBrowsableState.Never)]
3461 public bool DispatchGestureEvents
3465 return dispatchGestureEvents;
3469 if (dispatchGestureEvents != value)
3471 dispatchGestureEvents = value;
3472 ConfigGestureDetector(dispatchGestureEvents);
3478 /// Gets or sets the status of whether the view should emit Gesture event signals.
3479 /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
3480 /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3482 [EditorBrowsable(EditorBrowsableState.Never)]
3483 public bool DispatchParentGestureEvents
3487 return dispatchParentGestureEvents;
3491 if (dispatchParentGestureEvents != value)
3493 dispatchParentGestureEvents = value;
3494 ConfigGestureDetector(dispatchParentGestureEvents);
3499 private void ConfigGestureDetector(bool dispatch)
3501 if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
3502 if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
3503 if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
3504 if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
3505 if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
3507 if (dispatch == true)
3509 configGestureCount = configGestureCount > 0 ? configGestureCount-- : 0;
3510 if (configGestureCount == 0)
3512 panGestureDetector.Detach(this);
3513 longGestureDetector.Detach(this);
3514 pinchGestureDetector.Detach(this);
3515 tapGestureDetector.Detach(this);
3516 rotationGestureDetector.Detach(this);
3518 panGestureDetector.Detected -= OnGestureDetected;
3519 longGestureDetector.Detected -= OnGestureDetected;
3520 pinchGestureDetector.Detected -= OnGestureDetected;
3521 tapGestureDetector.Detected -= OnGestureDetected;
3522 rotationGestureDetector.Detected -= OnGestureDetected;
3524 panGestureDetector = null;
3525 longGestureDetector = null;
3526 pinchGestureDetector = null;
3527 tapGestureDetector = null;
3528 rotationGestureDetector = null;
3533 if (configGestureCount == 0)
3535 panGestureDetector.Attach(this);
3536 longGestureDetector.Attach(this);
3537 pinchGestureDetector.Attach(this);
3538 tapGestureDetector.Attach(this);
3539 rotationGestureDetector.Attach(this);
3541 panGestureDetector.Detected += OnGestureDetected;
3542 longGestureDetector.Detected += OnGestureDetected;
3543 pinchGestureDetector.Detected += OnGestureDetected;
3544 tapGestureDetector.Detected += OnGestureDetected;
3545 rotationGestureDetector.Detected += OnGestureDetected;
3547 configGestureCount++;
3551 private void OnGestureDetected(object source, EventArgs e)
3553 // Does notting. This is to consume the gesture.
3557 /// Called when the view is hit through TouchEvent or GestureEvent.
3558 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3559 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3560 /// User can override whether hit or not in HitTest.
3561 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3562 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3564 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3565 [EditorBrowsable(EditorBrowsableState.Never)]
3566 protected virtual bool HitTest(Touch touch)
3572 /// Retrieve the View's current Color.
3575 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3576 /// 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).
3577 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3578 /// and users can get the current actual values through them.
3580 [EditorBrowsable(EditorBrowsableState.Never)]
3581 public Color CurrentColor => GetCurrentColor();
3584 /// Retrieve the current scale factor applied to the View.
3587 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3588 /// 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).
3589 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3590 /// and users can get the current actual values through them.
3592 [EditorBrowsable(EditorBrowsableState.Never)]
3593 public Vector3 CurrentScale => GetCurrentScale();