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 Position internalCurrentParentOrigin = null;
91 private Position 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;
102 #if NUI_VISUAL_PROPERTY_CHANGE_1
103 private Vector2 internalCurrentScreenPosition = null;
108 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
109 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
110 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
111 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
113 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
114 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
115 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
116 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
118 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
119 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
120 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
121 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
123 RegisterAccessibilityDelegate();
127 /// Creates a new instance of a view.
129 /// <since_tizen> 3 </since_tizen>
130 public View() : this(Interop.View.New(), true)
132 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
135 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
136 [EditorBrowsable(EditorBrowsableState.Never)]
137 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
142 /// Create a new instance of a View with setting the status of shown or hidden.
144 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
145 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
146 [EditorBrowsable(EditorBrowsableState.Never)]
147 public View(bool shown) : this(Interop.View.New(), true)
149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
164 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
166 InitializeStyle(viewStyle);
169 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
173 PositionUsesPivotPoint = false;
176 onWindowSendEventCallback = SendViewAddedEventToWindow;
177 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
178 signal?.Connect(onWindowSendEventCallback);
180 hitTestResultDataCallback = OnHitTestResult;
181 using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
182 touchDataSignal?.Connect(hitTestResultDataCallback);
189 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
190 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
193 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
204 /// The event that is triggered when the View's ControlState is changed.
206 [EditorBrowsable(EditorBrowsableState.Never)]
207 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
209 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
213 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
215 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
216 [EditorBrowsable(EditorBrowsableState.Never)]
217 public bool LayoutSet
226 /// Flag to allow Layouting to be disabled for Views.
227 /// Once a View has a Layout set then any children added to Views from then on will receive
228 /// automatic Layouts.
230 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
231 [EditorBrowsable(EditorBrowsableState.Never)]
232 public static bool LayoutingDisabled { get; set; } = true;
235 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
237 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
238 [EditorBrowsable(EditorBrowsableState.Never)]
239 public static void SetDefaultGrabTouchAfterLeave(bool enable)
241 defaultGrabTouchAfterLeave = enable;
245 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
247 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
248 [EditorBrowsable(EditorBrowsableState.Never)]
249 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
251 defaultAllowOnlyOwnTouch = enable;
255 /// Deprecate. Do not use this.
256 /// The style instance applied to this view.
257 /// Note that do not modify the ViewStyle.
258 /// Modifying ViewStyle will affect other views with same ViewStyle.
260 [EditorBrowsable(EditorBrowsableState.Never)]
261 protected ViewStyle ViewStyle
265 if (themeData == null) themeData = new ThemeData();
267 if (themeData.viewStyle == null)
269 ApplyStyle(CreateViewStyle());
271 return themeData.viewStyle;
276 /// Get/Set the control state.
277 /// Note that the ControlState only available for the classes derived from Control.
278 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
279 /// please set <see cref="EnableControlState"/> to true.
281 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
282 [EditorBrowsable(EditorBrowsableState.Never)]
283 public ControlState ControlState
287 return themeData == null ? ControlState.Normal : themeData.controlStates;
291 if (ControlState == value)
296 var prevState = ControlState;
298 if (themeData == null) themeData = new ThemeData();
299 themeData.controlStates = value;
301 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
303 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
305 if (themeData.ControlStatePropagation)
307 foreach (View child in Children)
309 ControlState allowed = child.PropagatableControlStates;
310 if (allowed.Contains(ControlState.All))
312 child.ControlState = value;
316 ControlState newControlState = child.ControlState;
318 if (allowed.Contains(ControlState.Normal))
320 if (value.Contains(ControlState.Normal))
322 newControlState += ControlState.Normal;
326 newControlState -= ControlState.Normal;
330 if (allowed.Contains(ControlState.Disabled))
332 if (value.Contains(ControlState.Disabled))
334 newControlState += ControlState.Disabled;
338 newControlState -= ControlState.Disabled;
342 if (allowed.Contains(ControlState.Selected))
344 if (value.Contains(ControlState.Selected))
346 newControlState += ControlState.Selected;
350 newControlState -= ControlState.Selected;
354 if (allowed.Contains(ControlState.Pressed))
356 if (value.Contains(ControlState.Pressed))
358 newControlState += ControlState.Pressed;
362 newControlState -= ControlState.Pressed;
366 if (allowed.Contains(ControlState.Focused))
368 if (value.Contains(ControlState.Focused))
370 newControlState += ControlState.Focused;
374 newControlState -= ControlState.Focused;
378 if (allowed.Contains(ControlState.Other))
380 if (value.Contains(ControlState.Other))
382 newControlState += ControlState.Other;
386 newControlState -= ControlState.Other;
390 if (child.ControlState != newControlState)
391 child.ControlState = newControlState;
396 OnControlStateChanged(changeInfo);
398 ControlStateChangedEvent?.Invoke(this, changeInfo);
403 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
405 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
406 [EditorBrowsable(EditorBrowsableState.Never)]
407 public bool ExcludeLayouting
411 return (bool)GetValue(ExcludeLayoutingProperty);
415 SetValue(ExcludeLayoutingProperty, value);
416 NotifyPropertyChanged();
420 private bool InternalExcludeLayouting
424 return excludeLayouting;
428 excludeLayouting = value;
429 if (Layout != null && Layout.SetPositionByLayout == value)
431 Layout.SetPositionByLayout = !value;
432 Layout.RequestLayout();
438 /// The StyleName, type string.
439 /// The value indicates DALi style name defined in json theme file.
441 /// <since_tizen> 3 </since_tizen>
442 public string StyleName
446 return (string)GetValue(StyleNameProperty);
450 SetValue(StyleNameProperty, value);
451 NotifyPropertyChanged();
456 /// The KeyInputFocus, type bool.
458 [EditorBrowsable(EditorBrowsableState.Never)]
459 public bool KeyInputFocus
463 return (bool)GetValue(KeyInputFocusProperty);
467 SetValue(KeyInputFocusProperty, value);
468 NotifyPropertyChanged();
473 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
477 /// The property cascade chaining set is not recommended.
480 /// Animatable - This property can be animated using <c>Animation</c> class.
482 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
487 /// This way is recommended for setting the property
489 /// var view = new View();
490 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
492 /// This way to set the property is prohibited
494 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
497 /// <since_tizen> 3 </since_tizen>
498 public Color BackgroundColor
502 return (Color)GetValue(BackgroundColorProperty);
506 SetValue(BackgroundColorProperty, value);
507 NotifyPropertyChanged();
512 /// The mutually exclusive with "backgroundColor" and "background" type Map.
514 /// <since_tizen> 3 </since_tizen>
515 public string BackgroundImage
519 return (string)GetValue(BackgroundImageProperty);
523 SetValue(BackgroundImageProperty, value);
524 NotifyPropertyChanged();
529 /// Get or set the border of background image.
531 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
532 [EditorBrowsable(EditorBrowsableState.Never)]
533 public Rectangle BackgroundImageBorder
537 return (Rectangle)GetValue(BackgroundImageBorderProperty);
541 SetValue(BackgroundImageBorderProperty, value);
542 NotifyPropertyChanged();
547 /// The background of view.
549 /// <since_tizen> 3 </since_tizen>
550 public Tizen.NUI.PropertyMap Background
554 return (PropertyMap)GetValue(BackgroundProperty);
558 SetValue(BackgroundProperty, value);
559 NotifyPropertyChanged();
564 /// Describes a shadow as an image for a View.
565 /// It is null by default.
568 /// Getter returns copied instance of current shadow.
571 /// The mutually exclusive with "BoxShadow".
575 /// Animatable - This property can be animated using <c>Animation</c> class.
576 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
578 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
580 /// Animatable sub-property : Offset.
583 [EditorBrowsable(EditorBrowsableState.Never)]
584 public ImageShadow ImageShadow
588 return (ImageShadow)GetValue(ImageShadowProperty);
592 SetValue(ImageShadowProperty, value);
593 NotifyPropertyChanged();
598 /// Describes a box shaped shadow drawing for a View.
599 /// It is null by default.
602 /// The mutually exclusive with "ImageShadow".
606 /// Animatable - This property can be animated using <c>Animation</c> class.
607 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
609 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
611 /// Animatable sub-property : Offset, Color, BlurRadius.
614 /// <since_tizen> 9 </since_tizen>
615 public Shadow BoxShadow
619 return (Shadow)GetValue(BoxShadowProperty);
623 SetValue(BoxShadowProperty, value);
624 NotifyPropertyChanged();
629 /// The radius for the rounded corners of the View.
630 /// This will rounds background and shadow edges.
631 /// 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).
632 /// Each radius will clamp internally to the half of smaller of the view's width or height.
633 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
637 /// Animatable - This property can be animated using <c>Animation</c> class.
639 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
643 /// <since_tizen> 9 </since_tizen>
644 public Vector4 CornerRadius
648 return (Vector4)GetValue(CornerRadiusProperty);
652 SetValue(CornerRadiusProperty, value);
653 NotifyPropertyChanged();
658 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
659 /// It is absolute by default.
660 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
662 /// <since_tizen> 9 </since_tizen>
663 public VisualTransformPolicyType CornerRadiusPolicy
665 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
666 set => SetValue(CornerRadiusPolicyProperty, value);
670 /// The width for the borderline of the View.
674 /// Animatable - This property can be animated using <c>Animation</c> class.
676 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
679 /// Note that, an image background may not have borderline if it uses the Border property.
681 /// <since_tizen> 9 </since_tizen>
682 public float BorderlineWidth
686 return (float)GetValue(BorderlineWidthProperty);
690 SetValue(BorderlineWidthProperty, value);
691 NotifyPropertyChanged();
696 /// The color for the borderline of the View.
697 /// It is Color.Black by default.
701 /// Animatable - This property can be animated using <c>Animation</c> class.
703 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
707 /// <since_tizen> 9 </since_tizen>
708 public Color BorderlineColor
712 return (Color)GetValue(BorderlineColorProperty);
716 SetValue(BorderlineColorProperty, value);
717 NotifyPropertyChanged();
722 /// The color selector for the borderline of the View.
723 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
724 /// So this API is internally used only.
726 internal Selector<Color> BorderlineColorSelector
730 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
734 SetValue(BorderlineColorSelectorProperty, value);
735 NotifyPropertyChanged();
740 /// The Relative offset for the borderline of the View.
741 /// Recommended range : [-1.0f to 1.0f].
742 /// If -1.0f, draw borderline inside of the View.
743 /// If 1.0f, draw borderline outside of the View.
744 /// If 0.0f, draw borderline half inside and half outside.
745 /// It is 0.0f by default.
749 /// Animatable - This property can be animated using <c>Animation</c> class.
751 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
755 /// <since_tizen> 9 </since_tizen>
756 public float BorderlineOffset
760 return (float)GetValue(BorderlineOffsetProperty);
764 SetValue(BorderlineOffsetProperty, value);
765 NotifyPropertyChanged();
770 /// The current state of the view.
772 /// <since_tizen> 3 </since_tizen>
777 return (States)GetValue(StateProperty);
781 SetValue(StateProperty, value);
782 NotifyPropertyChanged();
787 /// The current sub state of the view.
789 /// <since_tizen> 3 </since_tizen>
790 public States SubState
794 return (States)GetValue(SubStateProperty);
798 SetValue(SubStateProperty, value);
799 NotifyPropertyChanged();
804 /// Displays a tooltip
806 /// <since_tizen> 3 </since_tizen>
807 public Tizen.NUI.PropertyMap Tooltip
811 return (PropertyMap)GetValue(TooltipProperty);
815 SetValue(TooltipProperty, value);
816 NotifyPropertyChanged();
821 /// Displays a tooltip as a text.
823 /// <since_tizen> 3 </since_tizen>
824 public string TooltipText
828 return GetValue(TooltipTextProperty) as string;
832 SetValue(TooltipTextProperty, value);
836 private string InternalTooltipText
840 using (var propertyValue = GetProperty(Property.TOOLTIP))
842 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
844 return retrivedValue;
846 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
847 return "error to get TooltipText";
852 var temp = new Tizen.NUI.PropertyValue(value);
853 SetProperty(View.Property.TOOLTIP, temp);
855 NotifyPropertyChanged();
860 /// The Child property of FlexContainer.<br />
861 /// The proportion of the free space in the container, the flex item will receive.<br />
862 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
864 /// <since_tizen> 3 </since_tizen>
865 [Obsolete("Deprecated in API8, will be removed in API10.")]
870 return (float)GetValue(FlexProperty);
874 SetValue(FlexProperty, value);
875 NotifyPropertyChanged();
880 /// The Child property of FlexContainer.<br />
881 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
883 /// <since_tizen> 3 </since_tizen>
884 [Obsolete("Deprecated in API8, will be removed in API10.")]
889 return (int)GetValue(AlignSelfProperty);
893 SetValue(AlignSelfProperty, value);
894 NotifyPropertyChanged();
899 /// The Child property of FlexContainer.<br />
900 /// The space around the flex item.<br />
903 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
905 /// <since_tizen> 3 </since_tizen>
906 [Obsolete("Deprecated in API8, will be removed in API10.")]
907 public Vector4 FlexMargin
911 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
912 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
916 SetValue(FlexMarginProperty, value);
917 NotifyPropertyChanged();
922 /// The top-left cell this child occupies, if not set, the first available cell is used.
925 /// The property cascade chaining set is not recommended.
926 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
929 /// This way is recommended for setting the property
931 /// var view = new View();
932 /// view.CellIndex = new Vector2(1, 3);
934 /// This way to set the property is prohibited
936 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
939 /// <since_tizen> 3 </since_tizen>
940 public Vector2 CellIndex
944 return (Vector2)GetValue(CellIndexProperty);
948 SetValue(CellIndexProperty, value);
949 NotifyPropertyChanged();
954 /// The number of rows this child occupies, if not set, the default value is 1.
957 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
959 /// <since_tizen> 3 </since_tizen>
964 return (float)GetValue(RowSpanProperty);
968 SetValue(RowSpanProperty, value);
969 NotifyPropertyChanged();
974 /// The number of columns this child occupies, if not set, the default value is 1.
977 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
979 /// <since_tizen> 3 </since_tizen>
980 public float ColumnSpan
984 return (float)GetValue(ColumnSpanProperty);
988 SetValue(ColumnSpanProperty, value);
989 NotifyPropertyChanged();
994 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
997 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
999 /// <since_tizen> 3 </since_tizen>
1000 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
1004 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
1008 SetValue(CellHorizontalAlignmentProperty, value);
1009 NotifyPropertyChanged();
1014 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
1017 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
1019 /// <since_tizen> 3 </since_tizen>
1020 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
1024 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
1028 SetValue(CellVerticalAlignmentProperty, value);
1029 NotifyPropertyChanged();
1034 /// The left focusable view.<br />
1035 /// This will return null if not set.<br />
1036 /// This will also return null if the specified left focusable view is not on a window.<br />
1038 /// <since_tizen> 3 </since_tizen>
1039 public View LeftFocusableView
1041 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1044 return (View)GetValue(LeftFocusableViewProperty);
1048 SetValue(LeftFocusableViewProperty, value);
1049 NotifyPropertyChanged();
1054 /// The right focusable view.<br />
1055 /// This will return null if not set.<br />
1056 /// This will also return null if the specified right focusable view is not on a window.<br />
1058 /// <since_tizen> 3 </since_tizen>
1059 public View RightFocusableView
1061 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1064 return (View)GetValue(RightFocusableViewProperty);
1068 SetValue(RightFocusableViewProperty, value);
1069 NotifyPropertyChanged();
1074 /// The up focusable view.<br />
1075 /// This will return null if not set.<br />
1076 /// This will also return null if the specified up focusable view is not on a window.<br />
1078 /// <since_tizen> 3 </since_tizen>
1079 public View UpFocusableView
1081 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1084 return (View)GetValue(UpFocusableViewProperty);
1088 SetValue(UpFocusableViewProperty, value);
1089 NotifyPropertyChanged();
1094 /// The down focusable view.<br />
1095 /// This will return null if not set.<br />
1096 /// This will also return null if the specified down focusable view is not on a window.<br />
1098 /// <since_tizen> 3 </since_tizen>
1099 public View DownFocusableView
1101 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1104 return (View)GetValue(DownFocusableViewProperty);
1108 SetValue(DownFocusableViewProperty, value);
1109 NotifyPropertyChanged();
1114 /// The clockwise focusable view by rotary wheel.<br />
1115 /// This will return null if not set.<br />
1116 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1118 [EditorBrowsable(EditorBrowsableState.Never)]
1119 public View ClockwiseFocusableView
1121 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1124 return (View)GetValue(ClockwiseFocusableViewProperty);
1128 SetValue(ClockwiseFocusableViewProperty, value);
1129 NotifyPropertyChanged();
1134 /// The counter clockwise focusable view by rotary wheel.<br />
1135 /// This will return null if not set.<br />
1136 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1138 [EditorBrowsable(EditorBrowsableState.Never)]
1139 public View CounterClockwiseFocusableView
1141 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1144 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1148 SetValue(CounterClockwiseFocusableViewProperty, value);
1149 NotifyPropertyChanged();
1154 /// Whether the view should be focusable by keyboard navigation.
1156 /// <since_tizen> 3 </since_tizen>
1157 public bool Focusable
1161 SetValue(FocusableProperty, value);
1162 NotifyPropertyChanged();
1166 return (bool)GetValue(FocusableProperty);
1171 /// 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.
1172 /// Note : Default value is true.
1174 [EditorBrowsable(EditorBrowsableState.Never)]
1175 public bool FocusableChildren
1179 SetValue(FocusableChildrenProperty, value);
1180 NotifyPropertyChanged();
1184 return (bool)GetValue(FocusableChildrenProperty);
1189 /// Whether this view can focus by touch.
1190 /// If Focusable is false, FocusableInTouch is disabled.
1191 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1193 [EditorBrowsable(EditorBrowsableState.Never)]
1194 public bool FocusableInTouch
1198 SetValue(FocusableInTouchProperty, value);
1199 NotifyPropertyChanged();
1203 return (bool)GetValue(FocusableInTouchProperty);
1208 /// Retrieves the position of the view.
1209 /// The coordinates are relative to the view's parent.
1212 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1213 /// 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).
1214 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1215 /// and users can get the current actual values through them.
1217 /// <since_tizen> 3 </since_tizen>
1218 public Position CurrentPosition
1222 return GetCurrentPosition();
1227 /// Sets the size of a view for the width and the height.<br />
1228 /// Geometry can be scaled to fit within this area.<br />
1229 /// This does not interfere with the view's scale factor.<br />
1230 /// The views default depth is the minimum of width and height.<br />
1233 /// The property cascade chaining set is not recommended.
1236 /// This way is recommended for setting the property
1238 /// var view = new View();
1239 /// view.Size2D = new Size2D(100, 200);
1241 /// This way to set the property is prohibited
1243 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1246 /// <since_tizen> 3 </since_tizen>
1247 public Size2D Size2D
1251 var temp = (Size2D)GetValue(Size2DProperty);
1253 if (this.Layout == null)
1255 if (temp.Width < 0) { temp.Width = 0; }
1256 if (temp.Height < 0) { temp.Height = 0; }
1263 SetValue(Size2DProperty, value);
1265 NotifyPropertyChanged();
1270 /// Retrieves the size of the view.
1271 /// The coordinates are relative to the view's parent.
1274 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1275 /// 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).
1276 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1277 /// and users can get the current actual values through them.
1279 /// <since_tizen> 3 </since_tizen>
1280 public Size2D CurrentSize
1284 return GetCurrentSize();
1289 /// Retrieves and sets the view's opacity.<br />
1293 /// Animatable - This property can be animated using <c>Animation</c> class.
1295 /// animation.AnimateTo(view, "Opacity", 0.5f);
1299 /// <since_tizen> 3 </since_tizen>
1300 public float Opacity
1304 return (float)GetValue(OpacityProperty);
1308 SetValue(OpacityProperty, value);
1309 NotifyPropertyChanged();
1314 /// Sets the position of the view for X and Y.<br />
1315 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1316 /// If the position inheritance is disabled, sets the world position.<br />
1319 /// The property cascade chaining set is not recommended.
1322 /// This way is recommended for setting the property
1324 /// var view = new View();
1325 /// view.Position2D = new Position2D(100, 200);
1327 /// This way to set the property is prohibited
1329 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1332 /// <since_tizen> 3 </since_tizen>
1333 public Position2D Position2D
1337 return (Position2D)GetValue(Position2DProperty);
1341 SetValue(Position2DProperty, value);
1342 NotifyPropertyChanged();
1347 /// Retrieves the screen position of the view.<br />
1349 /// <since_tizen> 3 </since_tizen>
1350 public Vector2 ScreenPosition
1354 return GetCurrentScreenPosition();
1359 /// Determines whether the pivot point should be used to determine the position of the view.
1360 /// This is false by default.
1362 /// <remarks>If false, then the top-left of the view is used for the position.
1363 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1365 /// <since_tizen> 3 </since_tizen>
1366 public bool PositionUsesPivotPoint
1370 return (bool)GetValue(PositionUsesPivotPointProperty);
1374 SetValue(PositionUsesPivotPointProperty, value);
1375 NotifyPropertyChanged();
1380 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1382 /// <since_tizen> 3 </since_tizen>
1383 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1385 "View view = new View(); " +
1386 "view.PivotPoint = PivotPoint.Center; " +
1387 "view.PositionUsesPivotPoint = true;" +
1388 " This has been deprecated in API5 and will be removed in API8")]
1389 [EditorBrowsable(EditorBrowsableState.Never)]
1390 public bool PositionUsesAnchorPoint
1394 return (bool)GetValue(PositionUsesAnchorPointProperty);
1398 SetValue(PositionUsesAnchorPointProperty, value);
1402 private bool InternalPositionUsesAnchorPoint
1406 #if NUI_VISUAL_PROPERTY_CHANGE_1
1407 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
1410 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1411 pValue.Get(out temp);
1418 #if NUI_VISUAL_PROPERTY_CHANGE_1
1419 Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
1421 var temp = new Tizen.NUI.PropertyValue(value);
1422 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1425 NotifyPropertyChanged();
1430 /// Queries whether the view is connected to the stage.<br />
1431 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1433 /// <since_tizen> 3 </since_tizen>
1434 public bool IsOnWindow
1443 /// Gets the depth in the hierarchy for the view.
1445 /// <since_tizen> 3 </since_tizen>
1446 public int HierarchyDepth
1450 return GetHierarchyDepth();
1455 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1458 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1459 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1460 /// The values set by this property will likely change.
1462 /// <since_tizen> 3 </since_tizen>
1463 public int SiblingOrder
1467 return (int)GetValue(SiblingOrderProperty);
1471 SetValue(SiblingOrderProperty, value);
1473 Layout?.ChangeLayoutSiblingOrder(value);
1475 NotifyPropertyChanged();
1480 /// Returns the natural size of the view.
1483 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1485 /// <since_tizen> 5 </since_tizen>
1486 public Vector3 NaturalSize
1490 Vector3 ret = GetNaturalSize();
1491 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1497 /// Returns the natural size (Size2D) of the view.
1500 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1502 /// <since_tizen> 4 </since_tizen>
1503 public Size2D NaturalSize2D
1507 Vector3 temp = GetNaturalSize();
1508 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1510 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1517 /// Gets or sets the origin of a view within its parent's area.<br />
1518 /// 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 />
1519 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1520 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1522 /// <pre>The view has been initialized.</pre>
1523 /// <since_tizen> 3 </since_tizen>
1524 public Position ParentOrigin
1528 Position tmp = (Position)GetValue(ParentOriginProperty);
1529 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1533 SetValue(ParentOriginProperty, value);
1534 NotifyPropertyChanged();
1539 /// Gets or sets the anchor-point of a view.<br />
1540 /// 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 />
1541 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1542 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1543 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1544 /// <pre>The view has been initialized.</pre>
1547 /// The property cascade chaining set is not recommended.
1550 /// This way is recommended for setting the property
1552 /// var view = new View();
1553 /// view.PivotPoint = PivotPoint.Center;
1555 /// This way to set the property is prohibited
1557 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1560 /// <since_tizen> 3 </since_tizen>
1561 public Position PivotPoint
1565 return (Position)GetValue(PivotPointProperty);
1569 SetValue(PivotPointProperty, value);
1570 NotifyPropertyChanged();
1575 /// Gets or sets the size width of the view.
1579 /// Animatable - This property can be animated using <c>Animation</c> class.
1581 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1585 /// <since_tizen> 3 </since_tizen>
1586 public float SizeWidth
1590 return (float)GetValue(SizeWidthProperty);
1594 SetValue(SizeWidthProperty, value);
1595 NotifyPropertyChanged();
1600 /// Gets or sets the size height of the view.
1604 /// Animatable - This property can be animated using <c>Animation</c> class.
1607 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1610 /// <since_tizen> 3 </since_tizen>
1611 public float SizeHeight
1615 return (float)GetValue(SizeHeightProperty);
1619 SetValue(SizeHeightProperty, value);
1620 NotifyPropertyChanged();
1625 /// Gets or sets the position of the view.<br />
1626 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1627 /// If the position inheritance is disabled, sets the world position.<br />
1631 /// Animatable - This property can be animated using <c>Animation</c> class.
1633 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1636 /// The property cascade chaining set is not recommended.
1639 /// This way is recommended for setting the property
1641 /// var view = new View();
1642 /// view.Position = new Position(100, 200.5f, 0);
1644 /// This way to set the property is prohibited
1646 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1649 /// <since_tizen> 3 </since_tizen>
1650 public Position Position
1654 return (Position)GetValue(PositionProperty);
1658 SetValue(PositionProperty, value);
1659 NotifyPropertyChanged();
1664 /// Gets or sets the position X of the view.
1668 /// Animatable - This property can be animated using <c>Animation</c> class.
1670 /// animation.AnimateTo(view, "PositionX", 50.0f);
1674 /// <since_tizen> 3 </since_tizen>
1675 public float PositionX
1679 return (float)GetValue(PositionXProperty);
1683 SetValue(PositionXProperty, value);
1684 NotifyPropertyChanged();
1689 /// Gets or sets the position Y of the view.
1693 /// Animatable - This property can be animated using <c>Animation</c> class.
1695 /// animation.AnimateTo(view, "PositionY", 50.0f);
1699 /// <since_tizen> 3 </since_tizen>
1700 public float PositionY
1704 return (float)GetValue(PositionYProperty);
1708 SetValue(PositionYProperty, value);
1709 NotifyPropertyChanged();
1714 /// Gets or sets the position Z of the view.
1718 /// Animatable - This property can be animated using <c>Animation</c> class.
1720 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1724 /// <since_tizen> 3 </since_tizen>
1725 public float PositionZ
1729 return (float)GetValue(PositionZProperty);
1733 SetValue(PositionZProperty, value);
1734 NotifyPropertyChanged();
1739 /// Gets or sets the world position of the view.
1741 /// <since_tizen> 3 </since_tizen>
1742 public Vector3 WorldPosition
1746 #if NUI_VISUAL_PROPERTY_CHANGE_1
1747 return GetCurrentWorldPosition();
1749 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1750 var pValue = GetProperty(View.Property.WorldPosition);
1759 /// Gets or sets the orientation of the view.<br />
1760 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1764 /// This is an asynchronous method.
1767 /// Animatable - This property can be animated using <c>Animation</c> class.
1769 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1773 /// <since_tizen> 3 </since_tizen>
1774 public Rotation Orientation
1778 return (Rotation)GetValue(OrientationProperty);
1782 SetValue(OrientationProperty, value);
1783 NotifyPropertyChanged();
1788 /// Gets or sets the world orientation of the view.<br />
1790 /// <since_tizen> 3 </since_tizen>
1791 public Rotation WorldOrientation
1795 Rotation temp = new Rotation();
1796 var pValue = GetProperty(View.Property.WorldOrientation);
1804 /// Gets or sets the scale factor applied to the view.<br />
1808 /// Animatable - This property can be animated using <c>Animation</c> class.
1810 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1813 /// The property cascade chaining set is not recommended.
1816 /// This way is recommended for setting the property
1818 /// var view = new View();
1819 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1821 /// This way to set the property is prohibited
1823 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1826 /// <since_tizen> 3 </since_tizen>
1827 public Vector3 Scale
1831 return (Vector3)GetValue(ScaleProperty);
1835 SetValue(ScaleProperty, value);
1836 NotifyPropertyChanged();
1841 /// Gets or sets the scale X factor applied to the view.
1845 /// Animatable - This property can be animated using <c>Animation</c> class.
1847 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1851 /// <since_tizen> 3 </since_tizen>
1856 return (float)GetValue(ScaleXProperty);
1860 SetValue(ScaleXProperty, value);
1861 NotifyPropertyChanged();
1866 /// Gets or sets the scale Y factor applied to the view.
1870 /// Animatable - This property can be animated using <c>Animation</c> class.
1872 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1876 /// <since_tizen> 3 </since_tizen>
1881 return (float)GetValue(ScaleYProperty);
1885 SetValue(ScaleYProperty, value);
1886 NotifyPropertyChanged();
1891 /// Gets or sets the scale Z factor applied to the view.
1895 /// Animatable - This property can be animated using <c>Animation</c> class.
1897 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1901 /// <since_tizen> 3 </since_tizen>
1906 return (float)GetValue(ScaleZProperty);
1910 SetValue(ScaleZProperty, value);
1911 NotifyPropertyChanged();
1916 /// Gets the world scale of the view.
1918 /// <since_tizen> 3 </since_tizen>
1919 public Vector3 WorldScale
1923 #if NUI_VISUAL_PROPERTY_CHANGE_1
1924 return GetCurrentWorldScale();
1926 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1927 var pValue = GetProperty(View.Property.WorldScale);
1936 /// Retrieves the visibility flag of the view.
1940 /// If the view is not visible, then the view and its children will not be rendered.
1941 /// 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.
1944 /// Animatable - This property can be animated using <c>Animation</c> class.
1946 /// animation.AnimateTo(view, "Visibility", false);
1950 /// <since_tizen> 3 </since_tizen>
1951 public bool Visibility
1955 #if NUI_VISUAL_PROPERTY_CHANGE_1
1956 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
1959 var pValue = GetProperty(View.Property.VISIBLE);
1960 pValue.Get(out temp);
1968 /// Gets the view's world color.
1970 /// <since_tizen> 3 </since_tizen>
1971 public Vector4 WorldColor
1975 #if NUI_VISUAL_PROPERTY_CHANGE_1
1976 return GetCurrentWorldColor();
1978 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1979 var pValue = GetProperty(View.Property.WorldColor);
1988 /// Gets or sets the view's name.
1990 /// <since_tizen> 3 </since_tizen>
1995 return (string)GetValue(NameProperty);
1999 SetValue(NameProperty, value);
2000 NotifyPropertyChanged();
2005 /// Get the number of children held by the view.
2007 /// <since_tizen> 3 </since_tizen>
2008 public new uint ChildCount
2012 return Convert.ToUInt32(Children.Count);
2017 /// Gets the view's ID.
2020 /// <since_tizen> 3 </since_tizen>
2030 /// Gets or sets the status of whether the view should emit touch or hover signals.
2031 /// If a View is made insensitive, then the View and its children are not hittable.
2033 /// <since_tizen> 3 </since_tizen>
2034 public bool Sensitive
2038 return (bool)GetValue(SensitiveProperty);
2042 SetValue(SensitiveProperty, value);
2043 NotifyPropertyChanged();
2048 /// Gets or sets the status of whether the view should be enabled user interactions.
2049 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2051 /// <since_tizen> tizen_next </since_tizen>
2052 [EditorBrowsable(EditorBrowsableState.Never)]
2053 public bool IsEnabled
2057 return (bool)GetValue(IsEnabledProperty);
2061 SetValue(IsEnabledProperty, value);
2062 NotifyPropertyChanged();
2067 /// 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.
2069 /// <since_tizen> 3 </since_tizen>
2070 public bool LeaveRequired
2074 return (bool)GetValue(LeaveRequiredProperty);
2078 SetValue(LeaveRequiredProperty, value);
2079 NotifyPropertyChanged();
2084 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2086 /// <since_tizen> 3 </since_tizen>
2087 public bool InheritOrientation
2091 return (bool)GetValue(InheritOrientationProperty);
2095 SetValue(InheritOrientationProperty, value);
2096 NotifyPropertyChanged();
2101 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2103 /// <since_tizen> 3 </since_tizen>
2104 public bool InheritScale
2108 return (bool)GetValue(InheritScaleProperty);
2112 SetValue(InheritScaleProperty, value);
2113 NotifyPropertyChanged();
2118 /// Gets or sets the status of how the view and its children should be drawn.<br />
2119 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2120 /// 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 />
2121 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2122 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2123 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2125 /// <since_tizen> 3 </since_tizen>
2126 public DrawModeType DrawMode
2130 return (DrawModeType)GetValue(DrawModeProperty);
2134 SetValue(DrawModeProperty, value);
2135 NotifyPropertyChanged();
2140 /// Gets or sets the relative to parent size factor of the view.<br />
2141 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2142 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2145 /// The property cascade chaining set is not recommended.
2148 /// This way is recommended for setting the property
2150 /// var text = new TextField();
2151 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2153 /// This way to set the property is prohibited
2155 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2158 /// <since_tizen> 3 </since_tizen>
2159 public Vector3 SizeModeFactor
2163 return (Vector3)GetValue(SizeModeFactorProperty);
2167 SetValue(SizeModeFactorProperty, value);
2168 NotifyPropertyChanged();
2173 /// Gets or sets the width resize policy to be used.
2175 /// <since_tizen> 3 </since_tizen>
2176 public ResizePolicyType WidthResizePolicy
2180 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2184 SetValue(WidthResizePolicyProperty, value);
2185 NotifyPropertyChanged();
2190 /// Gets or sets the height resize policy to be used.
2192 /// <since_tizen> 3 </since_tizen>
2193 public ResizePolicyType HeightResizePolicy
2197 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2201 SetValue(HeightResizePolicyProperty, value);
2202 NotifyPropertyChanged();
2207 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2208 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2210 /// <since_tizen> 3 </since_tizen>
2211 public SizeScalePolicyType SizeScalePolicy
2215 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2219 SetValue(SizeScalePolicyProperty, value);
2220 NotifyPropertyChanged();
2225 /// Gets or sets the status of whether the width size is dependent on the height size.
2227 /// <since_tizen> 3 </since_tizen>
2228 public bool WidthForHeight
2232 return (bool)GetValue(WidthForHeightProperty);
2236 SetValue(WidthForHeightProperty, value);
2237 NotifyPropertyChanged();
2242 /// Gets or sets the status of whether the height size is dependent on the width size.
2244 /// <since_tizen> 3 </since_tizen>
2245 public bool HeightForWidth
2249 return (bool)GetValue(HeightForWidthProperty);
2253 SetValue(HeightForWidthProperty, value);
2254 NotifyPropertyChanged();
2259 /// Gets or sets the padding for use in layout.
2262 /// The property cascade chaining set is not recommended.
2265 /// This way is recommended for setting the property
2267 /// var view = new View();
2268 /// view.Padding = new Extents(5, 5, 5, 5);
2270 /// This way to set the property is prohibited
2272 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2275 /// <since_tizen> 5 </since_tizen>
2276 public Extents Padding
2280 return (Extents)GetValue(PaddingProperty);
2284 SetValue(PaddingProperty, value);
2285 NotifyPropertyChanged();
2290 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2292 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2294 /// The property cascade chaining set is not recommended.
2297 /// This way is recommended for setting the property
2299 /// var view = new View();
2300 /// view.MinimumSize = new Size2D(100, 200);
2302 /// This way to set the property is prohibited
2304 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2307 /// <since_tizen> 3 </since_tizen>
2308 public Size2D MinimumSize
2312 return (Size2D)GetValue(MinimumSizeProperty);
2318 throw new ArgumentNullException(nameof(value));
2322 // Note: it only works if minimum size is >= than natural size.
2323 // To force the size it should be done through the width&height spec or Size2D.
2324 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2325 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2326 layout.RequestLayout();
2328 SetValue(MinimumSizeProperty, value);
2329 NotifyPropertyChanged();
2334 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2337 /// This way is recommended for setting the property
2339 /// var view = new View();
2340 /// view.MaximumSize = new Size2D(100, 200);
2342 /// This way to set the property is prohibited
2344 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2347 /// <since_tizen> 3 </since_tizen>
2348 public Size2D MaximumSize
2352 return (Size2D)GetValue(MaximumSizeProperty);
2356 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2357 // MATCH_PARENT spec + parent container size can be used to limit
2360 layout.RequestLayout();
2362 SetValue(MaximumSizeProperty, value);
2363 NotifyPropertyChanged();
2368 /// Gets or sets whether a child view inherits it's parent's position.<br />
2369 /// Default is to inherit.<br />
2370 /// 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 />
2372 /// <since_tizen> 3 </since_tizen>
2373 public bool InheritPosition
2377 return (bool)GetValue(InheritPositionProperty);
2381 SetValue(InheritPositionProperty, value);
2382 NotifyPropertyChanged();
2387 /// Gets or sets the clipping behavior (mode) of it's children.
2389 /// <since_tizen> 3 </since_tizen>
2390 public ClippingModeType ClippingMode
2394 return (ClippingModeType)GetValue(ClippingModeProperty);
2398 SetValue(ClippingModeProperty, value);
2399 NotifyPropertyChanged();
2404 /// Gets the number of renderers held by the view.
2406 /// <since_tizen> 3 </since_tizen>
2407 public uint RendererCount
2411 return GetRendererCount();
2416 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2419 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2421 /// <since_tizen> 3 </since_tizen>
2422 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2424 "View view = new View(); " +
2425 "view.PivotPoint = PivotPoint.Center; " +
2426 "view.PositionUsesPivotPoint = true;")]
2427 [EditorBrowsable(EditorBrowsableState.Never)]
2428 public Position AnchorPoint
2432 return GetValue(AnchorPointProperty) as Position;
2436 SetValue(AnchorPointProperty, value);
2440 private Position InternalAnchorPoint
2444 #if NUI_VISUAL_PROPERTY_CHANGE_1
2445 return GetCurrentAnchorPoint();
2447 Position temp = new Position(0.0f, 0.0f, 0.0f);
2448 var pValue = GetProperty(View.Property.AnchorPoint);
2451 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2458 #if NUI_VISUAL_PROPERTY_CHANGE_1
2459 SetAnchorPoint(value);
2461 var temp = new Tizen.NUI.PropertyValue(value);
2462 SetProperty(View.Property.AnchorPoint, temp);
2465 NotifyPropertyChanged();
2470 /// Sets the size of a view for the width, the height and the depth.<br />
2471 /// Geometry can be scaled to fit within this area.<br />
2472 /// This does not interfere with the view's scale factor.<br />
2473 /// The views default depth is the minimum of width and height.<br />
2477 /// Animatable - This property can be animated using <c>Animation</c> class.
2479 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2482 /// The property cascade chaining set is not recommended.
2485 /// This way is recommended for setting the property
2487 /// var view = new View();
2488 /// view.Size = new Size(100.5f, 200, 0);
2490 /// This way to set the property is prohibited
2492 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2495 /// <since_tizen> 5 </since_tizen>
2500 return (Size)GetValue(SizeProperty);
2504 SetValue(SizeProperty, value);
2505 NotifyPropertyChanged();
2510 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2512 /// <since_tizen> 3 </since_tizen>
2513 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2515 "Container parent = view.GetParent(); " +
2516 "View view = parent as View;")]
2517 [EditorBrowsable(EditorBrowsableState.Never)]
2518 public new View Parent
2523 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2524 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2525 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2527 if (basehandle is Layer layer)
2529 ret = new View(Layer.getCPtr(layer).Handle, false);
2530 NUILog.Error("This Parent property is deprecated, should do not be used");
2534 ret = basehandle as View;
2537 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2538 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2540 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2546 /// Gets/Sets whether inherit parent's the layout Direction.
2548 /// <since_tizen> 4 </since_tizen>
2549 public bool InheritLayoutDirection
2553 return (bool)GetValue(InheritLayoutDirectionProperty);
2557 SetValue(InheritLayoutDirectionProperty, value);
2558 NotifyPropertyChanged();
2563 /// Gets/Sets the layout Direction.
2565 /// <since_tizen> 4 </since_tizen>
2566 public ViewLayoutDirectionType LayoutDirection
2570 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2574 SetValue(LayoutDirectionProperty, value);
2575 NotifyPropertyChanged();
2576 layout?.RequestLayout();
2581 /// Gets or sets the Margin for use in layout.
2584 /// Margin property is supported by Layout algorithms and containers.
2585 /// Please Set Layout if you want to use Margin property.
2586 /// The property cascade chaining set is not recommended.
2589 /// This way is recommended for setting the property
2591 /// var view = new View();
2592 /// view.Margin = new Extents(10, 5, 15, 20);
2594 /// This way to set the property is prohibited
2596 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2599 /// <since_tizen> 4 </since_tizen>
2600 public Extents Margin
2604 return (Extents)GetValue(MarginProperty);
2608 SetValue(MarginProperty, value);
2609 NotifyPropertyChanged();
2614 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2618 /// // matchParentView matches its size to its parent size.
2619 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2620 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2622 /// // wrapContentView wraps its children with their desired size.
2623 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2624 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2626 /// // exactSizeView shows itself with an exact size.
2627 /// exactSizeView.WidthSpecification = 100;
2628 /// exactSizeView.HeightSpecification = 100;
2631 /// <since_tizen> 6 </since_tizen>
2632 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2633 public int WidthSpecification
2637 return (int)GetValue(WidthSpecificationProperty);
2641 SetValue(WidthSpecificationProperty, value);
2642 NotifyPropertyChanged();
2646 private int InternalWidthSpecification
2654 if (value == widthPolicy)
2657 widthPolicy = value;
2658 if (widthPolicy >= 0)
2660 if (heightPolicy >= 0) // Policy an exact value
2662 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2663 Size2D = new Size2D(widthPolicy, heightPolicy);
2666 layout?.RequestLayout();
2671 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2675 /// // matchParentView matches its size to its parent size.
2676 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2677 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2679 /// // wrapContentView wraps its children with their desired size.
2680 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2681 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2683 /// // exactSizeView shows itself with an exact size.
2684 /// exactSizeView.WidthSpecification = 100;
2685 /// exactSizeView.HeightSpecification = 100;
2688 /// <since_tizen> 6 </since_tizen>
2689 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2690 public int HeightSpecification
2694 return (int)GetValue(HeightSpecificationProperty);
2698 SetValue(HeightSpecificationProperty, value);
2699 NotifyPropertyChanged();
2703 private int InternalHeightSpecification
2707 return heightPolicy;
2711 if (value == heightPolicy)
2714 heightPolicy = value;
2715 if (heightPolicy >= 0)
2717 if (widthPolicy >= 0) // Policy an exact value
2719 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2720 Size2D = new Size2D(widthPolicy, heightPolicy);
2723 layout?.RequestLayout();
2728 /// Gets the List of transitions for this View.
2730 /// <since_tizen> 6 </since_tizen>
2731 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2735 if (layoutTransitions == null)
2737 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2739 return layoutTransitions;
2744 /// Sets a layout transitions for this View.
2746 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2748 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2750 /// <since_tizen> 6 </since_tizen>
2751 public LayoutTransition LayoutTransition
2755 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2759 SetValue(LayoutTransitionProperty, value);
2760 NotifyPropertyChanged();
2764 private LayoutTransition InternalLayoutTransition
2768 return layoutTransition;
2774 throw new global::System.ArgumentNullException(nameof(value));
2776 if (layoutTransitions == null)
2778 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2781 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2783 AttachTransitionsToChildren(value);
2785 layoutTransition = value;
2790 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2793 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2795 /// <since_tizen> 4 </since_tizen>
2796 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2797 [EditorBrowsable(EditorBrowsableState.Never)]
2798 public Extents PaddingEX
2802 return GetValue(PaddingEXProperty) as Extents;
2806 SetValue(PaddingEXProperty, value);
2810 private Extents InternalPaddingEX
2814 Extents temp = new Extents(0, 0, 0, 0);
2815 var pValue = GetProperty(View.Property.PADDING);
2818 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2824 var temp = new Tizen.NUI.PropertyValue(value);
2825 SetProperty(View.Property.PADDING, temp);
2827 NotifyPropertyChanged();
2828 layout?.RequestLayout();
2833 /// The Color of View. This is an RGBA value.
2834 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2835 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2836 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2837 /// Inherient of color value depend on <see cref="ColorMode"/>.
2841 /// Animatable - This property can be animated using <c>Animation</c> class.
2843 /// The property cascade chaining set is not recommended.
2846 /// This way is recommended for setting the property
2848 /// var view = new View();
2849 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2851 /// This way to set the property is prohibited
2853 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2856 [EditorBrowsable(EditorBrowsableState.Never)]
2861 return (Color)GetValue(ColorProperty);
2865 SetValue(ColorProperty, value);
2866 NotifyPropertyChanged();
2871 /// The Red component of View.Color.
2875 /// Animatable - This property can be animated using <c>Animation</c> class.
2878 [EditorBrowsable(EditorBrowsableState.Never)]
2879 public float ColorRed
2883 return (float)GetValue(ColorRedProperty);
2887 SetValue(ColorRedProperty, value);
2888 NotifyPropertyChanged();
2893 /// The Green component of View.Color.
2897 /// Animatable - This property can be animated using <c>Animation</c> class.
2900 [EditorBrowsable(EditorBrowsableState.Never)]
2901 public float ColorGreen
2905 return (float)GetValue(ColorGreenProperty);
2909 SetValue(ColorGreenProperty, value);
2910 NotifyPropertyChanged();
2915 /// The Blue component of View.Color.
2919 /// Animatable - This property can be animated using <c>Animation</c> class.
2922 [EditorBrowsable(EditorBrowsableState.Never)]
2923 public float ColorBlue
2927 return (float)GetValue(ColorBlueProperty);
2931 SetValue(ColorBlueProperty, value);
2932 NotifyPropertyChanged();
2937 /// Set the layout on this View. Replaces any existing Layout.
2940 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2942 /// <since_tizen> 6 </since_tizen>
2943 public LayoutItem Layout
2947 return GetValue(LayoutProperty) as LayoutItem;
2951 SetValue(LayoutProperty, value);
2955 private LayoutItem InternalLayout
2963 // Do nothing if layout provided is already set on this View.
2964 if (value == layout)
2969 LayoutingDisabled = false;
2972 // If new layout being set already has a owner then that owner receives a replacement default layout.
2973 // First check if the layout to be set already has a owner.
2974 if (value?.Owner != null)
2976 // Previous owner of the layout gets a default layout as a replacement.
2977 value.Owner.Layout = new AbsoluteLayout()
2979 // Copy Margin and Padding to replacement LayoutGroup.
2980 Margin = value.Margin,
2981 Padding = value.Padding,
2985 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2986 // View if no replacement. Previously margin and padding values would have been moved from
2987 // the View to the layout.
2988 if (layout != null) // Existing layout
2992 // Existing layout being replaced so copy over margin and padding values.
2993 value.Margin = layout.Margin;
2994 value.Padding = layout.Padding;
2995 value.SetPositionByLayout = !excludeLayouting;
2999 // Layout not being replaced so restore margin and padding to View.
3000 SetValue(MarginProperty, layout.Margin);
3001 SetValue(PaddingProperty, layout.Padding);
3002 NotifyPropertyChanged();
3007 // First Layout to be added to the View hence copy
3009 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
3012 Extents margin = Margin;
3013 Extents padding = Padding;
3014 bool setMargin = false;
3015 bool setPadding = false;
3017 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
3019 // If View already has a margin set then store it in Layout instead.
3020 value.Margin = margin;
3021 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
3025 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
3027 // If View already has a padding set then store it in Layout instead.
3028 value.Padding = padding;
3029 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
3033 if (setMargin || setPadding)
3035 NotifyPropertyChanged();
3038 value.SetPositionByLayout = !excludeLayouting;
3042 // Remove existing layout from it's parent layout group.
3045 // Set layout to this view
3051 /// The weight of the View, used to share available space in a layout with siblings.
3053 /// <since_tizen> 6 </since_tizen>
3063 layout?.RequestLayout();
3068 /// Whether to load the BackgroundImage synchronously.
3069 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3070 /// Note: For Normal Quad images only.
3072 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3073 [EditorBrowsable(EditorBrowsableState.Never)]
3074 public bool BackgroundImageSynchronosLoading
3078 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3082 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3083 NotifyPropertyChanged();
3087 private bool InternalBackgroundImageSynchronosLoading
3091 return BackgroundImageSynchronousLoading;
3095 BackgroundImageSynchronousLoading = value;
3100 /// Whether to load the BackgroundImage synchronously.
3101 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3102 /// Note: For Normal Quad images only.
3104 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3105 [EditorBrowsable(EditorBrowsableState.Never)]
3106 public bool BackgroundImageSynchronousLoading
3110 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3114 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3115 NotifyPropertyChanged();
3119 private bool InternalBackgroundImageSynchronousLoading
3123 return backgroundImageSynchronousLoading;
3127 backgroundImageSynchronousLoading = value;
3129 #if NUI_VISUAL_PROPERTY_CHANGE_1
3130 if (!string.IsNullOrEmpty(BackgroundImage))
3132 string bgUrl = null;
3133 var pValue = Background.Find(ImageVisualProperty.URL);
3134 pValue?.Get(out bgUrl);
3137 if (!string.IsNullOrEmpty(bgUrl))
3140 PropertyMap bgMap = this.Background;
3141 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3142 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3149 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3150 [EditorBrowsable(EditorBrowsableState.Never)]
3151 public Vector4 UpdateAreaHint
3155 return (Vector4)GetValue(UpdateAreaHintProperty);
3159 SetValue(UpdateAreaHintProperty, value);
3160 NotifyPropertyChanged();
3165 /// Enable/Disable ControlState propagation for children.
3166 /// It is false by default.
3167 /// If the View needs to share ControlState with descendants, please set it true.
3168 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3170 [EditorBrowsable(EditorBrowsableState.Never)]
3171 public bool EnableControlStatePropagation
3175 return (bool)GetValue(EnableControlStatePropagationProperty);
3179 SetValue(EnableControlStatePropagationProperty, value);
3180 NotifyPropertyChanged();
3184 private bool InternalEnableControlStatePropagation
3186 get => themeData?.ControlStatePropagation ?? false;
3189 if (InternalEnableControlStatePropagation == value) return;
3191 if (themeData == null) themeData = new ThemeData();
3193 themeData.ControlStatePropagation = value;
3195 foreach (View child in Children)
3197 child.EnableControlStatePropagation = value;
3203 /// The ControlStates can propagate from the parent.
3204 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3205 /// if parent view EnableControlState is true.
3206 /// <see cref="EnableControlState"/>.
3207 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3209 [EditorBrowsable(EditorBrowsableState.Never)]
3210 public ControlState PropagatableControlStates
3214 return (ControlState)GetValue(PropagatableControlStatesProperty);
3218 SetValue(PropagatableControlStatesProperty, value);
3219 NotifyPropertyChanged();
3223 private ControlState InternalPropagatableControlStates
3225 get => propagatableControlStates;
3226 set => propagatableControlStates = value;
3230 /// By default, it is false in View, true in Control.
3231 /// Note that if the value is true, the View will be a touch receptor.
3233 [EditorBrowsable(EditorBrowsableState.Never)]
3234 public bool EnableControlState
3238 return (bool)GetValue(EnableControlStateProperty);
3242 SetValue(EnableControlStateProperty, value);
3247 /// Whether the actor grab all touches even if touch leaves its boundary.
3249 /// <returns>true, if it grab all touch after start</returns>
3250 [EditorBrowsable(EditorBrowsableState.Never)]
3251 public bool GrabTouchAfterLeave
3255 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3259 SetValue(GrabTouchAfterLeaveProperty, value);
3263 private bool InternalGrabTouchAfterLeave
3267 #if NUI_VISUAL_PROPERTY_CHANGE_1
3268 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
3271 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
3272 pValue.Get(out temp);
3279 #if NUI_VISUAL_PROPERTY_CHANGE_1
3280 Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
3282 var temp = new Tizen.NUI.PropertyValue(value);
3283 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
3286 NotifyPropertyChanged();
3291 /// Whether the view will only receive own touch.
3293 /// <returns>true, if it only receives touches that started from itself.</returns>
3294 [EditorBrowsable(EditorBrowsableState.Never)]
3295 public bool AllowOnlyOwnTouch
3299 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3303 SetValue(AllowOnlyOwnTouchProperty, value);
3307 private bool InternalAllowOnlyOwnTouch
3311 #if NUI_VISUAL_PROPERTY_CHANGE_1
3312 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
3315 var pValue = GetProperty(View.Property.AllowOnlyOwnTouch);
3316 pValue.Get(out temp);
3323 #if NUI_VISUAL_PROPERTY_CHANGE_1
3324 Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
3326 var temp = new Tizen.NUI.PropertyValue(value);
3327 SetProperty(View.Property.AllowOnlyOwnTouch, temp);
3330 NotifyPropertyChanged();
3335 /// Determines which blend equation will be used to render renderers of this actor.
3337 /// <returns>blend equation enum currently assigned</returns>
3338 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3339 [EditorBrowsable(EditorBrowsableState.Never)]
3340 public BlendEquationType BlendEquation
3344 return (BlendEquationType)GetValue(BlendEquationProperty);
3348 SetValue(BlendEquationProperty, value);
3352 private BlendEquationType InternalBlendEquation
3356 #if NUI_VISUAL_PROPERTY_CHANGE_1
3357 return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
3360 var pValue = GetProperty(View.Property.BlendEquation);
3361 pValue.Get(out temp);
3363 return (BlendEquationType)temp;
3368 #if NUI_VISUAL_PROPERTY_CHANGE_1
3369 Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
3371 var temp = new Tizen.NUI.PropertyValue((int)value);
3372 SetProperty(View.Property.BlendEquation, temp);
3375 NotifyPropertyChanged();
3380 /// If the value is true, the View will change its style as the theme changes.
3381 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3383 /// <since_tizen> 9 </since_tizen>
3384 public bool ThemeChangeSensitive
3386 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3387 set => SetValue(ThemeChangeSensitiveProperty, value);
3391 /// Create Style, it is abstract function and must be override.
3393 [EditorBrowsable(EditorBrowsableState.Never)]
3394 protected virtual ViewStyle CreateViewStyle()
3396 return new ViewStyle();
3400 /// Called after the View's ControlStates changed.
3402 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3403 [EditorBrowsable(EditorBrowsableState.Never)]
3404 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3410 [EditorBrowsable(EditorBrowsableState.Never)]
3411 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3413 isThemeChanged = true;
3414 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3415 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3416 isThemeChanged = false;
3420 /// Apply style instance to the view.
3421 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3423 /// <since_tizen> 9 </since_tizen>
3424 public virtual void ApplyStyle(ViewStyle viewStyle)
3426 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3428 if (themeData == null) themeData = new ThemeData();
3430 themeData.viewStyle = viewStyle;
3432 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3438 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3440 if (bindablePropertyOfView == null)
3445 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3446 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3448 foreach (var sourceProperty in dirtyStyleProperties)
3450 var sourceValue = viewStyle.GetValue(sourceProperty);
3452 if (sourceValue == null)
3457 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3459 // Do not set value again when theme is changed and the value has been set already.
3460 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3465 if (destinationProperty != null)
3467 InternalSetValue(destinationProperty, sourceValue);
3473 /// Get whether the View is culled or not.
3474 /// True means that the View is out of the view frustum.
3477 /// Hidden-API (Inhouse-API).
3479 [EditorBrowsable(EditorBrowsableState.Never)]
3484 #if NUI_VISUAL_PROPERTY_CHANGE_1
3485 return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
3488 var pValue = GetProperty(View.Property.Culled);
3489 pValue.Get(out temp);
3497 /// Set or Get TransitionOptions for the page transition.
3498 /// This property is used to define how this view will be transitioned during Page switching.
3500 /// <since_tizen> 9 </since_tizen>
3501 public TransitionOptions TransitionOptions
3505 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3509 SetValue(TransitionOptionsProperty, value);
3510 NotifyPropertyChanged();
3514 private TransitionOptions InternalTransitionOptions
3518 transitionOptions = value;
3522 return transitionOptions;
3527 /// Gets or sets the status of whether the view should emit key event signals.
3528 /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
3530 [EditorBrowsable(EditorBrowsableState.Never)]
3531 public bool DispatchKeyEvents
3535 return (bool)GetValue(DispatchKeyEventsProperty);
3539 SetValue(DispatchKeyEventsProperty, value);
3540 NotifyPropertyChanged();
3545 /// Gets or sets the status of whether touch events can be dispatched.
3546 /// 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.
3547 /// This works without adding a TouchEvent callback in the View.
3549 /// 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.
3552 [EditorBrowsable(EditorBrowsableState.Never)]
3553 public bool DispatchTouchEvents
3557 return dispatchTouchEvents;
3561 if (dispatchTouchEvents != value)
3563 dispatchTouchEvents = value;
3564 if (dispatchTouchEvents == false)
3566 TouchEvent += OnDispatchTouchEvent;
3570 TouchEvent -= OnDispatchTouchEvent;
3576 private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
3582 /// Gets or sets the status of whether the view should emit Gesture event signals.
3583 /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
3584 /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3586 [EditorBrowsable(EditorBrowsableState.Never)]
3587 public bool DispatchGestureEvents
3591 return dispatchGestureEvents;
3595 if (dispatchGestureEvents != value)
3597 dispatchGestureEvents = value;
3598 ConfigGestureDetector(dispatchGestureEvents);
3604 /// Gets or sets the status of whether the view should emit Gesture event signals.
3605 /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
3606 /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
3608 [EditorBrowsable(EditorBrowsableState.Never)]
3609 public bool DispatchParentGestureEvents
3613 return dispatchParentGestureEvents;
3617 if (dispatchParentGestureEvents != value)
3619 dispatchParentGestureEvents = value;
3620 ConfigGestureDetector(dispatchParentGestureEvents);
3625 private void ConfigGestureDetector(bool dispatch)
3627 if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
3628 if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
3629 if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
3630 if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
3631 if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
3633 if (dispatch == true)
3635 configGestureCount = configGestureCount > 0 ? configGestureCount-- : 0;
3636 if (configGestureCount == 0)
3638 panGestureDetector.Detach(this);
3639 longGestureDetector.Detach(this);
3640 pinchGestureDetector.Detach(this);
3641 tapGestureDetector.Detach(this);
3642 rotationGestureDetector.Detach(this);
3644 panGestureDetector.Detected -= OnGestureDetected;
3645 longGestureDetector.Detected -= OnGestureDetected;
3646 pinchGestureDetector.Detected -= OnGestureDetected;
3647 tapGestureDetector.Detected -= OnGestureDetected;
3648 rotationGestureDetector.Detected -= OnGestureDetected;
3650 panGestureDetector = null;
3651 longGestureDetector = null;
3652 pinchGestureDetector = null;
3653 tapGestureDetector = null;
3654 rotationGestureDetector = null;
3659 if (configGestureCount == 0)
3661 panGestureDetector.Attach(this);
3662 longGestureDetector.Attach(this);
3663 pinchGestureDetector.Attach(this);
3664 tapGestureDetector.Attach(this);
3665 rotationGestureDetector.Attach(this);
3667 panGestureDetector.Detected += OnGestureDetected;
3668 longGestureDetector.Detected += OnGestureDetected;
3669 pinchGestureDetector.Detected += OnGestureDetected;
3670 tapGestureDetector.Detected += OnGestureDetected;
3671 rotationGestureDetector.Detected += OnGestureDetected;
3673 configGestureCount++;
3677 private void OnGestureDetected(object source, EventArgs e)
3679 // Does notting. This is to consume the gesture.
3683 /// Called when the view is hit through TouchEvent or GestureEvent.
3684 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3685 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3686 /// User can override whether hit or not in HitTest.
3687 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3688 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3690 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3691 [EditorBrowsable(EditorBrowsableState.Never)]
3692 protected virtual bool HitTest(Touch touch)
3698 /// Retrieve the View's current Color.
3701 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3702 /// 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).
3703 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3704 /// and users can get the current actual values through them.
3706 [EditorBrowsable(EditorBrowsableState.Never)]
3707 public Color CurrentColor => GetCurrentColor();
3710 /// Retrieve the current scale factor applied to the View.
3713 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3714 /// 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).
3715 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3716 /// and users can get the current actual values through them.
3718 [EditorBrowsable(EditorBrowsableState.Never)]
3719 public Vector3 CurrentScale => GetCurrentScale();