2 * Copyright(c) 2022 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Collections.Generic;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.Binding;
23 namespace Tizen.NUI.BaseComponents
26 /// View is the base class for all views.
28 /// <since_tizen> 3 </since_tizen>
29 public partial class View : Container, IResourcesProvider
31 private static HashSet<BindableProperty> positionPropertyGroup = new HashSet<BindableProperty>();
32 private static HashSet<BindableProperty> sizePropertyGroup = new HashSet<BindableProperty>();
33 private static HashSet<BindableProperty> scalePropertyGroup = new HashSet<BindableProperty>();
34 private static bool defaultGrabTouchAfterLeave = false;
35 private static bool defaultAllowOnlyOwnTouch = false;
37 internal BackgroundExtraData backgroundExtraData;
39 private bool layoutSet = false;
40 private LayoutItem layout; // Exclusive layout assigned to this View.
42 // List of transitions paired with the condition that uses the transition.
43 private Dictionary<TransitionCondition, TransitionList> layoutTransitions;
44 private int widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
45 private int heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
46 private float weight = 0.0f; // Weighting of child View in a Layout
47 private bool backgroundImageSynchronousLoading = false;
48 private bool excludeLayouting = false;
49 private LayoutTransition layoutTransition;
50 private TransitionOptions transitionOptions = null;
51 private ThemeData themeData;
52 private bool isThemeChanged = false;
54 // List of constraints
55 private Constraint widthConstraint = null;
56 private Constraint heightConstraint = null;
58 private Size2D internalMaximumSize = null;
59 private Size2D internalMinimumSize = null;
60 private Extents internalMargin = null;
61 private Extents internalPadding = null;
62 private Vector3 internalSizeModeFactor = null;
63 private Vector2 internalCellIndex = null;
64 private Color internalBackgroundColor = null;
65 private Color internalColor = null;
66 private Position internalPivotPoint = null;
67 private Position internalPosition = null;
68 private Position2D internalPosition2D = null;
69 private Vector3 internalScale = null;
70 private Size internalSize = null;
71 private Size2D internalSize2D = null;
72 private int layoutCount = 0;
73 private ControlState propagatableControlStates = ControlState.All;
75 // List of dispatch Event
76 private PanGestureDetector panGestureDetector = null;
77 private LongPressGestureDetector longGestureDetector = null;
78 private PinchGestureDetector pinchGestureDetector = null;
79 private TapGestureDetector tapGestureDetector = null;
80 private RotationGestureDetector rotationGestureDetector = null;
81 private int configGestureCount = 0;
82 private bool dispatchTouchEvents = true;
83 private bool dispatchGestureEvents = true;
84 private bool dispatchParentGestureEvents = true;
86 #if NUI_PROPERTY_CHANGE_DEBUG
87 internal static int LayoutSetGetter = 0;
88 internal static int SizeGetter = 0;
89 internal static int SizeSetter = 0;
90 internal static int Size2DGetter = 0;
91 internal static int Size2DSetter = 0;
92 internal static int MaximumSizeGetter = 0;
93 internal static int MaximumSizeSetter = 0;
94 internal static int MinimumSizeGetter = 0;
95 internal static int MinimumSizeSetter = 0;
96 internal static int PositionGetter = 0;
97 internal static int PositionSetter = 0;
98 internal static int Position2DGetter = 0;
99 internal static int Position2DSetter = 0;
100 internal static int SizeWidthGetter = 0;
101 internal static int SizeWidthSetter = 0;
102 internal static int SizeHeightGetter = 0;
103 internal static int SizeHeightSetter = 0;
104 internal static int PositionXGetter = 0;
105 internal static int PositionXSetter = 0;
106 internal static int PositionYGetter = 0;
107 internal static int PositionYSetter = 0;
108 internal static int PositionZGetter = 0;
109 internal static int PositionZSetter = 0;
110 internal static int StyleNameGetter = 0;
111 internal static int StyleNameSetter = 0;
112 internal static int KeyInputFocusGetter = 0;
113 internal static int KeyInputFocusSetter = 0;
114 internal static int ColorGetter = 0;
115 internal static int ColorSetter = 0;
118 internal static int ColorRedSetter = 0;
119 internal static int ColorGreenSetter = 0;
120 internal static int ColorBlueSetter = 0;
121 internal static int StateSetter = 0;
122 internal static int SubStateSetter = 0;
123 internal static int FlexSetter = 0;
124 internal static int AlignSelfSetter = 0;
125 internal static int FlexMarginSetter = 0;
126 internal static int CellIndexSetter = 0;
127 internal static int RowSpanSetter = 0;
128 internal static int ColumnSpanSetter = 0;
129 internal static int CellHorizontalAlignmentSetter = 0;
130 internal static int CellVerticalAlignmentSetter = 0;
131 internal static int OpacitySetter = 0;
132 internal static int PositionUsesPivotPointSetter = 0;
133 internal static int ParentOriginSetter = 0;
134 internal static int PivotPointSetter = 0;
135 internal static int OrientationSetter = 0;
136 internal static int ScaleSetter = 0;
137 internal static int ScaleXSetter = 0;
138 internal static int ScaleYSetter = 0;
139 internal static int ScaleZSetter = 0;
140 internal static int NameSetter = 0;
141 internal static int SensitiveSetter = 0;
142 internal static int IsEnabledSetter = 0;
143 internal static int DispatchKeyEventsSetter = 0;
144 internal static int LeaveRequiredSetter = 0;
145 internal static int InheritOrientationSetter = 0;
146 internal static int InheritScaleSetter = 0;
147 internal static int DrawModeSetter = 0;
148 internal static int SizeModeFactorSetter = 0;
149 internal static int WidthResizePolicySetter = 0;
150 internal static int HeightResizePolicySetter = 0;
151 internal static int SizeScalePolicySetter = 0;
152 internal static int WidthForHeightSetter = 0;
153 internal static int HeightForWidthSetter = 0;
154 internal static int InheritPositionSetter = 0;
155 internal static int ClippingModeSetter = 0;
156 internal static int InheritLayoutDirectionSetter = 0;
157 internal static int LayoutDirectionSetter = 0;
158 internal static int UpdateAreaHintSetter = 0;
159 internal static int AccessibilityNameSetter = 0;
160 internal static int AccessibilityDescriptionSetter = 0;
161 internal static int AccessibilityTranslationDomainSetter = 0;
162 internal static int AccessibilityRoleSetter = 0;
163 internal static int AccessibilityHighlightableSetter = 0;
164 internal static int AccessibilityHiddenSetter = 0;
165 internal static int AutomationIdSetter = 0;
167 internal static int ColorRedGetter = 0;
168 internal static int ColorGreenGetter = 0;
169 internal static int ColorBlueGetter = 0;
170 internal static int StateGetter = 0;
171 internal static int SubStateGetter = 0;
172 internal static int FlexGetter = 0;
173 internal static int AlignSelfGetter = 0;
174 internal static int FlexMarginGetter = 0;
175 internal static int CellIndexGetter = 0;
176 internal static int RowSpanGetter = 0;
177 internal static int ColumnSpanGetter = 0;
178 internal static int CellHorizontalAlignmentGetter = 0;
179 internal static int CellVerticalAlignmentGetter = 0;
180 internal static int OpacityGetter = 0;
181 internal static int PositionUsesPivotPointGetter = 0;
182 internal static int ParentOriginGetter = 0;
183 internal static int PivotPointGetter = 0;
184 internal static int OrientationGetter = 0;
185 internal static int ScaleGetter = 0;
186 internal static int ScaleXGetter = 0;
187 internal static int ScaleYGetter = 0;
188 internal static int ScaleZGetter = 0;
189 internal static int NameGetter = 0;
190 internal static int SensitiveGetter = 0;
191 internal static int IsEnabledGetter = 0;
192 internal static int DispatchKeyEventsGetter = 0;
193 internal static int LeaveRequiredGetter = 0;
194 internal static int InheritOrientationGetter = 0;
195 internal static int InheritScaleGetter = 0;
196 internal static int DrawModeGetter = 0;
197 internal static int SizeModeFactorGetter = 0;
198 internal static int WidthResizePolicyGetter = 0;
199 internal static int HeightResizePolicyGetter = 0;
200 internal static int SizeScalePolicyGetter = 0;
201 internal static int WidthForHeightGetter = 0;
202 internal static int HeightForWidthGetter = 0;
203 internal static int InheritPositionGetter = 0;
204 internal static int ClippingModeGetter = 0;
205 internal static int InheritLayoutDirectionGetter = 0;
206 internal static int LayoutDirectionGetter = 0;
207 internal static int UpdateAreaHintGetter = 0;
208 internal static int AccessibilityNameGetter = 0;
209 internal static int AccessibilityDescriptionGetter = 0;
210 internal static int AccessibilityTranslationDomainGetter = 0;
211 internal static int AccessibilityRoleGetter = 0;
212 internal static int AccessibilityHighlightableGetter = 0;
213 internal static int AccessibilityHiddenGetter = 0;
214 internal static int AutomationIdGetter = 0;
221 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
222 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
223 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
224 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
226 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
227 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
228 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
229 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
231 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
232 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
233 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
234 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
236 RegisterAccessibilityDelegate();
240 /// Creates a new instance of a view.
242 /// <since_tizen> 3 </since_tizen>
243 public View() : this(Interop.View.New(), true)
245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
249 [EditorBrowsable(EditorBrowsableState.Never)]
250 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
255 /// Create a new instance of a View with setting the status of shown or hidden.
257 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
258 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
259 [EditorBrowsable(EditorBrowsableState.Never)]
260 public View(bool shown) : this(Interop.View.New(), true)
262 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
266 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
268 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
274 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
277 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
279 InitializeStyle(viewStyle);
282 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
286 PositionUsesPivotPoint = false;
289 onWindowSendEventCallback = SendViewAddedEventToWindow;
290 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
291 signal?.Connect(onWindowSendEventCallback);
293 hitTestResultDataCallback = OnHitTestResult;
294 using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
295 touchDataSignal?.Connect(hitTestResultDataCallback);
302 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
303 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
306 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
308 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
317 /// The event that is triggered when the View's ControlState is changed.
319 [EditorBrowsable(EditorBrowsableState.Never)]
320 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
322 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
326 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
328 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
329 [EditorBrowsable(EditorBrowsableState.Never)]
330 public bool LayoutSet
334 #if NUI_PROPERTY_CHANGE_DEBUG
342 /// Flag to allow Layouting to be disabled for Views.
343 /// Once a View has a Layout set then any children added to Views from then on will receive
344 /// automatic Layouts.
346 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
347 [EditorBrowsable(EditorBrowsableState.Never)]
348 public static bool LayoutingDisabled { get; set; } = true;
351 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
353 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
354 [EditorBrowsable(EditorBrowsableState.Never)]
355 public static void SetDefaultGrabTouchAfterLeave(bool enable)
357 defaultGrabTouchAfterLeave = enable;
361 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
363 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
364 [EditorBrowsable(EditorBrowsableState.Never)]
365 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
367 defaultAllowOnlyOwnTouch = enable;
371 /// Deprecate. Do not use this.
372 /// The style instance applied to this view.
373 /// Note that do not modify the ViewStyle.
374 /// Modifying ViewStyle will affect other views with same ViewStyle.
376 [EditorBrowsable(EditorBrowsableState.Never)]
377 protected ViewStyle ViewStyle
381 if (themeData == null) themeData = new ThemeData();
383 if (themeData.viewStyle == null)
385 ApplyStyle(CreateViewStyle());
387 return themeData.viewStyle;
392 /// Get/Set the control state.
393 /// Note that the ControlState only available for the classes derived from Control.
394 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
395 /// please set <see cref="EnableControlState"/> to true.
397 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
398 [EditorBrowsable(EditorBrowsableState.Never)]
399 public ControlState ControlState
403 return themeData == null ? ControlState.Normal : themeData.controlStates;
407 if (ControlState == value)
412 var prevState = ControlState;
414 if (themeData == null) themeData = new ThemeData();
415 themeData.controlStates = value;
417 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
419 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
421 if (themeData.ControlStatePropagation)
423 foreach (View child in Children)
425 ControlState allowed = child.PropagatableControlStates;
426 if (allowed.Contains(ControlState.All))
428 child.ControlState = value;
432 ControlState newControlState = child.ControlState;
434 if (allowed.Contains(ControlState.Normal))
436 if (value.Contains(ControlState.Normal))
438 newControlState += ControlState.Normal;
442 newControlState -= ControlState.Normal;
446 if (allowed.Contains(ControlState.Disabled))
448 if (value.Contains(ControlState.Disabled))
450 newControlState += ControlState.Disabled;
454 newControlState -= ControlState.Disabled;
458 if (allowed.Contains(ControlState.Selected))
460 if (value.Contains(ControlState.Selected))
462 newControlState += ControlState.Selected;
466 newControlState -= ControlState.Selected;
470 if (allowed.Contains(ControlState.Pressed))
472 if (value.Contains(ControlState.Pressed))
474 newControlState += ControlState.Pressed;
478 newControlState -= ControlState.Pressed;
482 if (allowed.Contains(ControlState.Focused))
484 if (value.Contains(ControlState.Focused))
486 newControlState += ControlState.Focused;
490 newControlState -= ControlState.Focused;
494 if (allowed.Contains(ControlState.Other))
496 if (value.Contains(ControlState.Other))
498 newControlState += ControlState.Other;
502 newControlState -= ControlState.Other;
506 if (child.ControlState != newControlState)
507 child.ControlState = newControlState;
512 OnControlStateChanged(changeInfo);
514 ControlStateChangedEvent?.Invoke(this, changeInfo);
519 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
521 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
522 [EditorBrowsable(EditorBrowsableState.Never)]
523 public bool ExcludeLayouting
527 return (bool)GetValue(ExcludeLayoutingProperty);
531 SetValue(ExcludeLayoutingProperty, value);
532 NotifyPropertyChanged();
536 private bool InternalExcludeLayouting
540 return excludeLayouting;
544 excludeLayouting = value;
545 if (Layout != null && Layout.SetPositionByLayout == value)
547 Layout.SetPositionByLayout = !value;
548 Layout.RequestLayout();
554 /// The StyleName, type string.
555 /// The value indicates DALi style name defined in json theme file.
557 /// <since_tizen> 3 </since_tizen>
558 public string StyleName
562 #if NUI_PROPERTY_CHANGE_DEBUG
565 return (string)GetValue(StyleNameProperty);
569 #if NUI_PROPERTY_CHANGE_DEBUG
572 SetValue(StyleNameProperty, value);
573 NotifyPropertyChanged();
578 /// The KeyInputFocus, type bool.
580 [EditorBrowsable(EditorBrowsableState.Never)]
581 public bool KeyInputFocus
585 #if NUI_PROPERTY_CHANGE_DEBUG
586 KeyInputFocusGetter++;
588 return (bool)GetValue(KeyInputFocusProperty);
592 #if NUI_PROPERTY_CHANGE_DEBUG
593 KeyInputFocusSetter++;
595 SetValue(KeyInputFocusProperty, value);
596 NotifyPropertyChanged();
601 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
605 /// The property cascade chaining set is not recommended.
608 /// Animatable - This property can be animated using <c>Animation</c> class.
610 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
615 /// This way is recommended for setting the property
617 /// var view = new View();
618 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
620 /// This way to set the property is prohibited
622 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
625 /// <since_tizen> 3 </since_tizen>
626 public Color BackgroundColor
630 return (Color)GetValue(BackgroundColorProperty);
634 SetValue(BackgroundColorProperty, value);
635 NotifyPropertyChanged();
640 /// The mutually exclusive with "backgroundColor" and "background" type Map.
642 /// <since_tizen> 3 </since_tizen>
643 public string BackgroundImage
647 return (string)GetValue(BackgroundImageProperty);
651 SetValue(BackgroundImageProperty, value);
652 NotifyPropertyChanged();
657 /// Get or set the border of background image.
659 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
660 [EditorBrowsable(EditorBrowsableState.Never)]
661 public Rectangle BackgroundImageBorder
665 return (Rectangle)GetValue(BackgroundImageBorderProperty);
669 SetValue(BackgroundImageBorderProperty, value);
670 NotifyPropertyChanged();
675 /// The background of view.
677 /// <since_tizen> 3 </since_tizen>
678 public Tizen.NUI.PropertyMap Background
682 return (PropertyMap)GetValue(BackgroundProperty);
686 SetValue(BackgroundProperty, value);
687 NotifyPropertyChanged();
692 /// Describes a shadow as an image for a View.
693 /// It is null by default.
696 /// Getter returns copied instance of current shadow.
699 /// The mutually exclusive with "BoxShadow".
703 /// Animatable - This property can be animated using <c>Animation</c> class.
704 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
706 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
708 /// Animatable sub-property : Offset.
711 [EditorBrowsable(EditorBrowsableState.Never)]
712 public ImageShadow ImageShadow
716 return (ImageShadow)GetValue(ImageShadowProperty);
720 SetValue(ImageShadowProperty, value);
721 NotifyPropertyChanged();
726 /// Describes a box shaped shadow drawing for a View.
727 /// It is null by default.
730 /// The mutually exclusive with "ImageShadow".
734 /// Animatable - This property can be animated using <c>Animation</c> class.
735 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
737 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
739 /// Animatable sub-property : Offset, Color, BlurRadius.
742 /// <since_tizen> 9 </since_tizen>
743 public Shadow BoxShadow
747 return (Shadow)GetValue(BoxShadowProperty);
751 SetValue(BoxShadowProperty, value);
752 NotifyPropertyChanged();
757 /// The radius for the rounded corners of the View.
758 /// This will rounds background and shadow edges.
759 /// 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).
760 /// Each radius will clamp internally to the half of smaller of the view's width or height.
761 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
765 /// Animatable - This property can be animated using <c>Animation</c> class.
767 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
771 /// <since_tizen> 9 </since_tizen>
772 public Vector4 CornerRadius
776 return (Vector4)GetValue(CornerRadiusProperty);
780 SetValue(CornerRadiusProperty, value);
781 NotifyPropertyChanged();
786 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
787 /// It is absolute by default.
788 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
790 /// <since_tizen> 9 </since_tizen>
791 public VisualTransformPolicyType CornerRadiusPolicy
793 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
794 set => SetValue(CornerRadiusPolicyProperty, value);
798 /// The width for the borderline of the View.
802 /// Animatable - This property can be animated using <c>Animation</c> class.
804 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
807 /// Note that, an image background may not have borderline if it uses the Border property.
809 /// <since_tizen> 9 </since_tizen>
810 public float BorderlineWidth
814 return (float)GetValue(BorderlineWidthProperty);
818 SetValue(BorderlineWidthProperty, value);
819 NotifyPropertyChanged();
824 /// The color for the borderline of the View.
825 /// It is Color.Black by default.
829 /// Animatable - This property can be animated using <c>Animation</c> class.
831 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
835 /// <since_tizen> 9 </since_tizen>
836 public Color BorderlineColor
840 return (Color)GetValue(BorderlineColorProperty);
844 SetValue(BorderlineColorProperty, value);
845 NotifyPropertyChanged();
850 /// The color selector for the borderline of the View.
851 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
852 /// So this API is internally used only.
854 internal Selector<Color> BorderlineColorSelector
858 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
862 SetValue(BorderlineColorSelectorProperty, value);
863 NotifyPropertyChanged();
868 /// The Relative offset for the borderline of the View.
869 /// Recommended range : [-1.0f to 1.0f].
870 /// If -1.0f, draw borderline inside of the View.
871 /// If 1.0f, draw borderline outside of the View.
872 /// If 0.0f, draw borderline half inside and half outside.
873 /// It is 0.0f by default.
877 /// Animatable - This property can be animated using <c>Animation</c> class.
879 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
883 /// <since_tizen> 9 </since_tizen>
884 public float BorderlineOffset
888 return (float)GetValue(BorderlineOffsetProperty);
892 SetValue(BorderlineOffsetProperty, value);
893 NotifyPropertyChanged();
898 /// The current state of the view.
900 /// <since_tizen> 3 </since_tizen>
905 #if NUI_PROPERTY_CHANGE_DEBUG
908 return (States)GetValue(StateProperty);
912 #if NUI_PROPERTY_CHANGE_DEBUG
915 SetValue(StateProperty, value);
916 NotifyPropertyChanged();
921 /// The current sub state of the view.
923 /// <since_tizen> 3 </since_tizen>
924 public States SubState
928 #if NUI_PROPERTY_CHANGE_DEBUG
931 return (States)GetValue(SubStateProperty);
935 #if NUI_PROPERTY_CHANGE_DEBUG
938 SetValue(SubStateProperty, value);
939 NotifyPropertyChanged();
944 /// Displays a tooltip
946 /// <since_tizen> 3 </since_tizen>
947 public Tizen.NUI.PropertyMap Tooltip
951 return (PropertyMap)GetValue(TooltipProperty);
955 SetValue(TooltipProperty, value);
956 NotifyPropertyChanged();
961 /// Displays a tooltip as a text.
963 /// <since_tizen> 3 </since_tizen>
964 public string TooltipText
968 return GetValue(TooltipTextProperty) as string;
972 SetValue(TooltipTextProperty, value);
976 private string InternalTooltipText
980 using (var propertyValue = GetProperty(Property.TOOLTIP))
982 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
984 return retrivedValue;
986 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
987 return "error to get TooltipText";
992 var temp = new Tizen.NUI.PropertyValue(value);
993 SetProperty(View.Property.TOOLTIP, temp);
995 NotifyPropertyChanged();
1000 /// The Child property of FlexContainer.<br />
1001 /// The proportion of the free space in the container, the flex item will receive.<br />
1002 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
1004 /// <since_tizen> 3 </since_tizen>
1005 [Obsolete("Deprecated in API8, will be removed in API10.")]
1010 #if NUI_PROPERTY_CHANGE_DEBUG
1013 return (float)GetValue(FlexProperty);
1017 #if NUI_PROPERTY_CHANGE_DEBUG
1020 SetValue(FlexProperty, value);
1021 NotifyPropertyChanged();
1026 /// The Child property of FlexContainer.<br />
1027 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
1029 /// <since_tizen> 3 </since_tizen>
1030 [Obsolete("Deprecated in API8, will be removed in API10.")]
1031 public int AlignSelf
1035 #if NUI_PROPERTY_CHANGE_DEBUG
1038 return (int)GetValue(AlignSelfProperty);
1042 #if NUI_PROPERTY_CHANGE_DEBUG
1045 SetValue(AlignSelfProperty, value);
1046 NotifyPropertyChanged();
1051 /// The Child property of FlexContainer.<br />
1052 /// The space around the flex item.<br />
1055 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
1057 /// <since_tizen> 3 </since_tizen>
1058 [Obsolete("Deprecated in API8, will be removed in API10.")]
1059 public Vector4 FlexMargin
1063 #if NUI_PROPERTY_CHANGE_DEBUG
1066 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
1067 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
1071 #if NUI_PROPERTY_CHANGE_DEBUG
1074 SetValue(FlexMarginProperty, value);
1075 NotifyPropertyChanged();
1080 /// The top-left cell this child occupies, if not set, the first available cell is used.
1083 /// The property cascade chaining set is not recommended.
1084 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
1087 /// This way is recommended for setting the property
1089 /// var view = new View();
1090 /// view.CellIndex = new Vector2(1, 3);
1092 /// This way to set the property is prohibited
1094 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
1097 /// <since_tizen> 3 </since_tizen>
1098 public Vector2 CellIndex
1102 #if NUI_PROPERTY_CHANGE_DEBUG
1105 return (Vector2)GetValue(CellIndexProperty);
1109 #if NUI_PROPERTY_CHANGE_DEBUG
1112 SetValue(CellIndexProperty, value);
1113 NotifyPropertyChanged();
1118 /// The number of rows this child occupies, if not set, the default value is 1.
1121 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1123 /// <since_tizen> 3 </since_tizen>
1124 public float RowSpan
1128 #if NUI_PROPERTY_CHANGE_DEBUG
1131 return (float)GetValue(RowSpanProperty);
1135 #if NUI_PROPERTY_CHANGE_DEBUG
1138 SetValue(RowSpanProperty, value);
1139 NotifyPropertyChanged();
1144 /// The number of columns this child occupies, if not set, the default value is 1.
1147 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1149 /// <since_tizen> 3 </since_tizen>
1150 public float ColumnSpan
1154 #if NUI_PROPERTY_CHANGE_DEBUG
1157 return (float)GetValue(ColumnSpanProperty);
1161 #if NUI_PROPERTY_CHANGE_DEBUG
1164 SetValue(ColumnSpanProperty, value);
1165 NotifyPropertyChanged();
1170 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
1173 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1175 /// <since_tizen> 3 </since_tizen>
1176 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1180 #if NUI_PROPERTY_CHANGE_DEBUG
1181 CellHorizontalAlignmentGetter++;
1183 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1187 #if NUI_PROPERTY_CHANGE_DEBUG
1188 CellHorizontalAlignmentSetter++;
1190 SetValue(CellHorizontalAlignmentProperty, value);
1191 NotifyPropertyChanged();
1196 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1199 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1201 /// <since_tizen> 3 </since_tizen>
1202 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1206 #if NUI_PROPERTY_CHANGE_DEBUG
1207 CellVerticalAlignmentGetter++;
1209 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1213 #if NUI_PROPERTY_CHANGE_DEBUG
1214 CellVerticalAlignmentSetter++;
1216 SetValue(CellVerticalAlignmentProperty, value);
1217 NotifyPropertyChanged();
1222 /// The left focusable view.<br />
1223 /// This will return null if not set.<br />
1224 /// This will also return null if the specified left focusable view is not on a window.<br />
1226 /// <since_tizen> 3 </since_tizen>
1227 public View LeftFocusableView
1229 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1232 return (View)GetValue(LeftFocusableViewProperty);
1236 SetValue(LeftFocusableViewProperty, value);
1237 NotifyPropertyChanged();
1242 /// The right focusable view.<br />
1243 /// This will return null if not set.<br />
1244 /// This will also return null if the specified right focusable view is not on a window.<br />
1246 /// <since_tizen> 3 </since_tizen>
1247 public View RightFocusableView
1249 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1252 return (View)GetValue(RightFocusableViewProperty);
1256 SetValue(RightFocusableViewProperty, value);
1257 NotifyPropertyChanged();
1262 /// The up focusable view.<br />
1263 /// This will return null if not set.<br />
1264 /// This will also return null if the specified up focusable view is not on a window.<br />
1266 /// <since_tizen> 3 </since_tizen>
1267 public View UpFocusableView
1269 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1272 return (View)GetValue(UpFocusableViewProperty);
1276 SetValue(UpFocusableViewProperty, value);
1277 NotifyPropertyChanged();
1282 /// The down focusable view.<br />
1283 /// This will return null if not set.<br />
1284 /// This will also return null if the specified down focusable view is not on a window.<br />
1286 /// <since_tizen> 3 </since_tizen>
1287 public View DownFocusableView
1289 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1292 return (View)GetValue(DownFocusableViewProperty);
1296 SetValue(DownFocusableViewProperty, value);
1297 NotifyPropertyChanged();
1302 /// The clockwise focusable view by rotary wheel.<br />
1303 /// This will return null if not set.<br />
1304 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1306 [EditorBrowsable(EditorBrowsableState.Never)]
1307 public View ClockwiseFocusableView
1309 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1312 return (View)GetValue(ClockwiseFocusableViewProperty);
1316 SetValue(ClockwiseFocusableViewProperty, value);
1317 NotifyPropertyChanged();
1322 /// The counter clockwise focusable view by rotary wheel.<br />
1323 /// This will return null if not set.<br />
1324 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1326 [EditorBrowsable(EditorBrowsableState.Never)]
1327 public View CounterClockwiseFocusableView
1329 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1332 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1336 SetValue(CounterClockwiseFocusableViewProperty, value);
1337 NotifyPropertyChanged();
1342 /// Whether the view should be focusable by keyboard navigation.
1344 /// <since_tizen> 3 </since_tizen>
1345 public bool Focusable
1349 SetValue(FocusableProperty, value);
1350 NotifyPropertyChanged();
1354 return (bool)GetValue(FocusableProperty);
1359 /// 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.
1360 /// Note : Default value is true.
1362 [EditorBrowsable(EditorBrowsableState.Never)]
1363 public bool FocusableChildren
1367 SetValue(FocusableChildrenProperty, value);
1368 NotifyPropertyChanged();
1372 return (bool)GetValue(FocusableChildrenProperty);
1377 /// Whether this view can focus by touch.
1378 /// If Focusable is false, FocusableInTouch is disabled.
1379 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1381 [EditorBrowsable(EditorBrowsableState.Never)]
1382 public bool FocusableInTouch
1386 SetValue(FocusableInTouchProperty, value);
1387 NotifyPropertyChanged();
1391 return (bool)GetValue(FocusableInTouchProperty);
1396 /// Retrieves the position of the view.
1397 /// The coordinates are relative to the view's parent.
1400 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1401 /// 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).
1402 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1403 /// and users can get the current actual values through them.
1405 /// <since_tizen> 3 </since_tizen>
1406 public Position CurrentPosition
1410 return GetCurrentPosition();
1415 /// Sets the size of a view for the width and the height.<br />
1416 /// Geometry can be scaled to fit within this area.<br />
1417 /// This does not interfere with the view's scale factor.<br />
1418 /// The views default depth is the minimum of width and height.<br />
1421 /// The property cascade chaining set is not recommended.
1424 /// This way is recommended for setting the property
1426 /// var view = new View();
1427 /// view.Size2D = new Size2D(100, 200);
1429 /// This way to set the property is prohibited
1431 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1434 /// <since_tizen> 3 </since_tizen>
1435 public Size2D Size2D
1439 #if NUI_PROPERTY_CHANGE_DEBUG
1443 var temp = (Size2D)GetValue(Size2DProperty);
1445 if (this.Layout == null)
1447 if (temp.Width < 0) { temp.Width = 0; }
1448 if (temp.Height < 0) { temp.Height = 0; }
1455 #if NUI_PROPERTY_CHANGE_DEBUG
1459 SetValue(Size2DProperty, value);
1461 NotifyPropertyChanged();
1466 /// Retrieves the size of the view.
1467 /// The coordinates are relative to the view's parent.
1470 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1471 /// 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).
1472 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1473 /// and users can get the current actual values through them.
1475 /// <since_tizen> 3 </since_tizen>
1476 public Size2D CurrentSize
1480 return GetCurrentSize();
1485 /// Retrieves and sets the view's opacity.<br />
1489 /// Animatable - This property can be animated using <c>Animation</c> class.
1491 /// animation.AnimateTo(view, "Opacity", 0.5f);
1495 /// <since_tizen> 3 </since_tizen>
1496 public float Opacity
1500 #if NUI_PROPERTY_CHANGE_DEBUG
1503 return (float)GetValue(OpacityProperty);
1507 #if NUI_PROPERTY_CHANGE_DEBUG
1510 SetValue(OpacityProperty, value);
1511 NotifyPropertyChanged();
1516 /// Sets the position of the view for X and Y.<br />
1517 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1518 /// If the position inheritance is disabled, sets the world position.<br />
1521 /// The property cascade chaining set is not recommended.
1524 /// This way is recommended for setting the property
1526 /// var view = new View();
1527 /// view.Position2D = new Position2D(100, 200);
1529 /// This way to set the property is prohibited
1531 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1534 /// <since_tizen> 3 </since_tizen>
1535 public Position2D Position2D
1539 #if NUI_PROPERTY_CHANGE_DEBUG
1543 return (Position2D)GetValue(Position2DProperty);
1547 #if NUI_PROPERTY_CHANGE_DEBUG
1551 SetValue(Position2DProperty, value);
1552 NotifyPropertyChanged();
1557 /// Retrieves the screen position of the view.<br />
1559 /// <since_tizen> 3 </since_tizen>
1560 public Vector2 ScreenPosition
1564 Vector2 temp = new Vector2(0.0f, 0.0f);
1565 var pValue = GetProperty(View.Property.ScreenPosition);
1573 /// Determines whether the pivot point should be used to determine the position of the view.
1574 /// This is false by default.
1576 /// <remarks>If false, then the top-left of the view is used for the position.
1577 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1579 /// <since_tizen> 3 </since_tizen>
1580 public bool PositionUsesPivotPoint
1584 #if NUI_PROPERTY_CHANGE_DEBUG
1585 PositionUsesPivotPointGetter++;
1587 return (bool)GetValue(PositionUsesPivotPointProperty);
1591 #if NUI_PROPERTY_CHANGE_DEBUG
1592 PositionUsesPivotPointSetter++;
1594 SetValue(PositionUsesPivotPointProperty, value);
1595 NotifyPropertyChanged();
1600 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1602 /// <since_tizen> 3 </since_tizen>
1603 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1605 "View view = new View(); " +
1606 "view.PivotPoint = PivotPoint.Center; " +
1607 "view.PositionUsesPivotPoint = true;" +
1608 " This has been deprecated in API5 and will be removed in API8")]
1609 [EditorBrowsable(EditorBrowsableState.Never)]
1610 public bool PositionUsesAnchorPoint
1614 return (bool)GetValue(PositionUsesAnchorPointProperty);
1618 SetValue(PositionUsesAnchorPointProperty, value);
1622 private bool InternalPositionUsesAnchorPoint
1627 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1628 pValue.Get(out temp);
1634 var temp = new Tizen.NUI.PropertyValue(value);
1635 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1637 NotifyPropertyChanged();
1642 /// Queries whether the view is connected to the stage.<br />
1643 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1645 /// <since_tizen> 3 </since_tizen>
1646 public bool IsOnWindow
1655 /// Gets the depth in the hierarchy for the view.
1657 /// <since_tizen> 3 </since_tizen>
1658 public int HierarchyDepth
1662 return GetHierarchyDepth();
1667 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1670 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1671 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1672 /// The values set by this property will likely change.
1674 /// <since_tizen> 3 </since_tizen>
1675 public int SiblingOrder
1679 return (int)GetValue(SiblingOrderProperty);
1683 SetValue(SiblingOrderProperty, value);
1685 Layout?.ChangeLayoutSiblingOrder(value);
1687 NotifyPropertyChanged();
1692 /// Returns the natural size of the view.
1695 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1697 /// <since_tizen> 5 </since_tizen>
1698 public Vector3 NaturalSize
1702 Vector3 ret = GetNaturalSize();
1703 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1709 /// Returns the natural size (Size2D) of the view.
1712 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1714 /// <since_tizen> 4 </since_tizen>
1715 public Size2D NaturalSize2D
1719 Vector3 temp = GetNaturalSize();
1720 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1722 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1729 /// Gets or sets the origin of a view within its parent's area.<br />
1730 /// 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 />
1731 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1732 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1734 /// <pre>The view has been initialized.</pre>
1735 /// <since_tizen> 3 </since_tizen>
1736 public Position ParentOrigin
1740 #if NUI_PROPERTY_CHANGE_DEBUG
1741 ParentOriginGetter++;
1743 Position tmp = (Position)GetValue(ParentOriginProperty);
1744 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1748 #if NUI_PROPERTY_CHANGE_DEBUG
1749 ParentOriginSetter++;
1751 SetValue(ParentOriginProperty, value);
1752 NotifyPropertyChanged();
1757 /// Gets or sets the anchor-point of a view.<br />
1758 /// 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 />
1759 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1760 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1761 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1762 /// <pre>The view has been initialized.</pre>
1765 /// The property cascade chaining set is not recommended.
1768 /// This way is recommended for setting the property
1770 /// var view = new View();
1771 /// view.PivotPoint = PivotPoint.Center;
1773 /// This way to set the property is prohibited
1775 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1778 /// <since_tizen> 3 </since_tizen>
1779 public Position PivotPoint
1783 #if NUI_PROPERTY_CHANGE_DEBUG
1786 return (Position)GetValue(PivotPointProperty);
1790 #if NUI_PROPERTY_CHANGE_DEBUG
1793 SetValue(PivotPointProperty, value);
1794 NotifyPropertyChanged();
1799 /// Gets or sets the size width of the view.
1803 /// Animatable - This property can be animated using <c>Animation</c> class.
1805 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1809 /// <since_tizen> 3 </since_tizen>
1810 public float SizeWidth
1814 #if NUI_PROPERTY_CHANGE_DEBUG
1818 return (float)GetValue(SizeWidthProperty);
1822 #if NUI_PROPERTY_CHANGE_DEBUG
1826 SetValue(SizeWidthProperty, value);
1827 NotifyPropertyChanged();
1832 /// Gets or sets the size height of the view.
1836 /// Animatable - This property can be animated using <c>Animation</c> class.
1839 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1842 /// <since_tizen> 3 </since_tizen>
1843 public float SizeHeight
1847 #if NUI_PROPERTY_CHANGE_DEBUG
1851 return (float)GetValue(SizeHeightProperty);
1855 #if NUI_PROPERTY_CHANGE_DEBUG
1859 SetValue(SizeHeightProperty, value);
1860 NotifyPropertyChanged();
1865 /// Gets or sets the position of the view.<br />
1866 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1867 /// If the position inheritance is disabled, sets the world position.<br />
1871 /// Animatable - This property can be animated using <c>Animation</c> class.
1873 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1876 /// The property cascade chaining set is not recommended.
1879 /// This way is recommended for setting the property
1881 /// var view = new View();
1882 /// view.Position = new Position(100, 200.5f, 0);
1884 /// This way to set the property is prohibited
1886 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1889 /// <since_tizen> 3 </since_tizen>
1890 public Position Position
1894 #if NUI_PROPERTY_CHANGE_DEBUG
1898 return (Position)GetValue(PositionProperty);
1902 #if NUI_PROPERTY_CHANGE_DEBUG
1906 SetValue(PositionProperty, value);
1907 NotifyPropertyChanged();
1912 /// Gets or sets the position X of the view.
1916 /// Animatable - This property can be animated using <c>Animation</c> class.
1918 /// animation.AnimateTo(view, "PositionX", 50.0f);
1922 /// <since_tizen> 3 </since_tizen>
1923 public float PositionX
1927 #if NUI_PROPERTY_CHANGE_DEBUG
1930 return (float)GetValue(PositionXProperty);
1934 #if NUI_PROPERTY_CHANGE_DEBUG
1937 SetValue(PositionXProperty, value);
1938 NotifyPropertyChanged();
1943 /// Gets or sets the position Y of the view.
1947 /// Animatable - This property can be animated using <c>Animation</c> class.
1949 /// animation.AnimateTo(view, "PositionY", 50.0f);
1953 /// <since_tizen> 3 </since_tizen>
1954 public float PositionY
1958 #if NUI_PROPERTY_CHANGE_DEBUG
1961 return (float)GetValue(PositionYProperty);
1965 #if NUI_PROPERTY_CHANGE_DEBUG
1968 SetValue(PositionYProperty, value);
1969 NotifyPropertyChanged();
1974 /// Gets or sets the position Z of the view.
1978 /// Animatable - This property can be animated using <c>Animation</c> class.
1980 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1984 /// <since_tizen> 3 </since_tizen>
1985 public float PositionZ
1989 #if NUI_PROPERTY_CHANGE_DEBUG
1993 return (float)GetValue(PositionZProperty);
1997 #if NUI_PROPERTY_CHANGE_DEBUG
2001 SetValue(PositionZProperty, value);
2002 NotifyPropertyChanged();
2007 /// Gets or sets the world position of the view.
2009 /// <since_tizen> 3 </since_tizen>
2010 public Vector3 WorldPosition
2014 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
2015 var pValue = GetProperty(View.Property.WorldPosition);
2023 /// Gets or sets the orientation of the view.<br />
2024 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
2028 /// This is an asynchronous method.
2031 /// Animatable - This property can be animated using <c>Animation</c> class.
2033 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
2037 /// <since_tizen> 3 </since_tizen>
2038 public Rotation Orientation
2042 #if NUI_PROPERTY_CHANGE_DEBUG
2043 OrientationGetter++;
2045 return (Rotation)GetValue(OrientationProperty);
2049 #if NUI_PROPERTY_CHANGE_DEBUG
2050 OrientationSetter++;
2052 SetValue(OrientationProperty, value);
2053 NotifyPropertyChanged();
2058 /// Gets or sets the world orientation of the view.<br />
2060 /// <since_tizen> 3 </since_tizen>
2061 public Rotation WorldOrientation
2065 Rotation temp = new Rotation();
2066 var pValue = GetProperty(View.Property.WorldOrientation);
2074 /// Gets or sets the scale factor applied to the view.<br />
2078 /// Animatable - This property can be animated using <c>Animation</c> class.
2080 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
2083 /// The property cascade chaining set is not recommended.
2086 /// This way is recommended for setting the property
2088 /// var view = new View();
2089 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
2091 /// This way to set the property is prohibited
2093 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
2096 /// <since_tizen> 3 </since_tizen>
2097 public Vector3 Scale
2101 #if NUI_PROPERTY_CHANGE_DEBUG
2104 return (Vector3)GetValue(ScaleProperty);
2108 #if NUI_PROPERTY_CHANGE_DEBUG
2111 SetValue(ScaleProperty, value);
2112 NotifyPropertyChanged();
2117 /// Gets or sets the scale X factor applied to the view.
2121 /// Animatable - This property can be animated using <c>Animation</c> class.
2123 /// animation.AnimateTo(view, "ScaleX", 1.5f);
2127 /// <since_tizen> 3 </since_tizen>
2132 #if NUI_PROPERTY_CHANGE_DEBUG
2135 return (float)GetValue(ScaleXProperty);
2139 #if NUI_PROPERTY_CHANGE_DEBUG
2142 SetValue(ScaleXProperty, value);
2143 NotifyPropertyChanged();
2148 /// Gets or sets the scale Y factor applied to the view.
2152 /// Animatable - This property can be animated using <c>Animation</c> class.
2154 /// animation.AnimateTo(view, "ScaleY", 1.5f);
2158 /// <since_tizen> 3 </since_tizen>
2163 #if NUI_PROPERTY_CHANGE_DEBUG
2166 return (float)GetValue(ScaleYProperty);
2170 #if NUI_PROPERTY_CHANGE_DEBUG
2173 SetValue(ScaleYProperty, value);
2174 NotifyPropertyChanged();
2179 /// Gets or sets the scale Z factor applied to the view.
2183 /// Animatable - This property can be animated using <c>Animation</c> class.
2185 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
2189 /// <since_tizen> 3 </since_tizen>
2194 #if NUI_PROPERTY_CHANGE_DEBUG
2197 return (float)GetValue(ScaleZProperty);
2201 #if NUI_PROPERTY_CHANGE_DEBUG
2204 SetValue(ScaleZProperty, value);
2205 NotifyPropertyChanged();
2210 /// Gets the world scale of the view.
2212 /// <since_tizen> 3 </since_tizen>
2213 public Vector3 WorldScale
2217 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
2218 var pValue = GetProperty(View.Property.WorldScale);
2226 /// Retrieves the visibility flag of the view.
2230 /// If the view is not visible, then the view and its children will not be rendered.
2231 /// 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.
2234 /// Animatable - This property can be animated using <c>Animation</c> class.
2236 /// animation.AnimateTo(view, "Visibility", false);
2240 /// <since_tizen> 3 </since_tizen>
2241 public bool Visibility
2246 var pValue = GetProperty(View.Property.VISIBLE);
2247 pValue.Get(out temp);
2254 /// Gets the view's world color.
2256 /// <since_tizen> 3 </since_tizen>
2257 public Vector4 WorldColor
2261 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
2262 var pValue = GetProperty(View.Property.WorldColor);
2270 /// Gets or sets the view's name.
2272 /// <since_tizen> 3 </since_tizen>
2277 #if NUI_PROPERTY_CHANGE_DEBUG
2280 return (string)GetValue(NameProperty);
2284 #if NUI_PROPERTY_CHANGE_DEBUG
2287 SetValue(NameProperty, value);
2288 NotifyPropertyChanged();
2293 /// Get the number of children held by the view.
2295 /// <since_tizen> 3 </since_tizen>
2296 public new uint ChildCount
2300 return Convert.ToUInt32(Children.Count);
2305 /// Gets the view's ID.
2308 /// <since_tizen> 3 </since_tizen>
2318 /// Gets or sets the status of whether the view should emit touch or hover signals.
2319 /// If a View is made insensitive, then the View and its children are not hittable.
2321 /// <since_tizen> 3 </since_tizen>
2322 public bool Sensitive
2326 #if NUI_PROPERTY_CHANGE_DEBUG
2329 return (bool)GetValue(SensitiveProperty);
2333 #if NUI_PROPERTY_CHANGE_DEBUG
2336 SetValue(SensitiveProperty, value);
2337 NotifyPropertyChanged();
2342 /// Gets or sets the status of whether the view should be enabled user interactions.
2343 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2345 /// <since_tizen> tizen_next </since_tizen>
2346 [EditorBrowsable(EditorBrowsableState.Never)]
2347 public bool IsEnabled
2351 #if NUI_PROPERTY_CHANGE_DEBUG
2354 return (bool)GetValue(IsEnabledProperty);
2358 #if NUI_PROPERTY_CHANGE_DEBUG
2361 SetValue(IsEnabledProperty, value);
2362 NotifyPropertyChanged();
2367 /// 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.
2369 /// <since_tizen> 3 </since_tizen>
2370 public bool LeaveRequired
2374 #if NUI_PROPERTY_CHANGE_DEBUG
2375 LeaveRequiredGetter++;
2377 return (bool)GetValue(LeaveRequiredProperty);
2381 #if NUI_PROPERTY_CHANGE_DEBUG
2382 LeaveRequiredSetter++;
2384 SetValue(LeaveRequiredProperty, value);
2385 NotifyPropertyChanged();
2390 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2392 /// <since_tizen> 3 </since_tizen>
2393 public bool InheritOrientation
2397 return (bool)GetValue(InheritOrientationProperty);
2401 SetValue(InheritOrientationProperty, value);
2402 NotifyPropertyChanged();
2407 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2409 /// <since_tizen> 3 </since_tizen>
2410 public bool InheritScale
2414 #if NUI_PROPERTY_CHANGE_DEBUG
2415 InheritScaleGetter++;
2417 return (bool)GetValue(InheritScaleProperty);
2421 #if NUI_PROPERTY_CHANGE_DEBUG
2422 InheritScaleSetter++;
2424 SetValue(InheritScaleProperty, value);
2425 NotifyPropertyChanged();
2430 /// Gets or sets the status of how the view and its children should be drawn.<br />
2431 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2432 /// 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 />
2433 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2434 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2435 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2437 /// <since_tizen> 3 </since_tizen>
2438 public DrawModeType DrawMode
2442 #if NUI_PROPERTY_CHANGE_DEBUG
2445 return (DrawModeType)GetValue(DrawModeProperty);
2449 #if NUI_PROPERTY_CHANGE_DEBUG
2452 SetValue(DrawModeProperty, value);
2453 NotifyPropertyChanged();
2458 /// Gets or sets the relative to parent size factor of the view.<br />
2459 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2460 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2463 /// The property cascade chaining set is not recommended.
2466 /// This way is recommended for setting the property
2468 /// var text = new TextField();
2469 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2471 /// This way to set the property is prohibited
2473 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2476 /// <since_tizen> 3 </since_tizen>
2477 public Vector3 SizeModeFactor
2481 #if NUI_PROPERTY_CHANGE_DEBUG
2482 SizeModeFactorGetter++;
2484 return (Vector3)GetValue(SizeModeFactorProperty);
2488 #if NUI_PROPERTY_CHANGE_DEBUG
2489 SizeModeFactorSetter++;
2491 SetValue(SizeModeFactorProperty, value);
2492 NotifyPropertyChanged();
2497 /// Gets or sets the width resize policy to be used.
2499 /// <since_tizen> 3 </since_tizen>
2500 public ResizePolicyType WidthResizePolicy
2504 #if NUI_PROPERTY_CHANGE_DEBUG
2505 WidthResizePolicyGetter++;
2507 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2511 #if NUI_PROPERTY_CHANGE_DEBUG
2512 WidthResizePolicySetter++;
2514 SetValue(WidthResizePolicyProperty, value);
2515 NotifyPropertyChanged();
2520 /// Gets or sets the height resize policy to be used.
2522 /// <since_tizen> 3 </since_tizen>
2523 public ResizePolicyType HeightResizePolicy
2527 #if NUI_PROPERTY_CHANGE_DEBUG
2528 HeightResizePolicyGetter++;
2530 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2534 #if NUI_PROPERTY_CHANGE_DEBUG
2535 HeightResizePolicySetter++;
2537 SetValue(HeightResizePolicyProperty, value);
2538 NotifyPropertyChanged();
2543 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2544 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2546 /// <since_tizen> 3 </since_tizen>
2547 public SizeScalePolicyType SizeScalePolicy
2551 #if NUI_PROPERTY_CHANGE_DEBUG
2552 SizeScalePolicyGetter++;
2554 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2558 #if NUI_PROPERTY_CHANGE_DEBUG
2559 SizeScalePolicySetter++;
2561 SetValue(SizeScalePolicyProperty, value);
2562 NotifyPropertyChanged();
2567 /// Gets or sets the status of whether the width size is dependent on the height size.
2569 /// <since_tizen> 3 </since_tizen>
2570 public bool WidthForHeight
2574 #if NUI_PROPERTY_CHANGE_DEBUG
2575 WidthForHeightGetter++;
2577 return (bool)GetValue(WidthForHeightProperty);
2581 #if NUI_PROPERTY_CHANGE_DEBUG
2582 WidthForHeightSetter++;
2584 SetValue(WidthForHeightProperty, value);
2585 NotifyPropertyChanged();
2590 /// Gets or sets the status of whether the height size is dependent on the width size.
2592 /// <since_tizen> 3 </since_tizen>
2593 public bool HeightForWidth
2597 #if NUI_PROPERTY_CHANGE_DEBUG
2598 HeightForWidthGetter++;
2600 return (bool)GetValue(HeightForWidthProperty);
2604 #if NUI_PROPERTY_CHANGE_DEBUG
2605 HeightForWidthSetter++;
2607 SetValue(HeightForWidthProperty, value);
2608 NotifyPropertyChanged();
2613 /// Gets or sets the padding for use in layout.
2616 /// The property cascade chaining set is not recommended.
2619 /// This way is recommended for setting the property
2621 /// var view = new View();
2622 /// view.Padding = new Extents(5, 5, 5, 5);
2624 /// This way to set the property is prohibited
2626 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2629 /// <since_tizen> 5 </since_tizen>
2630 public Extents Padding
2634 return (Extents)GetValue(PaddingProperty);
2638 SetValue(PaddingProperty, value);
2639 NotifyPropertyChanged();
2644 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2646 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2648 /// The property cascade chaining set is not recommended.
2651 /// This way is recommended for setting the property
2653 /// var view = new View();
2654 /// view.MinimumSize = new Size2D(100, 200);
2656 /// This way to set the property is prohibited
2658 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2661 /// <since_tizen> 3 </since_tizen>
2662 public Size2D MinimumSize
2666 #if NUI_PROPERTY_CHANGE_DEBUG
2667 MinimumSizeGetter++;
2669 return (Size2D)GetValue(MinimumSizeProperty);
2673 #if NUI_PROPERTY_CHANGE_DEBUG
2674 MinimumSizeSetter++;
2678 throw new ArgumentNullException(nameof(value));
2682 // Note: it only works if minimum size is >= than natural size.
2683 // To force the size it should be done through the width&height spec or Size2D.
2684 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2685 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2686 layout.RequestLayout();
2688 SetValue(MinimumSizeProperty, value);
2689 NotifyPropertyChanged();
2694 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2697 /// This way is recommended for setting the property
2699 /// var view = new View();
2700 /// view.MaximumSize = new Size2D(100, 200);
2702 /// This way to set the property is prohibited
2704 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2707 /// <since_tizen> 3 </since_tizen>
2708 public Size2D MaximumSize
2712 #if NUI_PROPERTY_CHANGE_DEBUG
2713 MaximumSizeGetter++;
2715 return (Size2D)GetValue(MaximumSizeProperty);
2719 #if NUI_PROPERTY_CHANGE_DEBUG
2720 MaximumSizeSetter++;
2722 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2723 // MATCH_PARENT spec + parent container size can be used to limit
2726 layout.RequestLayout();
2728 SetValue(MaximumSizeProperty, value);
2729 NotifyPropertyChanged();
2734 /// Gets or sets whether a child view inherits it's parent's position.<br />
2735 /// Default is to inherit.<br />
2736 /// 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 />
2738 /// <since_tizen> 3 </since_tizen>
2739 public bool InheritPosition
2743 #if NUI_PROPERTY_CHANGE_DEBUG
2744 InheritPositionGetter++;
2746 return (bool)GetValue(InheritPositionProperty);
2750 #if NUI_PROPERTY_CHANGE_DEBUG
2751 InheritPositionSetter++;
2753 SetValue(InheritPositionProperty, value);
2754 NotifyPropertyChanged();
2759 /// Gets or sets the clipping behavior (mode) of it's children.
2761 /// <since_tizen> 3 </since_tizen>
2762 public ClippingModeType ClippingMode
2766 #if NUI_PROPERTY_CHANGE_DEBUG
2767 ClippingModeGetter++;
2769 return (ClippingModeType)GetValue(ClippingModeProperty);
2773 #if NUI_PROPERTY_CHANGE_DEBUG
2774 ClippingModeSetter++;
2776 SetValue(ClippingModeProperty, value);
2777 NotifyPropertyChanged();
2782 /// Gets the number of renderers held by the view.
2784 /// <since_tizen> 3 </since_tizen>
2785 public uint RendererCount
2789 return GetRendererCount();
2794 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2797 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2799 /// <since_tizen> 3 </since_tizen>
2800 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2802 "View view = new View(); " +
2803 "view.PivotPoint = PivotPoint.Center; " +
2804 "view.PositionUsesPivotPoint = true;")]
2805 [EditorBrowsable(EditorBrowsableState.Never)]
2806 public Position AnchorPoint
2810 return GetValue(AnchorPointProperty) as Position;
2814 SetValue(AnchorPointProperty, value);
2818 private Position InternalAnchorPoint
2822 Position temp = new Position(0.0f, 0.0f, 0.0f);
2823 var pValue = GetProperty(View.Property.AnchorPoint);
2826 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2832 var temp = new Tizen.NUI.PropertyValue(value);
2833 SetProperty(View.Property.AnchorPoint, temp);
2835 NotifyPropertyChanged();
2840 /// Sets the size of a view for the width, the height and the depth.<br />
2841 /// Geometry can be scaled to fit within this area.<br />
2842 /// This does not interfere with the view's scale factor.<br />
2843 /// The views default depth is the minimum of width and height.<br />
2847 /// Animatable - This property can be animated using <c>Animation</c> class.
2849 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2852 /// The property cascade chaining set is not recommended.
2855 /// This way is recommended for setting the property
2857 /// var view = new View();
2858 /// view.Size = new Size(100.5f, 200, 0);
2860 /// This way to set the property is prohibited
2862 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2865 /// <since_tizen> 5 </since_tizen>
2870 #if NUI_PROPERTY_CHANGE_DEBUG
2873 return (Size)GetValue(SizeProperty);
2877 #if NUI_PROPERTY_CHANGE_DEBUG
2880 SetValue(SizeProperty, value);
2881 NotifyPropertyChanged();
2886 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2888 /// <since_tizen> 3 </since_tizen>
2889 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2891 "Container parent = view.GetParent(); " +
2892 "View view = parent as View;")]
2893 [EditorBrowsable(EditorBrowsableState.Never)]
2894 public new View Parent
2899 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2900 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2901 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2903 if (basehandle is Layer layer)
2905 ret = new View(Layer.getCPtr(layer).Handle, false);
2906 NUILog.Error("This Parent property is deprecated, should do not be used");
2910 ret = basehandle as View;
2913 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2914 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2916 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2922 /// Gets/Sets whether inherit parent's the layout Direction.
2924 /// <since_tizen> 4 </since_tizen>
2925 public bool InheritLayoutDirection
2929 #if NUI_PROPERTY_CHANGE_DEBUG
2930 InheritLayoutDirectionGetter++;
2932 return (bool)GetValue(InheritLayoutDirectionProperty);
2936 #if NUI_PROPERTY_CHANGE_DEBUG
2937 InheritLayoutDirectionSetter++;
2939 SetValue(InheritLayoutDirectionProperty, value);
2940 NotifyPropertyChanged();
2945 /// Gets/Sets the layout Direction.
2947 /// <since_tizen> 4 </since_tizen>
2948 public ViewLayoutDirectionType LayoutDirection
2952 #if NUI_PROPERTY_CHANGE_DEBUG
2953 LayoutDirectionGetter++;
2955 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2959 #if NUI_PROPERTY_CHANGE_DEBUG
2960 LayoutDirectionSetter++;
2962 SetValue(LayoutDirectionProperty, value);
2963 NotifyPropertyChanged();
2964 layout?.RequestLayout();
2969 /// Gets or sets the Margin for use in layout.
2972 /// Margin property is supported by Layout algorithms and containers.
2973 /// Please Set Layout if you want to use Margin property.
2974 /// The property cascade chaining set is not recommended.
2977 /// This way is recommended for setting the property
2979 /// var view = new View();
2980 /// view.Margin = new Extents(10, 5, 15, 20);
2982 /// This way to set the property is prohibited
2984 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2987 /// <since_tizen> 4 </since_tizen>
2988 public Extents Margin
2992 return (Extents)GetValue(MarginProperty);
2996 SetValue(MarginProperty, value);
2997 NotifyPropertyChanged();
3002 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
3006 /// // matchParentView matches its size to its parent size.
3007 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
3008 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
3010 /// // wrapContentView wraps its children with their desired size.
3011 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
3012 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
3014 /// // exactSizeView shows itself with an exact size.
3015 /// exactSizeView.WidthSpecification = 100;
3016 /// exactSizeView.HeightSpecification = 100;
3019 /// <since_tizen> 6 </since_tizen>
3020 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
3021 public int WidthSpecification
3025 return (int)GetValue(WidthSpecificationProperty);
3029 SetValue(WidthSpecificationProperty, value);
3030 NotifyPropertyChanged();
3034 private int InternalWidthSpecification
3042 if (value == widthPolicy)
3045 widthPolicy = value;
3046 if (widthPolicy >= 0)
3048 if (heightPolicy >= 0) // Policy an exact value
3050 // Create Size2D only both _widthPolicy and _heightPolicy are set.
3051 Size2D = new Size2D(widthPolicy, heightPolicy);
3054 layout?.RequestLayout();
3059 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
3063 /// // matchParentView matches its size to its parent size.
3064 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
3065 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
3067 /// // wrapContentView wraps its children with their desired size.
3068 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
3069 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
3071 /// // exactSizeView shows itself with an exact size.
3072 /// exactSizeView.WidthSpecification = 100;
3073 /// exactSizeView.HeightSpecification = 100;
3076 /// <since_tizen> 6 </since_tizen>
3077 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
3078 public int HeightSpecification
3082 return (int)GetValue(HeightSpecificationProperty);
3086 SetValue(HeightSpecificationProperty, value);
3087 NotifyPropertyChanged();
3091 private int InternalHeightSpecification
3095 return heightPolicy;
3099 if (value == heightPolicy)
3102 heightPolicy = value;
3103 if (heightPolicy >= 0)
3105 if (widthPolicy >= 0) // Policy an exact value
3107 // Create Size2D only both _widthPolicy and _heightPolicy are set.
3108 Size2D = new Size2D(widthPolicy, heightPolicy);
3111 layout?.RequestLayout();
3116 /// Gets the List of transitions for this View.
3118 /// <since_tizen> 6 </since_tizen>
3119 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
3123 if (layoutTransitions == null)
3125 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
3127 return layoutTransitions;
3132 /// Sets a layout transitions for this View.
3134 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
3136 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
3138 /// <since_tizen> 6 </since_tizen>
3139 public LayoutTransition LayoutTransition
3143 return GetValue(LayoutTransitionProperty) as LayoutTransition;
3147 SetValue(LayoutTransitionProperty, value);
3148 NotifyPropertyChanged();
3152 private LayoutTransition InternalLayoutTransition
3156 return layoutTransition;
3162 throw new global::System.ArgumentNullException(nameof(value));
3164 if (layoutTransitions == null)
3166 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
3169 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
3171 AttachTransitionsToChildren(value);
3173 layoutTransition = value;
3178 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
3181 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
3183 /// <since_tizen> 4 </since_tizen>
3184 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
3185 [EditorBrowsable(EditorBrowsableState.Never)]
3186 public Extents PaddingEX
3190 return GetValue(PaddingEXProperty) as Extents;
3194 SetValue(PaddingEXProperty, value);
3198 private Extents InternalPaddingEX
3202 Extents temp = new Extents(0, 0, 0, 0);
3203 var pValue = GetProperty(View.Property.PADDING);
3206 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
3212 var temp = new Tizen.NUI.PropertyValue(value);
3213 SetProperty(View.Property.PADDING, temp);
3215 NotifyPropertyChanged();
3216 layout?.RequestLayout();
3221 /// The Color of View. This is an RGBA value.
3222 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
3223 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
3224 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
3225 /// Inherient of color value depend on <see cref="ColorMode"/>.
3229 /// Animatable - This property can be animated using <c>Animation</c> class.
3231 /// The property cascade chaining set is not recommended.
3234 /// This way is recommended for setting the property
3236 /// var view = new View();
3237 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
3239 /// This way to set the property is prohibited
3241 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
3244 [EditorBrowsable(EditorBrowsableState.Never)]
3249 #if NUI_PROPERTY_CHANGE_DEBUG
3252 return (Color)GetValue(ColorProperty);
3256 #if NUI_PROPERTY_CHANGE_DEBUG
3259 SetValue(ColorProperty, value);
3260 NotifyPropertyChanged();
3265 /// The Red component of View.Color.
3269 /// Animatable - This property can be animated using <c>Animation</c> class.
3272 [EditorBrowsable(EditorBrowsableState.Never)]
3273 public float ColorRed
3277 #if NUI_PROPERTY_CHANGE_DEBUG
3280 return (float)GetValue(ColorRedProperty);
3284 #if NUI_PROPERTY_CHANGE_DEBUG
3287 SetValue(ColorRedProperty, value);
3288 NotifyPropertyChanged();
3293 /// The Green component of View.Color.
3297 /// Animatable - This property can be animated using <c>Animation</c> class.
3300 [EditorBrowsable(EditorBrowsableState.Never)]
3301 public float ColorGreen
3305 #if NUI_PROPERTY_CHANGE_DEBUG
3308 return (float)GetValue(ColorGreenProperty);
3312 #if NUI_PROPERTY_CHANGE_DEBUG
3315 SetValue(ColorGreenProperty, value);
3316 NotifyPropertyChanged();
3321 /// The Blue component of View.Color.
3325 /// Animatable - This property can be animated using <c>Animation</c> class.
3328 [EditorBrowsable(EditorBrowsableState.Never)]
3329 public float ColorBlue
3333 #if NUI_PROPERTY_CHANGE_DEBUG
3336 return (float)GetValue(ColorBlueProperty);
3340 #if NUI_PROPERTY_CHANGE_DEBUG
3343 SetValue(ColorBlueProperty, value);
3344 NotifyPropertyChanged();
3349 /// Set the layout on this View. Replaces any existing Layout.
3352 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
3354 /// <since_tizen> 6 </since_tizen>
3355 public LayoutItem Layout
3359 return GetValue(LayoutProperty) as LayoutItem;
3363 SetValue(LayoutProperty, value);
3367 private LayoutItem InternalLayout
3375 // Do nothing if layout provided is already set on this View.
3376 if (value == layout)
3381 LayoutingDisabled = false;
3384 // If new layout being set already has a owner then that owner receives a replacement default layout.
3385 // First check if the layout to be set already has a owner.
3386 if (value?.Owner != null)
3388 // Previous owner of the layout gets a default layout as a replacement.
3389 value.Owner.Layout = new AbsoluteLayout()
3391 // Copy Margin and Padding to replacement LayoutGroup.
3392 Margin = value.Margin,
3393 Padding = value.Padding,
3397 // Copy Margin and Padding to new layout being set or restore padding and margin back to
3398 // View if no replacement. Previously margin and padding values would have been moved from
3399 // the View to the layout.
3400 if (layout != null) // Existing layout
3404 // Existing layout being replaced so copy over margin and padding values.
3405 value.Margin = layout.Margin;
3406 value.Padding = layout.Padding;
3407 value.SetPositionByLayout = !excludeLayouting;
3411 // Layout not being replaced so restore margin and padding to View.
3412 SetValue(MarginProperty, layout.Margin);
3413 SetValue(PaddingProperty, layout.Padding);
3414 NotifyPropertyChanged();
3419 // First Layout to be added to the View hence copy
3421 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
3424 Extents margin = Margin;
3425 Extents padding = Padding;
3426 bool setMargin = false;
3427 bool setPadding = false;
3429 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
3431 // If View already has a margin set then store it in Layout instead.
3432 value.Margin = margin;
3433 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
3437 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
3439 // If View already has a padding set then store it in Layout instead.
3440 value.Padding = padding;
3441 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
3445 if (setMargin || setPadding)
3447 NotifyPropertyChanged();
3450 value.SetPositionByLayout = !excludeLayouting;
3454 // Remove existing layout from it's parent layout group.
3457 // Set layout to this view
3463 /// The weight of the View, used to share available space in a layout with siblings.
3465 /// <since_tizen> 6 </since_tizen>
3475 layout?.RequestLayout();
3480 /// Whether to load the BackgroundImage synchronously.
3481 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3482 /// Note: For Normal Quad images only.
3484 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3485 [EditorBrowsable(EditorBrowsableState.Never)]
3486 public bool BackgroundImageSynchronosLoading
3490 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3494 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3495 NotifyPropertyChanged();
3499 private bool InternalBackgroundImageSynchronosLoading
3503 return BackgroundImageSynchronousLoading;
3507 BackgroundImageSynchronousLoading = value;
3512 /// Whether to load the BackgroundImage synchronously.
3513 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3514 /// Note: For Normal Quad images only.
3516 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3517 [EditorBrowsable(EditorBrowsableState.Never)]
3518 public bool BackgroundImageSynchronousLoading
3522 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3526 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3527 NotifyPropertyChanged();
3531 private bool InternalBackgroundImageSynchronousLoading
3535 return backgroundImageSynchronousLoading;
3539 backgroundImageSynchronousLoading = value;
3541 string bgUrl = null;
3542 var pValue = Background.Find(ImageVisualProperty.URL);
3543 pValue?.Get(out bgUrl);
3546 if (!string.IsNullOrEmpty(bgUrl))
3548 PropertyMap bgMap = this.Background;
3549 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3550 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3557 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3558 [EditorBrowsable(EditorBrowsableState.Never)]
3559 public Vector4 UpdateAreaHint
3563 #if NUI_PROPERTY_CHANGE_DEBUG
3564 UpdateAreaHintGetter++;
3566 return (Vector4)GetValue(UpdateAreaHintProperty);
3570 #if NUI_PROPERTY_CHANGE_DEBUG
3571 UpdateAreaHintSetter++;
3573 SetValue(UpdateAreaHintProperty, value);
3574 NotifyPropertyChanged();
3579 /// Enable/Disable ControlState propagation for children.
3580 /// It is false by default.
3581 /// If the View needs to share ControlState with descendants, please set it true.
3582 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3584 [EditorBrowsable(EditorBrowsableState.Never)]
3585 public bool EnableControlStatePropagation
3589 return (bool)GetValue(EnableControlStatePropagationProperty);
3593 SetValue(EnableControlStatePropagationProperty, value);
3594 NotifyPropertyChanged();
3598 private bool InternalEnableControlStatePropagation
3600 get => themeData?.ControlStatePropagation ?? false;
3603 if (InternalEnableControlStatePropagation == value) return;
3605 if (themeData == null) themeData = new ThemeData();
3607 themeData.ControlStatePropagation = value;
3609 foreach (View child in Children)
3611 child.EnableControlStatePropagation = value;
3617 /// The ControlStates can propagate from the parent.
3618 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3619 /// if parent view EnableControlState is true.
3620 /// <see cref="EnableControlState"/>.
3621 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3623 [EditorBrowsable(EditorBrowsableState.Never)]
3624 public ControlState PropagatableControlStates
3628 return (ControlState)GetValue(PropagatableControlStatesProperty);
3632 SetValue(PropagatableControlStatesProperty, value);
3633 NotifyPropertyChanged();
3637 private ControlState InternalPropagatableControlStates
3639 get => propagatableControlStates;
3640 set => propagatableControlStates = value;
3644 /// By default, it is false in View, true in Control.
3645 /// Note that if the value is true, the View will be a touch receptor.
3647 [EditorBrowsable(EditorBrowsableState.Never)]
3648 public bool EnableControlState
3652 return (bool)GetValue(EnableControlStateProperty);
3656 SetValue(EnableControlStateProperty, value);
3661 /// Whether the actor grab all touches even if touch leaves its boundary.
3663 /// <returns>true, if it grab all touch after start</returns>
3664 [EditorBrowsable(EditorBrowsableState.Never)]
3665 public bool GrabTouchAfterLeave
3669 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3673 SetValue(GrabTouchAfterLeaveProperty, value);
3677 private bool InternalGrabTouchAfterLeave
3682 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
3683 pValue.Get(out temp);
3689 var temp = new Tizen.NUI.PropertyValue(value);
3690 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
3692 NotifyPropertyChanged();
3697 /// Whether the view will only receive own touch.
3699 /// <returns>true, if it only receives touches that started from itself.</returns>
3700 [EditorBrowsable(EditorBrowsableState.Never)]
3701 public bool AllowOnlyOwnTouch
3705 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3709 SetValue(AllowOnlyOwnTouchProperty, value);
3713 private bool InternalAllowOnlyOwnTouch
3718 var pValue = GetProperty(View.Property.AllowOnlyOwnTouch);
3719 pValue.Get(out temp);
3725 var temp = new Tizen.NUI.PropertyValue(value);
3726 SetProperty(View.Property.AllowOnlyOwnTouch, temp);
3728 NotifyPropertyChanged();
3733 /// Determines which blend equation will be used to render renderers of this actor.
3735 /// <returns>blend equation enum currently assigned</returns>
3736 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3737 [EditorBrowsable(EditorBrowsableState.Never)]
3738 public BlendEquationType BlendEquation
3742 return (BlendEquationType)GetValue(BlendEquationProperty);
3746 SetValue(BlendEquationProperty, value);
3750 private BlendEquationType InternalBlendEquation
3755 var pValue = GetProperty(View.Property.BlendEquation);
3756 pValue.Get(out temp);
3758 return (BlendEquationType)temp;
3762 var temp = new Tizen.NUI.PropertyValue((int)value);
3763 SetProperty(View.Property.BlendEquation, temp);
3765 NotifyPropertyChanged();
3770 /// If the value is true, the View will change its style as the theme changes.
3771 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3773 /// <since_tizen> 9 </since_tizen>
3774 public bool ThemeChangeSensitive
3776 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3777 set => SetValue(ThemeChangeSensitiveProperty, value);
3781 /// Create Style, it is abstract function and must be override.
3783 [EditorBrowsable(EditorBrowsableState.Never)]
3784 protected virtual ViewStyle CreateViewStyle()
3786 return new ViewStyle();
3790 /// Called after the View's ControlStates changed.
3792 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3793 [EditorBrowsable(EditorBrowsableState.Never)]
3794 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3800 [EditorBrowsable(EditorBrowsableState.Never)]
3801 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3803 isThemeChanged = true;
3804 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3805 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3806 isThemeChanged = false;
3810 /// Apply style instance to the view.
3811 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3813 /// <since_tizen> 9 </since_tizen>
3814 public virtual void ApplyStyle(ViewStyle viewStyle)
3816 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3818 if (themeData == null) themeData = new ThemeData();
3820 themeData.viewStyle = viewStyle;
3822 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3828 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3830 if (bindablePropertyOfView == null)
3835 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3836 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3838 foreach (var sourceProperty in dirtyStyleProperties)
3840 var sourceValue = viewStyle.GetValue(sourceProperty);
3842 if (sourceValue == null)
3847 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3849 // Do not set value again when theme is changed and the value has been set already.
3850 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3855 if (destinationProperty != null)
3857 InternalSetValue(destinationProperty, sourceValue);
3863 /// Get whether the View is culled or not.
3864 /// True means that the View is out of the view frustum.
3867 /// Hidden-API (Inhouse-API).
3869 [EditorBrowsable(EditorBrowsableState.Never)]
3875 var pValue = GetProperty(View.Property.Culled);
3876 pValue.Get(out temp);
3883 /// Set or Get TransitionOptions for the page transition.
3884 /// This property is used to define how this view will be transitioned during Page switching.
3886 /// <since_tizen> 9 </since_tizen>
3887 public TransitionOptions TransitionOptions
3891 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3895 SetValue(TransitionOptionsProperty, value);
3896 NotifyPropertyChanged();
3900 private TransitionOptions InternalTransitionOptions
3904 transitionOptions = value;
3908 return transitionOptions;
3913 /// Gets or sets the status of whether the view should emit key event signals.
3914 /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
3916 [EditorBrowsable(EditorBrowsableState.Never)]
3917 public bool DispatchKeyEvents
3921 #if NUI_PROPERTY_CHANGE_DEBUG
3922 DispatchKeyEventsGetter++;
3924 return (bool)GetValue(DispatchKeyEventsProperty);
3928 #if NUI_PROPERTY_CHANGE_DEBUG
3929 DispatchKeyEventsSetter++;
3931 SetValue(DispatchKeyEventsProperty, value);
3932 NotifyPropertyChanged();
3937 /// Gets or sets the status of whether touch events can be dispatched.
3938 /// 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.
3939 /// This works without adding a TouchEvent callback in the View.
3941 /// 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.
3944 [EditorBrowsable(EditorBrowsableState.Never)]
3945 public bool DispatchTouchEvents
3949 return dispatchTouchEvents;
3953 if (dispatchTouchEvents != value)
3955 dispatchTouchEvents = value;
3956 if (dispatchTouchEvents == false)
3958 TouchEvent += OnDispatchTouchEvent;
3962 TouchEvent -= OnDispatchTouchEvent;
3968 private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
3974 /// Gets or sets the status of whether the view should emit Gesture event signals.
3975 /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
3976 /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3978 [EditorBrowsable(EditorBrowsableState.Never)]
3979 public bool DispatchGestureEvents
3983 return dispatchGestureEvents;
3987 if (dispatchGestureEvents != value)
3989 dispatchGestureEvents = value;
3990 ConfigGestureDetector(dispatchGestureEvents);
3996 /// Gets or sets the status of whether the view should emit Gesture event signals.
3997 /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
3998 /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
4000 [EditorBrowsable(EditorBrowsableState.Never)]
4001 public bool DispatchParentGestureEvents
4005 return dispatchParentGestureEvents;
4009 if (dispatchParentGestureEvents != value)
4011 dispatchParentGestureEvents = value;
4012 ConfigGestureDetector(dispatchParentGestureEvents);
4017 private void ConfigGestureDetector(bool dispatch)
4019 if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
4020 if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
4021 if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
4022 if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
4023 if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
4025 if (dispatch == true)
4027 configGestureCount = configGestureCount > 0 ? configGestureCount-- : 0;
4028 if (configGestureCount == 0)
4030 panGestureDetector.Detach(this);
4031 longGestureDetector.Detach(this);
4032 pinchGestureDetector.Detach(this);
4033 tapGestureDetector.Detach(this);
4034 rotationGestureDetector.Detach(this);
4036 panGestureDetector.Detected -= OnGestureDetected;
4037 longGestureDetector.Detected -= OnGestureDetected;
4038 pinchGestureDetector.Detected -= OnGestureDetected;
4039 tapGestureDetector.Detected -= OnGestureDetected;
4040 rotationGestureDetector.Detected -= OnGestureDetected;
4042 panGestureDetector = null;
4043 longGestureDetector = null;
4044 pinchGestureDetector = null;
4045 tapGestureDetector = null;
4046 rotationGestureDetector = null;
4051 if (configGestureCount == 0)
4053 panGestureDetector.Attach(this);
4054 longGestureDetector.Attach(this);
4055 pinchGestureDetector.Attach(this);
4056 tapGestureDetector.Attach(this);
4057 rotationGestureDetector.Attach(this);
4059 panGestureDetector.Detected += OnGestureDetected;
4060 longGestureDetector.Detected += OnGestureDetected;
4061 pinchGestureDetector.Detected += OnGestureDetected;
4062 tapGestureDetector.Detected += OnGestureDetected;
4063 rotationGestureDetector.Detected += OnGestureDetected;
4065 configGestureCount++;
4069 private void OnGestureDetected(object source, EventArgs e)
4071 // Does notting. This is to consume the gesture.
4075 /// Called when the view is hit through TouchEvent or GestureEvent.
4076 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
4077 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
4078 /// User can override whether hit or not in HitTest.
4079 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
4080 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
4082 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
4083 [EditorBrowsable(EditorBrowsableState.Never)]
4084 protected virtual bool HitTest(Touch touch)
4090 /// Retrieve the View's current Color.
4093 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
4094 /// 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).
4095 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
4096 /// and users can get the current actual values through them.
4098 [EditorBrowsable(EditorBrowsableState.Never)]
4099 public Color CurrentColor => GetCurrentColor();
4102 /// Retrieve the current scale factor applied to the View.
4105 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
4106 /// 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).
4107 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
4108 /// and users can get the current actual values through them.
4110 [EditorBrowsable(EditorBrowsableState.Never)]
4111 public Vector3 CurrentScale => GetCurrentScale();