2 * Copyright(c) 2022 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Collections.Generic;
19 using System.ComponentModel;
20 using System.Runtime.InteropServices;
21 using Tizen.NUI.Binding;
23 namespace Tizen.NUI.BaseComponents
26 /// View is the base class for all views.
28 /// <since_tizen> 3 </since_tizen>
29 public partial class View : Container, IResourcesProvider
31 private static HashSet<BindableProperty> positionPropertyGroup = new HashSet<BindableProperty>();
32 private static HashSet<BindableProperty> sizePropertyGroup = new HashSet<BindableProperty>();
33 private static HashSet<BindableProperty> scalePropertyGroup = new HashSet<BindableProperty>();
34 private static bool defaultGrabTouchAfterLeave = false;
35 private static bool defaultAllowOnlyOwnTouch = false;
37 internal BackgroundExtraData backgroundExtraData;
39 private bool layoutSet = false;
40 private LayoutItem layout; // Exclusive layout assigned to this View.
42 // List of transitions paired with the condition that uses the transition.
43 private Dictionary<TransitionCondition, TransitionList> layoutTransitions;
44 private int widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
45 private int heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
46 private float weight = 0.0f; // Weighting of child View in a Layout
47 private bool backgroundImageSynchronousLoading = false;
48 private bool excludeLayouting = false;
49 private LayoutTransition layoutTransition;
50 private TransitionOptions transitionOptions = null;
51 private ThemeData themeData;
52 private bool isThemeChanged = false;
54 // List of constraints
55 private Constraint widthConstraint = null;
56 private Constraint heightConstraint = null;
58 private Size2D internalMaximumSize = null;
59 private Size2D internalMinimumSize = null;
60 private Extents internalMargin = null;
61 private Extents internalPadding = null;
62 private Vector3 internalSizeModeFactor = null;
63 private Vector2 internalCellIndex = null;
64 private Color internalBackgroundColor = null;
65 private Color internalColor = null;
66 private Position internalPivotPoint = null;
67 private Position internalPosition = null;
68 private Position2D internalPosition2D = null;
69 private Vector3 internalScale = null;
70 private Size internalSize = null;
71 private Size2D internalSize2D = null;
72 private int layoutCount = 0;
73 private ControlState propagatableControlStates = ControlState.All;
75 // List of dispatch Event
76 private PanGestureDetector panGestureDetector = null;
77 private LongPressGestureDetector longGestureDetector = null;
78 private PinchGestureDetector pinchGestureDetector = null;
79 private TapGestureDetector tapGestureDetector = null;
80 private RotationGestureDetector rotationGestureDetector = null;
81 private int configGestureCount = 0;
82 private bool dispatchTouchEvents = true;
83 private bool dispatchGestureEvents = true;
84 private bool dispatchParentGestureEvents = true;
86 #if NUI_PROPERTY_CHANGE_1
87 private string internalName = string.Empty;
89 #if NUI_PROPERTY_CHANGE_3
90 private Vector3 internalCurrentParentOrigin = null;
91 private Vector3 internalCurrentAnchorPoint = null;
92 private Vector3 internalTargetSize = null;
93 private Size2D internalCurrentSize = null;
94 private Vector3 internalNaturalSize = null;
95 private Position internalCurrentPosition = null;
96 private Vector3 internalCurrentWorldPosition = null;
97 private Vector3 internalCurrentScale = null;
98 private Vector3 internalCurrentWorldScale = null;
99 private Vector4 internalCurrentColor = null;
100 private Vector4 internalCurrentWorldColor = null;
103 #if NUI_PROPERTY_CHANGE_DEBUG
104 internal static int LayoutSetGetter = 0;
105 internal static int SizeGetter = 0;
106 internal static int SizeSetter = 0;
107 internal static int Size2DGetter = 0;
108 internal static int Size2DSetter = 0;
109 internal static int MaximumSizeGetter = 0;
110 internal static int MaximumSizeSetter = 0;
111 internal static int MinimumSizeGetter = 0;
112 internal static int MinimumSizeSetter = 0;
113 internal static int PositionGetter = 0;
114 internal static int PositionSetter = 0;
115 internal static int Position2DGetter = 0;
116 internal static int Position2DSetter = 0;
117 internal static int SizeWidthGetter = 0;
118 internal static int SizeWidthSetter = 0;
119 internal static int SizeHeightGetter = 0;
120 internal static int SizeHeightSetter = 0;
121 internal static int PositionXGetter = 0;
122 internal static int PositionXSetter = 0;
123 internal static int PositionYGetter = 0;
124 internal static int PositionYSetter = 0;
125 internal static int PositionZGetter = 0;
126 internal static int PositionZSetter = 0;
127 internal static int StyleNameGetter = 0;
128 internal static int StyleNameSetter = 0;
129 internal static int KeyInputFocusGetter = 0;
130 internal static int KeyInputFocusSetter = 0;
131 internal static int ColorGetter = 0;
132 internal static int ColorSetter = 0;
135 internal static int ColorRedSetter = 0;
136 internal static int ColorGreenSetter = 0;
137 internal static int ColorBlueSetter = 0;
138 internal static int StateSetter = 0;
139 internal static int SubStateSetter = 0;
140 internal static int FlexSetter = 0;
141 internal static int AlignSelfSetter = 0;
142 internal static int FlexMarginSetter = 0;
143 internal static int CellIndexSetter = 0;
144 internal static int RowSpanSetter = 0;
145 internal static int ColumnSpanSetter = 0;
146 internal static int CellHorizontalAlignmentSetter = 0;
147 internal static int CellVerticalAlignmentSetter = 0;
148 internal static int OpacitySetter = 0;
149 internal static int PositionUsesPivotPointSetter = 0;
150 internal static int ParentOriginSetter = 0;
151 internal static int PivotPointSetter = 0;
152 internal static int OrientationSetter = 0;
153 internal static int ScaleSetter = 0;
154 internal static int ScaleXSetter = 0;
155 internal static int ScaleYSetter = 0;
156 internal static int ScaleZSetter = 0;
157 internal static int NameSetter = 0;
158 internal static int SensitiveSetter = 0;
159 internal static int IsEnabledSetter = 0;
160 internal static int DispatchKeyEventsSetter = 0;
161 internal static int LeaveRequiredSetter = 0;
162 internal static int InheritOrientationSetter = 0;
163 internal static int InheritScaleSetter = 0;
164 internal static int DrawModeSetter = 0;
165 internal static int SizeModeFactorSetter = 0;
166 internal static int WidthResizePolicySetter = 0;
167 internal static int HeightResizePolicySetter = 0;
168 internal static int SizeScalePolicySetter = 0;
169 internal static int WidthForHeightSetter = 0;
170 internal static int HeightForWidthSetter = 0;
171 internal static int InheritPositionSetter = 0;
172 internal static int ClippingModeSetter = 0;
173 internal static int InheritLayoutDirectionSetter = 0;
174 internal static int LayoutDirectionSetter = 0;
175 internal static int UpdateAreaHintSetter = 0;
176 internal static int AccessibilityNameSetter = 0;
177 internal static int AccessibilityDescriptionSetter = 0;
178 internal static int AccessibilityTranslationDomainSetter = 0;
179 internal static int AccessibilityRoleSetter = 0;
180 internal static int AccessibilityHighlightableSetter = 0;
181 internal static int AccessibilityHiddenSetter = 0;
182 internal static int AutomationIdSetter = 0;
184 internal static int ColorRedGetter = 0;
185 internal static int ColorGreenGetter = 0;
186 internal static int ColorBlueGetter = 0;
187 internal static int StateGetter = 0;
188 internal static int SubStateGetter = 0;
189 internal static int FlexGetter = 0;
190 internal static int AlignSelfGetter = 0;
191 internal static int FlexMarginGetter = 0;
192 internal static int CellIndexGetter = 0;
193 internal static int RowSpanGetter = 0;
194 internal static int ColumnSpanGetter = 0;
195 internal static int CellHorizontalAlignmentGetter = 0;
196 internal static int CellVerticalAlignmentGetter = 0;
197 internal static int OpacityGetter = 0;
198 internal static int PositionUsesPivotPointGetter = 0;
199 internal static int ParentOriginGetter = 0;
200 internal static int PivotPointGetter = 0;
201 internal static int OrientationGetter = 0;
202 internal static int ScaleGetter = 0;
203 internal static int ScaleXGetter = 0;
204 internal static int ScaleYGetter = 0;
205 internal static int ScaleZGetter = 0;
206 internal static int NameGetter = 0;
207 internal static int SensitiveGetter = 0;
208 internal static int IsEnabledGetter = 0;
209 internal static int DispatchKeyEventsGetter = 0;
210 internal static int LeaveRequiredGetter = 0;
211 internal static int InheritOrientationGetter = 0;
212 internal static int InheritScaleGetter = 0;
213 internal static int DrawModeGetter = 0;
214 internal static int SizeModeFactorGetter = 0;
215 internal static int WidthResizePolicyGetter = 0;
216 internal static int HeightResizePolicyGetter = 0;
217 internal static int SizeScalePolicyGetter = 0;
218 internal static int WidthForHeightGetter = 0;
219 internal static int HeightForWidthGetter = 0;
220 internal static int InheritPositionGetter = 0;
221 internal static int ClippingModeGetter = 0;
222 internal static int InheritLayoutDirectionGetter = 0;
223 internal static int LayoutDirectionGetter = 0;
224 internal static int UpdateAreaHintGetter = 0;
225 internal static int AccessibilityNameGetter = 0;
226 internal static int AccessibilityDescriptionGetter = 0;
227 internal static int AccessibilityTranslationDomainGetter = 0;
228 internal static int AccessibilityRoleGetter = 0;
229 internal static int AccessibilityHighlightableGetter = 0;
230 internal static int AccessibilityHiddenGetter = 0;
231 internal static int AutomationIdGetter = 0;
233 #if NUI_PROPERTY_CHANGE_3
234 internal static int WorldPositionXGetter = 0;
235 internal static int WorldPositionYGetter = 0;
236 internal static int WorldPositionZGetter = 0;
237 internal static int ParentOriginXGetter = 0;
238 internal static int ParentOriginXSetter = 0;
239 internal static int ParentOriginYGetter = 0;
240 internal static int ParentOriginYSetter = 0;
241 internal static int ParentOriginZGetter = 0;
242 internal static int ParentOriginZSetter = 0;
243 internal static int PivotPointXGetter = 0;
244 internal static int PivotPointXSetter = 0;
245 internal static int PivotPointYGetter = 0;
246 internal static int PivotPointYSetter = 0;
247 internal static int PivotPointZGetter = 0;
248 internal static int PivotPointZSetter = 0;
249 internal static int LeftFocusableViewIdGetter = 0;
250 internal static int LeftFocusableViewIdSetter = 0;
251 internal static int RightFocusableViewIdGetter = 0;
252 internal static int RightFocusableViewIdSetter = 0;
253 internal static int UpFocusableViewIdGetter = 0;
254 internal static int UpFocusableViewIdSetter = 0;
255 internal static int DownFocusableViewIdGetter = 0;
256 internal static int DownFocusableViewIdSetter = 0;
257 internal static int ClockwiseFocusableViewIdGetter = 0;
258 internal static int ClockwiseFocusableViewIdSetter = 0;
259 internal static int CounterClockwiseFocusableViewIdGetter = 0;
260 internal static int CounterClockwiseFocusableViewIdSetter = 0;
262 internal static int GetCurrentParentOriginCnt = 0;
263 internal static int GetCurrentAnchorPointCnt = 0;
264 internal static int GetTargetSizeCnt = 0;
265 internal static int GetCurrentSizeCnt = 0;
266 internal static int GetCurrentSizeFloatCnt = 0;
267 internal static int GetNaturalSizeCnt = 0;
268 internal static int GetCurrentPositionCnt = 0;
269 internal static int GetCurrentWorldPositionCnt = 0;
270 internal static int GetCurrentScaleCnt = 0;
271 internal static int GetCurrentWorldScaleCnt = 0;
272 internal static int GetCurrentColorCnt = 0;
273 internal static int GetCurrentWorldColorCnt = 0;
274 internal static int GetSizeModeFactorCnt = 0;
275 internal static int GetMinimumSizeCnt = 0;
276 internal static int GetMaximumSizeCnt = 0;
283 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
284 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
285 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
286 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
288 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
289 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
290 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
291 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
293 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
294 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
295 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
296 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
298 RegisterAccessibilityDelegate();
302 /// Creates a new instance of a view.
304 /// <since_tizen> 3 </since_tizen>
305 public View() : this(Interop.View.New(), true)
307 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
310 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
311 [EditorBrowsable(EditorBrowsableState.Never)]
312 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
317 /// Create a new instance of a View with setting the status of shown or hidden.
319 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
320 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
321 [EditorBrowsable(EditorBrowsableState.Never)]
322 public View(bool shown) : this(Interop.View.New(), true)
324 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
328 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
330 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
336 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
339 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
341 InitializeStyle(viewStyle);
344 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
348 PositionUsesPivotPoint = false;
351 onWindowSendEventCallback = SendViewAddedEventToWindow;
352 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
353 signal?.Connect(onWindowSendEventCallback);
355 hitTestResultDataCallback = OnHitTestResult;
356 using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
357 touchDataSignal?.Connect(hitTestResultDataCallback);
364 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
365 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
368 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
370 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
379 /// The event that is triggered when the View's ControlState is changed.
381 [EditorBrowsable(EditorBrowsableState.Never)]
382 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
384 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
388 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
390 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
391 [EditorBrowsable(EditorBrowsableState.Never)]
392 public bool LayoutSet
396 #if NUI_PROPERTY_CHANGE_DEBUG
404 /// Flag to allow Layouting to be disabled for Views.
405 /// Once a View has a Layout set then any children added to Views from then on will receive
406 /// automatic Layouts.
408 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
409 [EditorBrowsable(EditorBrowsableState.Never)]
410 public static bool LayoutingDisabled { get; set; } = true;
413 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
415 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
416 [EditorBrowsable(EditorBrowsableState.Never)]
417 public static void SetDefaultGrabTouchAfterLeave(bool enable)
419 defaultGrabTouchAfterLeave = enable;
423 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
425 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
426 [EditorBrowsable(EditorBrowsableState.Never)]
427 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
429 defaultAllowOnlyOwnTouch = enable;
433 /// Deprecate. Do not use this.
434 /// The style instance applied to this view.
435 /// Note that do not modify the ViewStyle.
436 /// Modifying ViewStyle will affect other views with same ViewStyle.
438 [EditorBrowsable(EditorBrowsableState.Never)]
439 protected ViewStyle ViewStyle
443 if (themeData == null) themeData = new ThemeData();
445 if (themeData.viewStyle == null)
447 ApplyStyle(CreateViewStyle());
449 return themeData.viewStyle;
454 /// Get/Set the control state.
455 /// Note that the ControlState only available for the classes derived from Control.
456 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
457 /// please set <see cref="EnableControlState"/> to true.
459 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
460 [EditorBrowsable(EditorBrowsableState.Never)]
461 public ControlState ControlState
465 return themeData == null ? ControlState.Normal : themeData.controlStates;
469 if (ControlState == value)
474 var prevState = ControlState;
476 if (themeData == null) themeData = new ThemeData();
477 themeData.controlStates = value;
479 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
481 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
483 if (themeData.ControlStatePropagation)
485 foreach (View child in Children)
487 ControlState allowed = child.PropagatableControlStates;
488 if (allowed.Contains(ControlState.All))
490 child.ControlState = value;
494 ControlState newControlState = child.ControlState;
496 if (allowed.Contains(ControlState.Normal))
498 if (value.Contains(ControlState.Normal))
500 newControlState += ControlState.Normal;
504 newControlState -= ControlState.Normal;
508 if (allowed.Contains(ControlState.Disabled))
510 if (value.Contains(ControlState.Disabled))
512 newControlState += ControlState.Disabled;
516 newControlState -= ControlState.Disabled;
520 if (allowed.Contains(ControlState.Selected))
522 if (value.Contains(ControlState.Selected))
524 newControlState += ControlState.Selected;
528 newControlState -= ControlState.Selected;
532 if (allowed.Contains(ControlState.Pressed))
534 if (value.Contains(ControlState.Pressed))
536 newControlState += ControlState.Pressed;
540 newControlState -= ControlState.Pressed;
544 if (allowed.Contains(ControlState.Focused))
546 if (value.Contains(ControlState.Focused))
548 newControlState += ControlState.Focused;
552 newControlState -= ControlState.Focused;
556 if (allowed.Contains(ControlState.Other))
558 if (value.Contains(ControlState.Other))
560 newControlState += ControlState.Other;
564 newControlState -= ControlState.Other;
568 if (child.ControlState != newControlState)
569 child.ControlState = newControlState;
574 OnControlStateChanged(changeInfo);
576 ControlStateChangedEvent?.Invoke(this, changeInfo);
581 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
583 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
584 [EditorBrowsable(EditorBrowsableState.Never)]
585 public bool ExcludeLayouting
589 return (bool)GetValue(ExcludeLayoutingProperty);
593 SetValue(ExcludeLayoutingProperty, value);
594 NotifyPropertyChanged();
598 private bool InternalExcludeLayouting
602 return excludeLayouting;
606 excludeLayouting = value;
607 if (Layout != null && Layout.SetPositionByLayout == value)
609 Layout.SetPositionByLayout = !value;
610 Layout.RequestLayout();
616 /// The StyleName, type string.
617 /// The value indicates DALi style name defined in json theme file.
619 /// <since_tizen> 3 </since_tizen>
620 public string StyleName
624 #if NUI_PROPERTY_CHANGE_DEBUG
627 return (string)GetValue(StyleNameProperty);
631 #if NUI_PROPERTY_CHANGE_DEBUG
634 SetValue(StyleNameProperty, value);
635 NotifyPropertyChanged();
640 /// The KeyInputFocus, type bool.
642 [EditorBrowsable(EditorBrowsableState.Never)]
643 public bool KeyInputFocus
647 #if NUI_PROPERTY_CHANGE_DEBUG
648 KeyInputFocusGetter++;
650 return (bool)GetValue(KeyInputFocusProperty);
654 #if NUI_PROPERTY_CHANGE_DEBUG
655 KeyInputFocusSetter++;
657 SetValue(KeyInputFocusProperty, value);
658 NotifyPropertyChanged();
663 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
667 /// The property cascade chaining set is not recommended.
670 /// Animatable - This property can be animated using <c>Animation</c> class.
672 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
677 /// This way is recommended for setting the property
679 /// var view = new View();
680 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
682 /// This way to set the property is prohibited
684 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
687 /// <since_tizen> 3 </since_tizen>
688 public Color BackgroundColor
692 return (Color)GetValue(BackgroundColorProperty);
696 SetValue(BackgroundColorProperty, value);
697 NotifyPropertyChanged();
702 /// The mutually exclusive with "backgroundColor" and "background" type Map.
704 /// <since_tizen> 3 </since_tizen>
705 public string BackgroundImage
709 return (string)GetValue(BackgroundImageProperty);
713 SetValue(BackgroundImageProperty, value);
714 NotifyPropertyChanged();
719 /// Get or set the border of background image.
721 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
722 [EditorBrowsable(EditorBrowsableState.Never)]
723 public Rectangle BackgroundImageBorder
727 return (Rectangle)GetValue(BackgroundImageBorderProperty);
731 SetValue(BackgroundImageBorderProperty, value);
732 NotifyPropertyChanged();
737 /// The background of view.
739 /// <since_tizen> 3 </since_tizen>
740 public Tizen.NUI.PropertyMap Background
744 return (PropertyMap)GetValue(BackgroundProperty);
748 SetValue(BackgroundProperty, value);
749 NotifyPropertyChanged();
754 /// Describes a shadow as an image for a View.
755 /// It is null by default.
758 /// Getter returns copied instance of current shadow.
761 /// The mutually exclusive with "BoxShadow".
765 /// Animatable - This property can be animated using <c>Animation</c> class.
766 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
768 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
770 /// Animatable sub-property : Offset.
773 [EditorBrowsable(EditorBrowsableState.Never)]
774 public ImageShadow ImageShadow
778 return (ImageShadow)GetValue(ImageShadowProperty);
782 SetValue(ImageShadowProperty, value);
783 NotifyPropertyChanged();
788 /// Describes a box shaped shadow drawing for a View.
789 /// It is null by default.
792 /// The mutually exclusive with "ImageShadow".
796 /// Animatable - This property can be animated using <c>Animation</c> class.
797 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
799 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
801 /// Animatable sub-property : Offset, Color, BlurRadius.
804 /// <since_tizen> 9 </since_tizen>
805 public Shadow BoxShadow
809 return (Shadow)GetValue(BoxShadowProperty);
813 SetValue(BoxShadowProperty, value);
814 NotifyPropertyChanged();
819 /// The radius for the rounded corners of the View.
820 /// This will rounds background and shadow edges.
821 /// 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).
822 /// Each radius will clamp internally to the half of smaller of the view's width or height.
823 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
827 /// Animatable - This property can be animated using <c>Animation</c> class.
829 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
833 /// <since_tizen> 9 </since_tizen>
834 public Vector4 CornerRadius
838 return (Vector4)GetValue(CornerRadiusProperty);
842 SetValue(CornerRadiusProperty, value);
843 NotifyPropertyChanged();
848 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
849 /// It is absolute by default.
850 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
852 /// <since_tizen> 9 </since_tizen>
853 public VisualTransformPolicyType CornerRadiusPolicy
855 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
856 set => SetValue(CornerRadiusPolicyProperty, value);
860 /// The width for the borderline of the View.
864 /// Animatable - This property can be animated using <c>Animation</c> class.
866 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
869 /// Note that, an image background may not have borderline if it uses the Border property.
871 /// <since_tizen> 9 </since_tizen>
872 public float BorderlineWidth
876 return (float)GetValue(BorderlineWidthProperty);
880 SetValue(BorderlineWidthProperty, value);
881 NotifyPropertyChanged();
886 /// The color for the borderline of the View.
887 /// It is Color.Black by default.
891 /// Animatable - This property can be animated using <c>Animation</c> class.
893 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
897 /// <since_tizen> 9 </since_tizen>
898 public Color BorderlineColor
902 return (Color)GetValue(BorderlineColorProperty);
906 SetValue(BorderlineColorProperty, value);
907 NotifyPropertyChanged();
912 /// The color selector for the borderline of the View.
913 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
914 /// So this API is internally used only.
916 internal Selector<Color> BorderlineColorSelector
920 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
924 SetValue(BorderlineColorSelectorProperty, value);
925 NotifyPropertyChanged();
930 /// The Relative offset for the borderline of the View.
931 /// Recommended range : [-1.0f to 1.0f].
932 /// If -1.0f, draw borderline inside of the View.
933 /// If 1.0f, draw borderline outside of the View.
934 /// If 0.0f, draw borderline half inside and half outside.
935 /// It is 0.0f by default.
939 /// Animatable - This property can be animated using <c>Animation</c> class.
941 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
945 /// <since_tizen> 9 </since_tizen>
946 public float BorderlineOffset
950 return (float)GetValue(BorderlineOffsetProperty);
954 SetValue(BorderlineOffsetProperty, value);
955 NotifyPropertyChanged();
960 /// The current state of the view.
962 /// <since_tizen> 3 </since_tizen>
967 #if NUI_PROPERTY_CHANGE_DEBUG
970 return (States)GetValue(StateProperty);
974 #if NUI_PROPERTY_CHANGE_DEBUG
977 SetValue(StateProperty, value);
978 NotifyPropertyChanged();
983 /// The current sub state of the view.
985 /// <since_tizen> 3 </since_tizen>
986 public States SubState
990 #if NUI_PROPERTY_CHANGE_DEBUG
993 return (States)GetValue(SubStateProperty);
997 #if NUI_PROPERTY_CHANGE_DEBUG
1000 SetValue(SubStateProperty, value);
1001 NotifyPropertyChanged();
1006 /// Displays a tooltip
1008 /// <since_tizen> 3 </since_tizen>
1009 public Tizen.NUI.PropertyMap Tooltip
1013 return (PropertyMap)GetValue(TooltipProperty);
1017 SetValue(TooltipProperty, value);
1018 NotifyPropertyChanged();
1023 /// Displays a tooltip as a text.
1025 /// <since_tizen> 3 </since_tizen>
1026 public string TooltipText
1030 return GetValue(TooltipTextProperty) as string;
1034 SetValue(TooltipTextProperty, value);
1038 private string InternalTooltipText
1042 using (var propertyValue = GetProperty(Property.TOOLTIP))
1044 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
1046 return retrivedValue;
1048 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
1049 return "error to get TooltipText";
1054 var temp = new Tizen.NUI.PropertyValue(value);
1055 SetProperty(View.Property.TOOLTIP, temp);
1057 NotifyPropertyChanged();
1062 /// The Child property of FlexContainer.<br />
1063 /// The proportion of the free space in the container, the flex item will receive.<br />
1064 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
1066 /// <since_tizen> 3 </since_tizen>
1067 [Obsolete("Deprecated in API8, will be removed in API10.")]
1072 #if NUI_PROPERTY_CHANGE_DEBUG
1075 return (float)GetValue(FlexProperty);
1079 #if NUI_PROPERTY_CHANGE_DEBUG
1082 SetValue(FlexProperty, value);
1083 NotifyPropertyChanged();
1088 /// The Child property of FlexContainer.<br />
1089 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
1091 /// <since_tizen> 3 </since_tizen>
1092 [Obsolete("Deprecated in API8, will be removed in API10.")]
1093 public int AlignSelf
1097 #if NUI_PROPERTY_CHANGE_DEBUG
1100 return (int)GetValue(AlignSelfProperty);
1104 #if NUI_PROPERTY_CHANGE_DEBUG
1107 SetValue(AlignSelfProperty, value);
1108 NotifyPropertyChanged();
1113 /// The Child property of FlexContainer.<br />
1114 /// The space around the flex item.<br />
1117 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
1119 /// <since_tizen> 3 </since_tizen>
1120 [Obsolete("Deprecated in API8, will be removed in API10.")]
1121 public Vector4 FlexMargin
1125 #if NUI_PROPERTY_CHANGE_DEBUG
1128 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
1129 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
1133 #if NUI_PROPERTY_CHANGE_DEBUG
1136 SetValue(FlexMarginProperty, value);
1137 NotifyPropertyChanged();
1142 /// The top-left cell this child occupies, if not set, the first available cell is used.
1145 /// The property cascade chaining set is not recommended.
1146 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
1149 /// This way is recommended for setting the property
1151 /// var view = new View();
1152 /// view.CellIndex = new Vector2(1, 3);
1154 /// This way to set the property is prohibited
1156 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
1159 /// <since_tizen> 3 </since_tizen>
1160 public Vector2 CellIndex
1164 #if NUI_PROPERTY_CHANGE_DEBUG
1167 return (Vector2)GetValue(CellIndexProperty);
1171 #if NUI_PROPERTY_CHANGE_DEBUG
1174 SetValue(CellIndexProperty, value);
1175 NotifyPropertyChanged();
1180 /// The number of rows this child occupies, if not set, the default value is 1.
1183 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1185 /// <since_tizen> 3 </since_tizen>
1186 public float RowSpan
1190 #if NUI_PROPERTY_CHANGE_DEBUG
1193 return (float)GetValue(RowSpanProperty);
1197 #if NUI_PROPERTY_CHANGE_DEBUG
1200 SetValue(RowSpanProperty, value);
1201 NotifyPropertyChanged();
1206 /// The number of columns this child occupies, if not set, the default value is 1.
1209 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1211 /// <since_tizen> 3 </since_tizen>
1212 public float ColumnSpan
1216 #if NUI_PROPERTY_CHANGE_DEBUG
1219 return (float)GetValue(ColumnSpanProperty);
1223 #if NUI_PROPERTY_CHANGE_DEBUG
1226 SetValue(ColumnSpanProperty, value);
1227 NotifyPropertyChanged();
1232 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
1235 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1237 /// <since_tizen> 3 </since_tizen>
1238 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1242 #if NUI_PROPERTY_CHANGE_DEBUG
1243 CellHorizontalAlignmentGetter++;
1245 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1249 #if NUI_PROPERTY_CHANGE_DEBUG
1250 CellHorizontalAlignmentSetter++;
1252 SetValue(CellHorizontalAlignmentProperty, value);
1253 NotifyPropertyChanged();
1258 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1261 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1263 /// <since_tizen> 3 </since_tizen>
1264 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1268 #if NUI_PROPERTY_CHANGE_DEBUG
1269 CellVerticalAlignmentGetter++;
1271 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1275 #if NUI_PROPERTY_CHANGE_DEBUG
1276 CellVerticalAlignmentSetter++;
1278 SetValue(CellVerticalAlignmentProperty, value);
1279 NotifyPropertyChanged();
1284 /// The left focusable view.<br />
1285 /// This will return null if not set.<br />
1286 /// This will also return null if the specified left focusable view is not on a window.<br />
1288 /// <since_tizen> 3 </since_tizen>
1289 public View LeftFocusableView
1291 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1294 return (View)GetValue(LeftFocusableViewProperty);
1298 SetValue(LeftFocusableViewProperty, value);
1299 NotifyPropertyChanged();
1304 /// The right focusable view.<br />
1305 /// This will return null if not set.<br />
1306 /// This will also return null if the specified right focusable view is not on a window.<br />
1308 /// <since_tizen> 3 </since_tizen>
1309 public View RightFocusableView
1311 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1314 return (View)GetValue(RightFocusableViewProperty);
1318 SetValue(RightFocusableViewProperty, value);
1319 NotifyPropertyChanged();
1324 /// The up focusable view.<br />
1325 /// This will return null if not set.<br />
1326 /// This will also return null if the specified up focusable view is not on a window.<br />
1328 /// <since_tizen> 3 </since_tizen>
1329 public View UpFocusableView
1331 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1334 return (View)GetValue(UpFocusableViewProperty);
1338 SetValue(UpFocusableViewProperty, value);
1339 NotifyPropertyChanged();
1344 /// The down focusable view.<br />
1345 /// This will return null if not set.<br />
1346 /// This will also return null if the specified down focusable view is not on a window.<br />
1348 /// <since_tizen> 3 </since_tizen>
1349 public View DownFocusableView
1351 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1354 return (View)GetValue(DownFocusableViewProperty);
1358 SetValue(DownFocusableViewProperty, value);
1359 NotifyPropertyChanged();
1364 /// The clockwise focusable view by rotary wheel.<br />
1365 /// This will return null if not set.<br />
1366 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1368 [EditorBrowsable(EditorBrowsableState.Never)]
1369 public View ClockwiseFocusableView
1371 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1374 return (View)GetValue(ClockwiseFocusableViewProperty);
1378 SetValue(ClockwiseFocusableViewProperty, value);
1379 NotifyPropertyChanged();
1384 /// The counter clockwise focusable view by rotary wheel.<br />
1385 /// This will return null if not set.<br />
1386 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1388 [EditorBrowsable(EditorBrowsableState.Never)]
1389 public View CounterClockwiseFocusableView
1391 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1394 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1398 SetValue(CounterClockwiseFocusableViewProperty, value);
1399 NotifyPropertyChanged();
1404 /// Whether the view should be focusable by keyboard navigation.
1406 /// <since_tizen> 3 </since_tizen>
1407 public bool Focusable
1411 SetValue(FocusableProperty, value);
1412 NotifyPropertyChanged();
1416 return (bool)GetValue(FocusableProperty);
1421 /// 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.
1422 /// Note : Default value is true.
1424 [EditorBrowsable(EditorBrowsableState.Never)]
1425 public bool FocusableChildren
1429 SetValue(FocusableChildrenProperty, value);
1430 NotifyPropertyChanged();
1434 return (bool)GetValue(FocusableChildrenProperty);
1439 /// Whether this view can focus by touch.
1440 /// If Focusable is false, FocusableInTouch is disabled.
1441 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1443 [EditorBrowsable(EditorBrowsableState.Never)]
1444 public bool FocusableInTouch
1448 SetValue(FocusableInTouchProperty, value);
1449 NotifyPropertyChanged();
1453 return (bool)GetValue(FocusableInTouchProperty);
1458 /// Retrieves the position of the view.
1459 /// The coordinates are relative to the view's parent.
1462 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1463 /// 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).
1464 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1465 /// and users can get the current actual values through them.
1467 /// <since_tizen> 3 </since_tizen>
1468 public Position CurrentPosition
1472 return GetCurrentPosition();
1477 /// Sets the size of a view for the width and the height.<br />
1478 /// Geometry can be scaled to fit within this area.<br />
1479 /// This does not interfere with the view's scale factor.<br />
1480 /// The views default depth is the minimum of width and height.<br />
1483 /// The property cascade chaining set is not recommended.
1486 /// This way is recommended for setting the property
1488 /// var view = new View();
1489 /// view.Size2D = new Size2D(100, 200);
1491 /// This way to set the property is prohibited
1493 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1496 /// <since_tizen> 3 </since_tizen>
1497 public Size2D Size2D
1501 #if NUI_PROPERTY_CHANGE_DEBUG
1505 var temp = (Size2D)GetValue(Size2DProperty);
1507 if (this.Layout == null)
1509 if (temp.Width < 0) { temp.Width = 0; }
1510 if (temp.Height < 0) { temp.Height = 0; }
1517 #if NUI_PROPERTY_CHANGE_DEBUG
1521 SetValue(Size2DProperty, value);
1523 NotifyPropertyChanged();
1528 /// Retrieves the size of the view.
1529 /// The coordinates are relative to the view's parent.
1532 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1533 /// 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).
1534 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1535 /// and users can get the current actual values through them.
1537 /// <since_tizen> 3 </since_tizen>
1538 public Size2D CurrentSize
1542 return GetCurrentSize();
1547 /// Retrieves and sets the view's opacity.<br />
1551 /// Animatable - This property can be animated using <c>Animation</c> class.
1553 /// animation.AnimateTo(view, "Opacity", 0.5f);
1557 /// <since_tizen> 3 </since_tizen>
1558 public float Opacity
1562 #if NUI_PROPERTY_CHANGE_DEBUG
1565 return (float)GetValue(OpacityProperty);
1569 #if NUI_PROPERTY_CHANGE_DEBUG
1572 SetValue(OpacityProperty, value);
1573 NotifyPropertyChanged();
1578 /// Sets the position of the view for X and Y.<br />
1579 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1580 /// If the position inheritance is disabled, sets the world position.<br />
1583 /// The property cascade chaining set is not recommended.
1586 /// This way is recommended for setting the property
1588 /// var view = new View();
1589 /// view.Position2D = new Position2D(100, 200);
1591 /// This way to set the property is prohibited
1593 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1596 /// <since_tizen> 3 </since_tizen>
1597 public Position2D Position2D
1601 #if NUI_PROPERTY_CHANGE_DEBUG
1605 return (Position2D)GetValue(Position2DProperty);
1609 #if NUI_PROPERTY_CHANGE_DEBUG
1613 SetValue(Position2DProperty, value);
1614 NotifyPropertyChanged();
1619 /// Retrieves the screen position of the view.<br />
1621 /// <since_tizen> 3 </since_tizen>
1622 public Vector2 ScreenPosition
1626 Vector2 temp = new Vector2(0.0f, 0.0f);
1627 var pValue = GetProperty(View.Property.ScreenPosition);
1635 /// Determines whether the pivot point should be used to determine the position of the view.
1636 /// This is false by default.
1638 /// <remarks>If false, then the top-left of the view is used for the position.
1639 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1641 /// <since_tizen> 3 </since_tizen>
1642 public bool PositionUsesPivotPoint
1646 #if NUI_PROPERTY_CHANGE_DEBUG
1647 PositionUsesPivotPointGetter++;
1649 return (bool)GetValue(PositionUsesPivotPointProperty);
1653 #if NUI_PROPERTY_CHANGE_DEBUG
1654 PositionUsesPivotPointSetter++;
1656 SetValue(PositionUsesPivotPointProperty, value);
1657 NotifyPropertyChanged();
1662 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1664 /// <since_tizen> 3 </since_tizen>
1665 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1667 "View view = new View(); " +
1668 "view.PivotPoint = PivotPoint.Center; " +
1669 "view.PositionUsesPivotPoint = true;" +
1670 " This has been deprecated in API5 and will be removed in API8")]
1671 [EditorBrowsable(EditorBrowsableState.Never)]
1672 public bool PositionUsesAnchorPoint
1676 return (bool)GetValue(PositionUsesAnchorPointProperty);
1680 SetValue(PositionUsesAnchorPointProperty, value);
1684 private bool InternalPositionUsesAnchorPoint
1689 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1690 pValue.Get(out temp);
1696 var temp = new Tizen.NUI.PropertyValue(value);
1697 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1699 NotifyPropertyChanged();
1704 /// Queries whether the view is connected to the stage.<br />
1705 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1707 /// <since_tizen> 3 </since_tizen>
1708 public bool IsOnWindow
1717 /// Gets the depth in the hierarchy for the view.
1719 /// <since_tizen> 3 </since_tizen>
1720 public int HierarchyDepth
1724 return GetHierarchyDepth();
1729 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1732 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1733 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1734 /// The values set by this property will likely change.
1736 /// <since_tizen> 3 </since_tizen>
1737 public int SiblingOrder
1741 return (int)GetValue(SiblingOrderProperty);
1745 SetValue(SiblingOrderProperty, value);
1747 Layout?.ChangeLayoutSiblingOrder(value);
1749 NotifyPropertyChanged();
1754 /// Returns the natural size of the view.
1757 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1759 /// <since_tizen> 5 </since_tizen>
1760 public Vector3 NaturalSize
1764 Vector3 ret = GetNaturalSize();
1765 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1771 /// Returns the natural size (Size2D) of the view.
1774 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1776 /// <since_tizen> 4 </since_tizen>
1777 public Size2D NaturalSize2D
1781 Vector3 temp = GetNaturalSize();
1782 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1784 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1791 /// Gets or sets the origin of a view within its parent's area.<br />
1792 /// 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 />
1793 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1794 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1796 /// <pre>The view has been initialized.</pre>
1797 /// <since_tizen> 3 </since_tizen>
1798 public Position ParentOrigin
1802 #if NUI_PROPERTY_CHANGE_DEBUG
1803 ParentOriginGetter++;
1805 Position tmp = (Position)GetValue(ParentOriginProperty);
1806 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1810 #if NUI_PROPERTY_CHANGE_DEBUG
1811 ParentOriginSetter++;
1813 SetValue(ParentOriginProperty, value);
1814 NotifyPropertyChanged();
1819 /// Gets or sets the anchor-point of a view.<br />
1820 /// 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 />
1821 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1822 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1823 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1824 /// <pre>The view has been initialized.</pre>
1827 /// The property cascade chaining set is not recommended.
1830 /// This way is recommended for setting the property
1832 /// var view = new View();
1833 /// view.PivotPoint = PivotPoint.Center;
1835 /// This way to set the property is prohibited
1837 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1840 /// <since_tizen> 3 </since_tizen>
1841 public Position PivotPoint
1845 #if NUI_PROPERTY_CHANGE_DEBUG
1848 return (Position)GetValue(PivotPointProperty);
1852 #if NUI_PROPERTY_CHANGE_DEBUG
1855 SetValue(PivotPointProperty, value);
1856 NotifyPropertyChanged();
1861 /// Gets or sets the size width of the view.
1865 /// Animatable - This property can be animated using <c>Animation</c> class.
1867 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1871 /// <since_tizen> 3 </since_tizen>
1872 public float SizeWidth
1876 #if NUI_PROPERTY_CHANGE_DEBUG
1880 return (float)GetValue(SizeWidthProperty);
1884 #if NUI_PROPERTY_CHANGE_DEBUG
1888 SetValue(SizeWidthProperty, value);
1889 NotifyPropertyChanged();
1894 /// Gets or sets the size height of the view.
1898 /// Animatable - This property can be animated using <c>Animation</c> class.
1901 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1904 /// <since_tizen> 3 </since_tizen>
1905 public float SizeHeight
1909 #if NUI_PROPERTY_CHANGE_DEBUG
1913 return (float)GetValue(SizeHeightProperty);
1917 #if NUI_PROPERTY_CHANGE_DEBUG
1921 SetValue(SizeHeightProperty, value);
1922 NotifyPropertyChanged();
1927 /// Gets or sets the position of the view.<br />
1928 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1929 /// If the position inheritance is disabled, sets the world position.<br />
1933 /// Animatable - This property can be animated using <c>Animation</c> class.
1935 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1938 /// The property cascade chaining set is not recommended.
1941 /// This way is recommended for setting the property
1943 /// var view = new View();
1944 /// view.Position = new Position(100, 200.5f, 0);
1946 /// This way to set the property is prohibited
1948 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1951 /// <since_tizen> 3 </since_tizen>
1952 public Position Position
1956 #if NUI_PROPERTY_CHANGE_DEBUG
1960 return (Position)GetValue(PositionProperty);
1964 #if NUI_PROPERTY_CHANGE_DEBUG
1968 SetValue(PositionProperty, value);
1969 NotifyPropertyChanged();
1974 /// Gets or sets the position X of the view.
1978 /// Animatable - This property can be animated using <c>Animation</c> class.
1980 /// animation.AnimateTo(view, "PositionX", 50.0f);
1984 /// <since_tizen> 3 </since_tizen>
1985 public float PositionX
1989 #if NUI_PROPERTY_CHANGE_DEBUG
1992 return (float)GetValue(PositionXProperty);
1996 #if NUI_PROPERTY_CHANGE_DEBUG
1999 SetValue(PositionXProperty, value);
2000 NotifyPropertyChanged();
2005 /// Gets or sets the position Y of the view.
2009 /// Animatable - This property can be animated using <c>Animation</c> class.
2011 /// animation.AnimateTo(view, "PositionY", 50.0f);
2015 /// <since_tizen> 3 </since_tizen>
2016 public float PositionY
2020 #if NUI_PROPERTY_CHANGE_DEBUG
2023 return (float)GetValue(PositionYProperty);
2027 #if NUI_PROPERTY_CHANGE_DEBUG
2030 SetValue(PositionYProperty, value);
2031 NotifyPropertyChanged();
2036 /// Gets or sets the position Z of the view.
2040 /// Animatable - This property can be animated using <c>Animation</c> class.
2042 /// animation.AnimateTo(view, "PositionZ", 50.0f);
2046 /// <since_tizen> 3 </since_tizen>
2047 public float PositionZ
2051 #if NUI_PROPERTY_CHANGE_DEBUG
2055 return (float)GetValue(PositionZProperty);
2059 #if NUI_PROPERTY_CHANGE_DEBUG
2063 SetValue(PositionZProperty, value);
2064 NotifyPropertyChanged();
2069 /// Gets or sets the world position of the view.
2071 /// <since_tizen> 3 </since_tizen>
2072 public Vector3 WorldPosition
2076 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
2077 var pValue = GetProperty(View.Property.WorldPosition);
2085 /// Gets or sets the orientation of the view.<br />
2086 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
2090 /// This is an asynchronous method.
2093 /// Animatable - This property can be animated using <c>Animation</c> class.
2095 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
2099 /// <since_tizen> 3 </since_tizen>
2100 public Rotation Orientation
2104 #if NUI_PROPERTY_CHANGE_DEBUG
2105 OrientationGetter++;
2107 return (Rotation)GetValue(OrientationProperty);
2111 #if NUI_PROPERTY_CHANGE_DEBUG
2112 OrientationSetter++;
2114 SetValue(OrientationProperty, value);
2115 NotifyPropertyChanged();
2120 /// Gets or sets the world orientation of the view.<br />
2122 /// <since_tizen> 3 </since_tizen>
2123 public Rotation WorldOrientation
2127 Rotation temp = new Rotation();
2128 var pValue = GetProperty(View.Property.WorldOrientation);
2136 /// Gets or sets the scale factor applied to the view.<br />
2140 /// Animatable - This property can be animated using <c>Animation</c> class.
2142 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
2145 /// The property cascade chaining set is not recommended.
2148 /// This way is recommended for setting the property
2150 /// var view = new View();
2151 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
2153 /// This way to set the property is prohibited
2155 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
2158 /// <since_tizen> 3 </since_tizen>
2159 public Vector3 Scale
2163 #if NUI_PROPERTY_CHANGE_DEBUG
2166 return (Vector3)GetValue(ScaleProperty);
2170 #if NUI_PROPERTY_CHANGE_DEBUG
2173 SetValue(ScaleProperty, value);
2174 NotifyPropertyChanged();
2179 /// Gets or sets the scale X factor applied to the view.
2183 /// Animatable - This property can be animated using <c>Animation</c> class.
2185 /// animation.AnimateTo(view, "ScaleX", 1.5f);
2189 /// <since_tizen> 3 </since_tizen>
2194 #if NUI_PROPERTY_CHANGE_DEBUG
2197 return (float)GetValue(ScaleXProperty);
2201 #if NUI_PROPERTY_CHANGE_DEBUG
2204 SetValue(ScaleXProperty, value);
2205 NotifyPropertyChanged();
2210 /// Gets or sets the scale Y factor applied to the view.
2214 /// Animatable - This property can be animated using <c>Animation</c> class.
2216 /// animation.AnimateTo(view, "ScaleY", 1.5f);
2220 /// <since_tizen> 3 </since_tizen>
2225 #if NUI_PROPERTY_CHANGE_DEBUG
2228 return (float)GetValue(ScaleYProperty);
2232 #if NUI_PROPERTY_CHANGE_DEBUG
2235 SetValue(ScaleYProperty, value);
2236 NotifyPropertyChanged();
2241 /// Gets or sets the scale Z factor applied to the view.
2245 /// Animatable - This property can be animated using <c>Animation</c> class.
2247 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
2251 /// <since_tizen> 3 </since_tizen>
2256 #if NUI_PROPERTY_CHANGE_DEBUG
2259 return (float)GetValue(ScaleZProperty);
2263 #if NUI_PROPERTY_CHANGE_DEBUG
2266 SetValue(ScaleZProperty, value);
2267 NotifyPropertyChanged();
2272 /// Gets the world scale of the view.
2274 /// <since_tizen> 3 </since_tizen>
2275 public Vector3 WorldScale
2279 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
2280 var pValue = GetProperty(View.Property.WorldScale);
2288 /// Retrieves the visibility flag of the view.
2292 /// If the view is not visible, then the view and its children will not be rendered.
2293 /// 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.
2296 /// Animatable - This property can be animated using <c>Animation</c> class.
2298 /// animation.AnimateTo(view, "Visibility", false);
2302 /// <since_tizen> 3 </since_tizen>
2303 public bool Visibility
2308 var pValue = GetProperty(View.Property.VISIBLE);
2309 pValue.Get(out temp);
2316 /// Gets the view's world color.
2318 /// <since_tizen> 3 </since_tizen>
2319 public Vector4 WorldColor
2323 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
2324 var pValue = GetProperty(View.Property.WorldColor);
2332 /// Gets or sets the view's name.
2334 /// <since_tizen> 3 </since_tizen>
2339 #if NUI_PROPERTY_CHANGE_DEBUG
2342 return (string)GetValue(NameProperty);
2346 #if NUI_PROPERTY_CHANGE_DEBUG
2349 SetValue(NameProperty, value);
2350 NotifyPropertyChanged();
2355 /// Get the number of children held by the view.
2357 /// <since_tizen> 3 </since_tizen>
2358 public new uint ChildCount
2362 return Convert.ToUInt32(Children.Count);
2367 /// Gets the view's ID.
2370 /// <since_tizen> 3 </since_tizen>
2380 /// Gets or sets the status of whether the view should emit touch or hover signals.
2381 /// If a View is made insensitive, then the View and its children are not hittable.
2383 /// <since_tizen> 3 </since_tizen>
2384 public bool Sensitive
2388 #if NUI_PROPERTY_CHANGE_DEBUG
2391 return (bool)GetValue(SensitiveProperty);
2395 #if NUI_PROPERTY_CHANGE_DEBUG
2398 SetValue(SensitiveProperty, value);
2399 NotifyPropertyChanged();
2404 /// Gets or sets the status of whether the view should be enabled user interactions.
2405 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2407 /// <since_tizen> tizen_next </since_tizen>
2408 [EditorBrowsable(EditorBrowsableState.Never)]
2409 public bool IsEnabled
2413 #if NUI_PROPERTY_CHANGE_DEBUG
2416 return (bool)GetValue(IsEnabledProperty);
2420 #if NUI_PROPERTY_CHANGE_DEBUG
2423 SetValue(IsEnabledProperty, value);
2424 NotifyPropertyChanged();
2429 /// 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.
2431 /// <since_tizen> 3 </since_tizen>
2432 public bool LeaveRequired
2436 #if NUI_PROPERTY_CHANGE_DEBUG
2437 LeaveRequiredGetter++;
2439 return (bool)GetValue(LeaveRequiredProperty);
2443 #if NUI_PROPERTY_CHANGE_DEBUG
2444 LeaveRequiredSetter++;
2446 SetValue(LeaveRequiredProperty, value);
2447 NotifyPropertyChanged();
2452 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2454 /// <since_tizen> 3 </since_tizen>
2455 public bool InheritOrientation
2459 return (bool)GetValue(InheritOrientationProperty);
2463 SetValue(InheritOrientationProperty, value);
2464 NotifyPropertyChanged();
2469 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2471 /// <since_tizen> 3 </since_tizen>
2472 public bool InheritScale
2476 #if NUI_PROPERTY_CHANGE_DEBUG
2477 InheritScaleGetter++;
2479 return (bool)GetValue(InheritScaleProperty);
2483 #if NUI_PROPERTY_CHANGE_DEBUG
2484 InheritScaleSetter++;
2486 SetValue(InheritScaleProperty, value);
2487 NotifyPropertyChanged();
2492 /// Gets or sets the status of how the view and its children should be drawn.<br />
2493 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2494 /// 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 />
2495 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2496 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2497 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2499 /// <since_tizen> 3 </since_tizen>
2500 public DrawModeType DrawMode
2504 #if NUI_PROPERTY_CHANGE_DEBUG
2507 return (DrawModeType)GetValue(DrawModeProperty);
2511 #if NUI_PROPERTY_CHANGE_DEBUG
2514 SetValue(DrawModeProperty, value);
2515 NotifyPropertyChanged();
2520 /// Gets or sets the relative to parent size factor of the view.<br />
2521 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2522 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2525 /// The property cascade chaining set is not recommended.
2528 /// This way is recommended for setting the property
2530 /// var text = new TextField();
2531 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2533 /// This way to set the property is prohibited
2535 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2538 /// <since_tizen> 3 </since_tizen>
2539 public Vector3 SizeModeFactor
2543 #if NUI_PROPERTY_CHANGE_DEBUG
2544 SizeModeFactorGetter++;
2546 return (Vector3)GetValue(SizeModeFactorProperty);
2550 #if NUI_PROPERTY_CHANGE_DEBUG
2551 SizeModeFactorSetter++;
2553 SetValue(SizeModeFactorProperty, value);
2554 NotifyPropertyChanged();
2559 /// Gets or sets the width resize policy to be used.
2561 /// <since_tizen> 3 </since_tizen>
2562 public ResizePolicyType WidthResizePolicy
2566 #if NUI_PROPERTY_CHANGE_DEBUG
2567 WidthResizePolicyGetter++;
2569 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2573 #if NUI_PROPERTY_CHANGE_DEBUG
2574 WidthResizePolicySetter++;
2576 SetValue(WidthResizePolicyProperty, value);
2577 NotifyPropertyChanged();
2582 /// Gets or sets the height resize policy to be used.
2584 /// <since_tizen> 3 </since_tizen>
2585 public ResizePolicyType HeightResizePolicy
2589 #if NUI_PROPERTY_CHANGE_DEBUG
2590 HeightResizePolicyGetter++;
2592 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2596 #if NUI_PROPERTY_CHANGE_DEBUG
2597 HeightResizePolicySetter++;
2599 SetValue(HeightResizePolicyProperty, value);
2600 NotifyPropertyChanged();
2605 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2606 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2608 /// <since_tizen> 3 </since_tizen>
2609 public SizeScalePolicyType SizeScalePolicy
2613 #if NUI_PROPERTY_CHANGE_DEBUG
2614 SizeScalePolicyGetter++;
2616 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2620 #if NUI_PROPERTY_CHANGE_DEBUG
2621 SizeScalePolicySetter++;
2623 SetValue(SizeScalePolicyProperty, value);
2624 NotifyPropertyChanged();
2629 /// Gets or sets the status of whether the width size is dependent on the height size.
2631 /// <since_tizen> 3 </since_tizen>
2632 public bool WidthForHeight
2636 #if NUI_PROPERTY_CHANGE_DEBUG
2637 WidthForHeightGetter++;
2639 return (bool)GetValue(WidthForHeightProperty);
2643 #if NUI_PROPERTY_CHANGE_DEBUG
2644 WidthForHeightSetter++;
2646 SetValue(WidthForHeightProperty, value);
2647 NotifyPropertyChanged();
2652 /// Gets or sets the status of whether the height size is dependent on the width size.
2654 /// <since_tizen> 3 </since_tizen>
2655 public bool HeightForWidth
2659 #if NUI_PROPERTY_CHANGE_DEBUG
2660 HeightForWidthGetter++;
2662 return (bool)GetValue(HeightForWidthProperty);
2666 #if NUI_PROPERTY_CHANGE_DEBUG
2667 HeightForWidthSetter++;
2669 SetValue(HeightForWidthProperty, value);
2670 NotifyPropertyChanged();
2675 /// Gets or sets the padding for use in layout.
2678 /// The property cascade chaining set is not recommended.
2681 /// This way is recommended for setting the property
2683 /// var view = new View();
2684 /// view.Padding = new Extents(5, 5, 5, 5);
2686 /// This way to set the property is prohibited
2688 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2691 /// <since_tizen> 5 </since_tizen>
2692 public Extents Padding
2696 return (Extents)GetValue(PaddingProperty);
2700 SetValue(PaddingProperty, value);
2701 NotifyPropertyChanged();
2706 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2708 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2710 /// The property cascade chaining set is not recommended.
2713 /// This way is recommended for setting the property
2715 /// var view = new View();
2716 /// view.MinimumSize = new Size2D(100, 200);
2718 /// This way to set the property is prohibited
2720 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2723 /// <since_tizen> 3 </since_tizen>
2724 public Size2D MinimumSize
2728 #if NUI_PROPERTY_CHANGE_DEBUG
2729 MinimumSizeGetter++;
2731 return (Size2D)GetValue(MinimumSizeProperty);
2735 #if NUI_PROPERTY_CHANGE_DEBUG
2736 MinimumSizeSetter++;
2740 throw new ArgumentNullException(nameof(value));
2744 // Note: it only works if minimum size is >= than natural size.
2745 // To force the size it should be done through the width&height spec or Size2D.
2746 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2747 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2748 layout.RequestLayout();
2750 SetValue(MinimumSizeProperty, value);
2751 NotifyPropertyChanged();
2756 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2759 /// This way is recommended for setting the property
2761 /// var view = new View();
2762 /// view.MaximumSize = new Size2D(100, 200);
2764 /// This way to set the property is prohibited
2766 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2769 /// <since_tizen> 3 </since_tizen>
2770 public Size2D MaximumSize
2774 #if NUI_PROPERTY_CHANGE_DEBUG
2775 MaximumSizeGetter++;
2777 return (Size2D)GetValue(MaximumSizeProperty);
2781 #if NUI_PROPERTY_CHANGE_DEBUG
2782 MaximumSizeSetter++;
2784 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2785 // MATCH_PARENT spec + parent container size can be used to limit
2788 layout.RequestLayout();
2790 SetValue(MaximumSizeProperty, value);
2791 NotifyPropertyChanged();
2796 /// Gets or sets whether a child view inherits it's parent's position.<br />
2797 /// Default is to inherit.<br />
2798 /// 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 />
2800 /// <since_tizen> 3 </since_tizen>
2801 public bool InheritPosition
2805 #if NUI_PROPERTY_CHANGE_DEBUG
2806 InheritPositionGetter++;
2808 return (bool)GetValue(InheritPositionProperty);
2812 #if NUI_PROPERTY_CHANGE_DEBUG
2813 InheritPositionSetter++;
2815 SetValue(InheritPositionProperty, value);
2816 NotifyPropertyChanged();
2821 /// Gets or sets the clipping behavior (mode) of it's children.
2823 /// <since_tizen> 3 </since_tizen>
2824 public ClippingModeType ClippingMode
2828 #if NUI_PROPERTY_CHANGE_DEBUG
2829 ClippingModeGetter++;
2831 return (ClippingModeType)GetValue(ClippingModeProperty);
2835 #if NUI_PROPERTY_CHANGE_DEBUG
2836 ClippingModeSetter++;
2838 SetValue(ClippingModeProperty, value);
2839 NotifyPropertyChanged();
2844 /// Gets the number of renderers held by the view.
2846 /// <since_tizen> 3 </since_tizen>
2847 public uint RendererCount
2851 return GetRendererCount();
2856 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2859 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2861 /// <since_tizen> 3 </since_tizen>
2862 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2864 "View view = new View(); " +
2865 "view.PivotPoint = PivotPoint.Center; " +
2866 "view.PositionUsesPivotPoint = true;")]
2867 [EditorBrowsable(EditorBrowsableState.Never)]
2868 public Position AnchorPoint
2872 return GetValue(AnchorPointProperty) as Position;
2876 SetValue(AnchorPointProperty, value);
2880 private Position InternalAnchorPoint
2884 Position temp = new Position(0.0f, 0.0f, 0.0f);
2885 var pValue = GetProperty(View.Property.AnchorPoint);
2888 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2894 var temp = new Tizen.NUI.PropertyValue(value);
2895 SetProperty(View.Property.AnchorPoint, temp);
2897 NotifyPropertyChanged();
2902 /// Sets the size of a view for the width, the height and the depth.<br />
2903 /// Geometry can be scaled to fit within this area.<br />
2904 /// This does not interfere with the view's scale factor.<br />
2905 /// The views default depth is the minimum of width and height.<br />
2909 /// Animatable - This property can be animated using <c>Animation</c> class.
2911 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2914 /// The property cascade chaining set is not recommended.
2917 /// This way is recommended for setting the property
2919 /// var view = new View();
2920 /// view.Size = new Size(100.5f, 200, 0);
2922 /// This way to set the property is prohibited
2924 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2927 /// <since_tizen> 5 </since_tizen>
2932 #if NUI_PROPERTY_CHANGE_DEBUG
2935 return (Size)GetValue(SizeProperty);
2939 #if NUI_PROPERTY_CHANGE_DEBUG
2942 SetValue(SizeProperty, value);
2943 NotifyPropertyChanged();
2948 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2950 /// <since_tizen> 3 </since_tizen>
2951 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2953 "Container parent = view.GetParent(); " +
2954 "View view = parent as View;")]
2955 [EditorBrowsable(EditorBrowsableState.Never)]
2956 public new View Parent
2961 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2962 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2963 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2965 if (basehandle is Layer layer)
2967 ret = new View(Layer.getCPtr(layer).Handle, false);
2968 NUILog.Error("This Parent property is deprecated, should do not be used");
2972 ret = basehandle as View;
2975 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2976 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2978 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2984 /// Gets/Sets whether inherit parent's the layout Direction.
2986 /// <since_tizen> 4 </since_tizen>
2987 public bool InheritLayoutDirection
2991 #if NUI_PROPERTY_CHANGE_DEBUG
2992 InheritLayoutDirectionGetter++;
2994 return (bool)GetValue(InheritLayoutDirectionProperty);
2998 #if NUI_PROPERTY_CHANGE_DEBUG
2999 InheritLayoutDirectionSetter++;
3001 SetValue(InheritLayoutDirectionProperty, value);
3002 NotifyPropertyChanged();
3007 /// Gets/Sets the layout Direction.
3009 /// <since_tizen> 4 </since_tizen>
3010 public ViewLayoutDirectionType LayoutDirection
3014 #if NUI_PROPERTY_CHANGE_DEBUG
3015 LayoutDirectionGetter++;
3017 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
3021 #if NUI_PROPERTY_CHANGE_DEBUG
3022 LayoutDirectionSetter++;
3024 SetValue(LayoutDirectionProperty, value);
3025 NotifyPropertyChanged();
3026 layout?.RequestLayout();
3031 /// Gets or sets the Margin for use in layout.
3034 /// Margin property is supported by Layout algorithms and containers.
3035 /// Please Set Layout if you want to use Margin property.
3036 /// The property cascade chaining set is not recommended.
3039 /// This way is recommended for setting the property
3041 /// var view = new View();
3042 /// view.Margin = new Extents(10, 5, 15, 20);
3044 /// This way to set the property is prohibited
3046 /// view.Margin.Top = 15; //This does not guarantee a proper operation
3049 /// <since_tizen> 4 </since_tizen>
3050 public Extents Margin
3054 return (Extents)GetValue(MarginProperty);
3058 SetValue(MarginProperty, value);
3059 NotifyPropertyChanged();
3064 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
3068 /// // matchParentView matches its size to its parent size.
3069 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
3070 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
3072 /// // wrapContentView wraps its children with their desired size.
3073 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
3074 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
3076 /// // exactSizeView shows itself with an exact size.
3077 /// exactSizeView.WidthSpecification = 100;
3078 /// exactSizeView.HeightSpecification = 100;
3081 /// <since_tizen> 6 </since_tizen>
3082 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
3083 public int WidthSpecification
3087 return (int)GetValue(WidthSpecificationProperty);
3091 SetValue(WidthSpecificationProperty, value);
3092 NotifyPropertyChanged();
3096 private int InternalWidthSpecification
3104 if (value == widthPolicy)
3107 widthPolicy = value;
3108 if (widthPolicy >= 0)
3110 if (heightPolicy >= 0) // Policy an exact value
3112 // Create Size2D only both _widthPolicy and _heightPolicy are set.
3113 Size2D = new Size2D(widthPolicy, heightPolicy);
3116 layout?.RequestLayout();
3121 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
3125 /// // matchParentView matches its size to its parent size.
3126 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
3127 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
3129 /// // wrapContentView wraps its children with their desired size.
3130 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
3131 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
3133 /// // exactSizeView shows itself with an exact size.
3134 /// exactSizeView.WidthSpecification = 100;
3135 /// exactSizeView.HeightSpecification = 100;
3138 /// <since_tizen> 6 </since_tizen>
3139 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
3140 public int HeightSpecification
3144 return (int)GetValue(HeightSpecificationProperty);
3148 SetValue(HeightSpecificationProperty, value);
3149 NotifyPropertyChanged();
3153 private int InternalHeightSpecification
3157 return heightPolicy;
3161 if (value == heightPolicy)
3164 heightPolicy = value;
3165 if (heightPolicy >= 0)
3167 if (widthPolicy >= 0) // Policy an exact value
3169 // Create Size2D only both _widthPolicy and _heightPolicy are set.
3170 Size2D = new Size2D(widthPolicy, heightPolicy);
3173 layout?.RequestLayout();
3178 /// Gets the List of transitions for this View.
3180 /// <since_tizen> 6 </since_tizen>
3181 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
3185 if (layoutTransitions == null)
3187 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
3189 return layoutTransitions;
3194 /// Sets a layout transitions for this View.
3196 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
3198 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
3200 /// <since_tizen> 6 </since_tizen>
3201 public LayoutTransition LayoutTransition
3205 return GetValue(LayoutTransitionProperty) as LayoutTransition;
3209 SetValue(LayoutTransitionProperty, value);
3210 NotifyPropertyChanged();
3214 private LayoutTransition InternalLayoutTransition
3218 return layoutTransition;
3224 throw new global::System.ArgumentNullException(nameof(value));
3226 if (layoutTransitions == null)
3228 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
3231 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
3233 AttachTransitionsToChildren(value);
3235 layoutTransition = value;
3240 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
3243 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
3245 /// <since_tizen> 4 </since_tizen>
3246 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
3247 [EditorBrowsable(EditorBrowsableState.Never)]
3248 public Extents PaddingEX
3252 return GetValue(PaddingEXProperty) as Extents;
3256 SetValue(PaddingEXProperty, value);
3260 private Extents InternalPaddingEX
3264 Extents temp = new Extents(0, 0, 0, 0);
3265 var pValue = GetProperty(View.Property.PADDING);
3268 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
3274 var temp = new Tizen.NUI.PropertyValue(value);
3275 SetProperty(View.Property.PADDING, temp);
3277 NotifyPropertyChanged();
3278 layout?.RequestLayout();
3283 /// The Color of View. This is an RGBA value.
3284 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
3285 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
3286 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
3287 /// Inherient of color value depend on <see cref="ColorMode"/>.
3291 /// Animatable - This property can be animated using <c>Animation</c> class.
3293 /// The property cascade chaining set is not recommended.
3296 /// This way is recommended for setting the property
3298 /// var view = new View();
3299 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
3301 /// This way to set the property is prohibited
3303 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
3306 [EditorBrowsable(EditorBrowsableState.Never)]
3311 #if NUI_PROPERTY_CHANGE_DEBUG
3314 return (Color)GetValue(ColorProperty);
3318 #if NUI_PROPERTY_CHANGE_DEBUG
3321 SetValue(ColorProperty, value);
3322 NotifyPropertyChanged();
3327 /// The Red component of View.Color.
3331 /// Animatable - This property can be animated using <c>Animation</c> class.
3334 [EditorBrowsable(EditorBrowsableState.Never)]
3335 public float ColorRed
3339 #if NUI_PROPERTY_CHANGE_DEBUG
3342 return (float)GetValue(ColorRedProperty);
3346 #if NUI_PROPERTY_CHANGE_DEBUG
3349 SetValue(ColorRedProperty, value);
3350 NotifyPropertyChanged();
3355 /// The Green component of View.Color.
3359 /// Animatable - This property can be animated using <c>Animation</c> class.
3362 [EditorBrowsable(EditorBrowsableState.Never)]
3363 public float ColorGreen
3367 #if NUI_PROPERTY_CHANGE_DEBUG
3370 return (float)GetValue(ColorGreenProperty);
3374 #if NUI_PROPERTY_CHANGE_DEBUG
3377 SetValue(ColorGreenProperty, value);
3378 NotifyPropertyChanged();
3383 /// The Blue component of View.Color.
3387 /// Animatable - This property can be animated using <c>Animation</c> class.
3390 [EditorBrowsable(EditorBrowsableState.Never)]
3391 public float ColorBlue
3395 #if NUI_PROPERTY_CHANGE_DEBUG
3398 return (float)GetValue(ColorBlueProperty);
3402 #if NUI_PROPERTY_CHANGE_DEBUG
3405 SetValue(ColorBlueProperty, value);
3406 NotifyPropertyChanged();
3411 /// Set the layout on this View. Replaces any existing Layout.
3414 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
3416 /// <since_tizen> 6 </since_tizen>
3417 public LayoutItem Layout
3421 return GetValue(LayoutProperty) as LayoutItem;
3425 SetValue(LayoutProperty, value);
3429 private LayoutItem InternalLayout
3437 // Do nothing if layout provided is already set on this View.
3438 if (value == layout)
3443 LayoutingDisabled = false;
3446 // If new layout being set already has a owner then that owner receives a replacement default layout.
3447 // First check if the layout to be set already has a owner.
3448 if (value?.Owner != null)
3450 // Previous owner of the layout gets a default layout as a replacement.
3451 value.Owner.Layout = new AbsoluteLayout()
3453 // Copy Margin and Padding to replacement LayoutGroup.
3454 Margin = value.Margin,
3455 Padding = value.Padding,
3459 // Copy Margin and Padding to new layout being set or restore padding and margin back to
3460 // View if no replacement. Previously margin and padding values would have been moved from
3461 // the View to the layout.
3462 if (layout != null) // Existing layout
3466 // Existing layout being replaced so copy over margin and padding values.
3467 value.Margin = layout.Margin;
3468 value.Padding = layout.Padding;
3469 value.SetPositionByLayout = !excludeLayouting;
3473 // Layout not being replaced so restore margin and padding to View.
3474 SetValue(MarginProperty, layout.Margin);
3475 SetValue(PaddingProperty, layout.Padding);
3476 NotifyPropertyChanged();
3481 // First Layout to be added to the View hence copy
3483 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
3486 Extents margin = Margin;
3487 Extents padding = Padding;
3488 bool setMargin = false;
3489 bool setPadding = false;
3491 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
3493 // If View already has a margin set then store it in Layout instead.
3494 value.Margin = margin;
3495 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
3499 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
3501 // If View already has a padding set then store it in Layout instead.
3502 value.Padding = padding;
3503 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
3507 if (setMargin || setPadding)
3509 NotifyPropertyChanged();
3512 value.SetPositionByLayout = !excludeLayouting;
3516 // Remove existing layout from it's parent layout group.
3519 // Set layout to this view
3525 /// The weight of the View, used to share available space in a layout with siblings.
3527 /// <since_tizen> 6 </since_tizen>
3537 layout?.RequestLayout();
3542 /// Whether to load the BackgroundImage synchronously.
3543 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3544 /// Note: For Normal Quad images only.
3546 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3547 [EditorBrowsable(EditorBrowsableState.Never)]
3548 public bool BackgroundImageSynchronosLoading
3552 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3556 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3557 NotifyPropertyChanged();
3561 private bool InternalBackgroundImageSynchronosLoading
3565 return BackgroundImageSynchronousLoading;
3569 BackgroundImageSynchronousLoading = value;
3574 /// Whether to load the BackgroundImage synchronously.
3575 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3576 /// Note: For Normal Quad images only.
3578 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3579 [EditorBrowsable(EditorBrowsableState.Never)]
3580 public bool BackgroundImageSynchronousLoading
3584 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3588 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3589 NotifyPropertyChanged();
3593 private bool InternalBackgroundImageSynchronousLoading
3597 return backgroundImageSynchronousLoading;
3601 backgroundImageSynchronousLoading = value;
3603 string bgUrl = null;
3604 var pValue = Background.Find(ImageVisualProperty.URL);
3605 pValue?.Get(out bgUrl);
3608 if (!string.IsNullOrEmpty(bgUrl))
3610 PropertyMap bgMap = this.Background;
3611 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3612 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3619 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3620 [EditorBrowsable(EditorBrowsableState.Never)]
3621 public Vector4 UpdateAreaHint
3625 #if NUI_PROPERTY_CHANGE_DEBUG
3626 UpdateAreaHintGetter++;
3628 return (Vector4)GetValue(UpdateAreaHintProperty);
3632 #if NUI_PROPERTY_CHANGE_DEBUG
3633 UpdateAreaHintSetter++;
3635 SetValue(UpdateAreaHintProperty, value);
3636 NotifyPropertyChanged();
3641 /// Enable/Disable ControlState propagation for children.
3642 /// It is false by default.
3643 /// If the View needs to share ControlState with descendants, please set it true.
3644 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3646 [EditorBrowsable(EditorBrowsableState.Never)]
3647 public bool EnableControlStatePropagation
3651 return (bool)GetValue(EnableControlStatePropagationProperty);
3655 SetValue(EnableControlStatePropagationProperty, value);
3656 NotifyPropertyChanged();
3660 private bool InternalEnableControlStatePropagation
3662 get => themeData?.ControlStatePropagation ?? false;
3665 if (InternalEnableControlStatePropagation == value) return;
3667 if (themeData == null) themeData = new ThemeData();
3669 themeData.ControlStatePropagation = value;
3671 foreach (View child in Children)
3673 child.EnableControlStatePropagation = value;
3679 /// The ControlStates can propagate from the parent.
3680 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3681 /// if parent view EnableControlState is true.
3682 /// <see cref="EnableControlState"/>.
3683 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3685 [EditorBrowsable(EditorBrowsableState.Never)]
3686 public ControlState PropagatableControlStates
3690 return (ControlState)GetValue(PropagatableControlStatesProperty);
3694 SetValue(PropagatableControlStatesProperty, value);
3695 NotifyPropertyChanged();
3699 private ControlState InternalPropagatableControlStates
3701 get => propagatableControlStates;
3702 set => propagatableControlStates = value;
3706 /// By default, it is false in View, true in Control.
3707 /// Note that if the value is true, the View will be a touch receptor.
3709 [EditorBrowsable(EditorBrowsableState.Never)]
3710 public bool EnableControlState
3714 return (bool)GetValue(EnableControlStateProperty);
3718 SetValue(EnableControlStateProperty, value);
3723 /// Whether the actor grab all touches even if touch leaves its boundary.
3725 /// <returns>true, if it grab all touch after start</returns>
3726 [EditorBrowsable(EditorBrowsableState.Never)]
3727 public bool GrabTouchAfterLeave
3731 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3735 SetValue(GrabTouchAfterLeaveProperty, value);
3739 private bool InternalGrabTouchAfterLeave
3744 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
3745 pValue.Get(out temp);
3751 var temp = new Tizen.NUI.PropertyValue(value);
3752 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
3754 NotifyPropertyChanged();
3759 /// Whether the view will only receive own touch.
3761 /// <returns>true, if it only receives touches that started from itself.</returns>
3762 [EditorBrowsable(EditorBrowsableState.Never)]
3763 public bool AllowOnlyOwnTouch
3767 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3771 SetValue(AllowOnlyOwnTouchProperty, value);
3775 private bool InternalAllowOnlyOwnTouch
3780 var pValue = GetProperty(View.Property.AllowOnlyOwnTouch);
3781 pValue.Get(out temp);
3787 var temp = new Tizen.NUI.PropertyValue(value);
3788 SetProperty(View.Property.AllowOnlyOwnTouch, temp);
3790 NotifyPropertyChanged();
3795 /// Determines which blend equation will be used to render renderers of this actor.
3797 /// <returns>blend equation enum currently assigned</returns>
3798 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3799 [EditorBrowsable(EditorBrowsableState.Never)]
3800 public BlendEquationType BlendEquation
3804 return (BlendEquationType)GetValue(BlendEquationProperty);
3808 SetValue(BlendEquationProperty, value);
3812 private BlendEquationType InternalBlendEquation
3817 var pValue = GetProperty(View.Property.BlendEquation);
3818 pValue.Get(out temp);
3820 return (BlendEquationType)temp;
3824 var temp = new Tizen.NUI.PropertyValue((int)value);
3825 SetProperty(View.Property.BlendEquation, temp);
3827 NotifyPropertyChanged();
3832 /// If the value is true, the View will change its style as the theme changes.
3833 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3835 /// <since_tizen> 9 </since_tizen>
3836 public bool ThemeChangeSensitive
3838 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3839 set => SetValue(ThemeChangeSensitiveProperty, value);
3843 /// Create Style, it is abstract function and must be override.
3845 [EditorBrowsable(EditorBrowsableState.Never)]
3846 protected virtual ViewStyle CreateViewStyle()
3848 return new ViewStyle();
3852 /// Called after the View's ControlStates changed.
3854 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3855 [EditorBrowsable(EditorBrowsableState.Never)]
3856 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3862 [EditorBrowsable(EditorBrowsableState.Never)]
3863 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3865 isThemeChanged = true;
3866 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3867 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3868 isThemeChanged = false;
3872 /// Apply style instance to the view.
3873 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3875 /// <since_tizen> 9 </since_tizen>
3876 public virtual void ApplyStyle(ViewStyle viewStyle)
3878 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3880 if (themeData == null) themeData = new ThemeData();
3882 themeData.viewStyle = viewStyle;
3884 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3890 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3892 if (bindablePropertyOfView == null)
3897 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3898 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3900 foreach (var sourceProperty in dirtyStyleProperties)
3902 var sourceValue = viewStyle.GetValue(sourceProperty);
3904 if (sourceValue == null)
3909 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3911 // Do not set value again when theme is changed and the value has been set already.
3912 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3917 if (destinationProperty != null)
3919 InternalSetValue(destinationProperty, sourceValue);
3925 /// Get whether the View is culled or not.
3926 /// True means that the View is out of the view frustum.
3929 /// Hidden-API (Inhouse-API).
3931 [EditorBrowsable(EditorBrowsableState.Never)]
3937 var pValue = GetProperty(View.Property.Culled);
3938 pValue.Get(out temp);
3945 /// Set or Get TransitionOptions for the page transition.
3946 /// This property is used to define how this view will be transitioned during Page switching.
3948 /// <since_tizen> 9 </since_tizen>
3949 public TransitionOptions TransitionOptions
3953 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3957 SetValue(TransitionOptionsProperty, value);
3958 NotifyPropertyChanged();
3962 private TransitionOptions InternalTransitionOptions
3966 transitionOptions = value;
3970 return transitionOptions;
3975 /// Gets or sets the status of whether the view should emit key event signals.
3976 /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
3978 [EditorBrowsable(EditorBrowsableState.Never)]
3979 public bool DispatchKeyEvents
3983 #if NUI_PROPERTY_CHANGE_DEBUG
3984 DispatchKeyEventsGetter++;
3986 return (bool)GetValue(DispatchKeyEventsProperty);
3990 #if NUI_PROPERTY_CHANGE_DEBUG
3991 DispatchKeyEventsSetter++;
3993 SetValue(DispatchKeyEventsProperty, value);
3994 NotifyPropertyChanged();
3999 /// Gets or sets the status of whether touch events can be dispatched.
4000 /// 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.
4001 /// This works without adding a TouchEvent callback in the View.
4003 /// 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.
4006 [EditorBrowsable(EditorBrowsableState.Never)]
4007 public bool DispatchTouchEvents
4011 return dispatchTouchEvents;
4015 if (dispatchTouchEvents != value)
4017 dispatchTouchEvents = value;
4018 if (dispatchTouchEvents == false)
4020 TouchEvent += OnDispatchTouchEvent;
4024 TouchEvent -= OnDispatchTouchEvent;
4030 private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
4036 /// Gets or sets the status of whether the view should emit Gesture event signals.
4037 /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
4038 /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
4040 [EditorBrowsable(EditorBrowsableState.Never)]
4041 public bool DispatchGestureEvents
4045 return dispatchGestureEvents;
4049 if (dispatchGestureEvents != value)
4051 dispatchGestureEvents = value;
4052 ConfigGestureDetector(dispatchGestureEvents);
4058 /// Gets or sets the status of whether the view should emit Gesture event signals.
4059 /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
4060 /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
4062 [EditorBrowsable(EditorBrowsableState.Never)]
4063 public bool DispatchParentGestureEvents
4067 return dispatchParentGestureEvents;
4071 if (dispatchParentGestureEvents != value)
4073 dispatchParentGestureEvents = value;
4074 ConfigGestureDetector(dispatchParentGestureEvents);
4079 private void ConfigGestureDetector(bool dispatch)
4081 if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
4082 if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
4083 if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
4084 if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
4085 if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
4087 if (dispatch == true)
4089 configGestureCount = configGestureCount > 0 ? configGestureCount-- : 0;
4090 if (configGestureCount == 0)
4092 panGestureDetector.Detach(this);
4093 longGestureDetector.Detach(this);
4094 pinchGestureDetector.Detach(this);
4095 tapGestureDetector.Detach(this);
4096 rotationGestureDetector.Detach(this);
4098 panGestureDetector.Detected -= OnGestureDetected;
4099 longGestureDetector.Detected -= OnGestureDetected;
4100 pinchGestureDetector.Detected -= OnGestureDetected;
4101 tapGestureDetector.Detected -= OnGestureDetected;
4102 rotationGestureDetector.Detected -= OnGestureDetected;
4104 panGestureDetector = null;
4105 longGestureDetector = null;
4106 pinchGestureDetector = null;
4107 tapGestureDetector = null;
4108 rotationGestureDetector = null;
4113 if (configGestureCount == 0)
4115 panGestureDetector.Attach(this);
4116 longGestureDetector.Attach(this);
4117 pinchGestureDetector.Attach(this);
4118 tapGestureDetector.Attach(this);
4119 rotationGestureDetector.Attach(this);
4121 panGestureDetector.Detected += OnGestureDetected;
4122 longGestureDetector.Detected += OnGestureDetected;
4123 pinchGestureDetector.Detected += OnGestureDetected;
4124 tapGestureDetector.Detected += OnGestureDetected;
4125 rotationGestureDetector.Detected += OnGestureDetected;
4127 configGestureCount++;
4131 private void OnGestureDetected(object source, EventArgs e)
4133 // Does notting. This is to consume the gesture.
4137 /// Called when the view is hit through TouchEvent or GestureEvent.
4138 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
4139 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
4140 /// User can override whether hit or not in HitTest.
4141 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
4142 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
4144 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
4145 [EditorBrowsable(EditorBrowsableState.Never)]
4146 protected virtual bool HitTest(Touch touch)
4152 /// Retrieve the View's current Color.
4155 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
4156 /// 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).
4157 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
4158 /// and users can get the current actual values through them.
4160 [EditorBrowsable(EditorBrowsableState.Never)]
4161 public Color CurrentColor => GetCurrentColor();
4164 /// Retrieve the current scale factor applied to the View.
4167 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
4168 /// 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).
4169 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
4170 /// and users can get the current actual values through them.
4172 [EditorBrowsable(EditorBrowsableState.Never)]
4173 public Vector3 CurrentScale => GetCurrentScale();