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;
74 private bool dispatchTouchEvents = true;
78 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
79 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
80 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
81 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
83 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
84 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
85 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
86 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
88 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
89 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
90 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
91 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
93 RegisterAccessibilityDelegate();
97 /// Creates a new instance of a view.
99 /// <since_tizen> 3 </since_tizen>
100 public View() : this(Interop.View.New(), true)
102 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
106 [EditorBrowsable(EditorBrowsableState.Never)]
107 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
112 /// Create a new instance of a View with setting the status of shown or hidden.
114 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
115 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
116 [EditorBrowsable(EditorBrowsableState.Never)]
117 public View(bool shown) : this(Interop.View.New(), true)
119 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
125 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
134 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
136 InitializeStyle(viewStyle);
139 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
143 PositionUsesPivotPoint = false;
146 onWindowSendEventCallback = SendViewAddedEventToWindow;
147 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
148 signal?.Connect(onWindowSendEventCallback);
150 hitTestResultDataCallback = OnHitTestResult;
151 using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
152 touchDataSignal?.Connect(hitTestResultDataCallback);
159 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
160 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
163 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
165 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 /// The event that is triggered when the View's ControlState is changed.
176 [EditorBrowsable(EditorBrowsableState.Never)]
177 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
179 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
183 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
185 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
186 [EditorBrowsable(EditorBrowsableState.Never)]
187 public bool LayoutSet
196 /// Flag to allow Layouting to be disabled for Views.
197 /// Once a View has a Layout set then any children added to Views from then on will receive
198 /// automatic Layouts.
200 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
201 [EditorBrowsable(EditorBrowsableState.Never)]
202 public static bool LayoutingDisabled { get; set; } = true;
205 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
207 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
208 [EditorBrowsable(EditorBrowsableState.Never)]
209 public static void SetDefaultGrabTouchAfterLeave(bool enable)
211 defaultGrabTouchAfterLeave = enable;
215 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
217 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
218 [EditorBrowsable(EditorBrowsableState.Never)]
219 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
221 defaultAllowOnlyOwnTouch = enable;
225 /// Deprecate. Do not use this.
226 /// The style instance applied to this view.
227 /// Note that do not modify the ViewStyle.
228 /// Modifying ViewStyle will affect other views with same ViewStyle.
230 [EditorBrowsable(EditorBrowsableState.Never)]
231 protected ViewStyle ViewStyle
235 if (themeData == null) themeData = new ThemeData();
237 if (themeData.viewStyle == null)
239 ApplyStyle(CreateViewStyle());
241 return themeData.viewStyle;
246 /// Get/Set the control state.
247 /// Note that the ControlState only available for the classes derived from Control.
248 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
249 /// please set <see cref="EnableControlState"/> to true.
251 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
252 [EditorBrowsable(EditorBrowsableState.Never)]
253 public ControlState ControlState
257 return themeData == null ? ControlState.Normal : themeData.controlStates;
261 if (ControlState == value)
266 var prevState = ControlState;
268 if (themeData == null) themeData = new ThemeData();
269 themeData.controlStates = value;
271 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
273 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
275 if (themeData.ControlStatePropagation)
277 foreach (View child in Children)
279 ControlState allowed = child.PropagatableControlStates;
280 if (allowed.Contains(ControlState.All))
282 child.ControlState = value;
286 ControlState newControlState = child.ControlState;
288 if (allowed.Contains(ControlState.Normal))
290 if (value.Contains(ControlState.Normal))
292 newControlState += ControlState.Normal;
296 newControlState -= ControlState.Normal;
300 if (allowed.Contains(ControlState.Disabled))
302 if (value.Contains(ControlState.Disabled))
304 newControlState += ControlState.Disabled;
308 newControlState -= ControlState.Disabled;
312 if (allowed.Contains(ControlState.Selected))
314 if (value.Contains(ControlState.Selected))
316 newControlState += ControlState.Selected;
320 newControlState -= ControlState.Selected;
324 if (allowed.Contains(ControlState.Pressed))
326 if (value.Contains(ControlState.Pressed))
328 newControlState += ControlState.Pressed;
332 newControlState -= ControlState.Pressed;
336 if (allowed.Contains(ControlState.Focused))
338 if (value.Contains(ControlState.Focused))
340 newControlState += ControlState.Focused;
344 newControlState -= ControlState.Focused;
348 if (allowed.Contains(ControlState.Other))
350 if (value.Contains(ControlState.Other))
352 newControlState += ControlState.Other;
356 newControlState -= ControlState.Other;
360 if (child.ControlState != newControlState)
361 child.ControlState = newControlState;
366 OnControlStateChanged(changeInfo);
368 ControlStateChangedEvent?.Invoke(this, changeInfo);
373 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
375 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
376 [EditorBrowsable(EditorBrowsableState.Never)]
377 public bool ExcludeLayouting
381 return (bool)GetValue(ExcludeLayoutingProperty);
385 SetValue(ExcludeLayoutingProperty, value);
386 NotifyPropertyChanged();
390 private bool InternalExcludeLayouting
394 return excludeLayouting;
398 excludeLayouting = value;
399 if (Layout != null && Layout.SetPositionByLayout == value)
401 Layout.SetPositionByLayout = !value;
402 Layout.RequestLayout();
408 /// The StyleName, type string.
409 /// The value indicates DALi style name defined in json theme file.
411 /// <since_tizen> 3 </since_tizen>
412 public string StyleName
416 return (string)GetValue(StyleNameProperty);
420 SetValue(StyleNameProperty, value);
421 NotifyPropertyChanged();
426 /// The KeyInputFocus, type bool.
428 [EditorBrowsable(EditorBrowsableState.Never)]
429 public bool KeyInputFocus
433 return (bool)GetValue(KeyInputFocusProperty);
437 SetValue(KeyInputFocusProperty, value);
438 NotifyPropertyChanged();
443 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
447 /// The property cascade chaining set is not recommended.
450 /// Animatable - This property can be animated using <c>Animation</c> class.
452 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
457 /// This way is recommended for setting the property
459 /// var view = new View();
460 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
462 /// This way to set the property is prohibited
464 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
467 /// <since_tizen> 3 </since_tizen>
468 public Color BackgroundColor
472 return (Color)GetValue(BackgroundColorProperty);
476 SetValue(BackgroundColorProperty, value);
477 NotifyPropertyChanged();
482 /// The mutually exclusive with "backgroundColor" and "background" type Map.
484 /// <since_tizen> 3 </since_tizen>
485 public string BackgroundImage
489 return (string)GetValue(BackgroundImageProperty);
493 SetValue(BackgroundImageProperty, value);
494 NotifyPropertyChanged();
499 /// Get or set the border of background image.
501 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
502 [EditorBrowsable(EditorBrowsableState.Never)]
503 public Rectangle BackgroundImageBorder
507 return (Rectangle)GetValue(BackgroundImageBorderProperty);
511 SetValue(BackgroundImageBorderProperty, value);
512 NotifyPropertyChanged();
517 /// The background of view.
519 /// <since_tizen> 3 </since_tizen>
520 public Tizen.NUI.PropertyMap Background
524 return (PropertyMap)GetValue(BackgroundProperty);
528 SetValue(BackgroundProperty, value);
529 NotifyPropertyChanged();
534 /// Describes a shadow as an image for a View.
535 /// It is null by default.
538 /// Getter returns copied instance of current shadow.
541 /// The mutually exclusive with "BoxShadow".
545 /// Animatable - This property can be animated using <c>Animation</c> class.
546 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
548 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
550 /// Animatable sub-property : Offset.
553 [EditorBrowsable(EditorBrowsableState.Never)]
554 public ImageShadow ImageShadow
558 return (ImageShadow)GetValue(ImageShadowProperty);
562 SetValue(ImageShadowProperty, value);
563 NotifyPropertyChanged();
568 /// Describes a box shaped shadow drawing for a View.
569 /// It is null by default.
572 /// The mutually exclusive with "ImageShadow".
576 /// Animatable - This property can be animated using <c>Animation</c> class.
577 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
579 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
581 /// Animatable sub-property : Offset, Color, BlurRadius.
584 /// <since_tizen> 9 </since_tizen>
585 public Shadow BoxShadow
589 return (Shadow)GetValue(BoxShadowProperty);
593 SetValue(BoxShadowProperty, value);
594 NotifyPropertyChanged();
599 /// The radius for the rounded corners of the View.
600 /// This will rounds background and shadow edges.
601 /// 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).
602 /// Each radius will clamp internally to the half of smaller of the view's width or height.
603 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
607 /// Animatable - This property can be animated using <c>Animation</c> class.
609 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
613 /// <since_tizen> 9 </since_tizen>
614 public Vector4 CornerRadius
618 return (Vector4)GetValue(CornerRadiusProperty);
622 SetValue(CornerRadiusProperty, value);
623 NotifyPropertyChanged();
628 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
629 /// It is absolute by default.
630 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
632 /// <since_tizen> 9 </since_tizen>
633 public VisualTransformPolicyType CornerRadiusPolicy
635 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
636 set => SetValue(CornerRadiusPolicyProperty, value);
640 /// The width for the borderline of the View.
644 /// Animatable - This property can be animated using <c>Animation</c> class.
646 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
649 /// Note that, an image background may not have borderline if it uses the Border property.
651 /// <since_tizen> 9 </since_tizen>
652 public float BorderlineWidth
656 return (float)GetValue(BorderlineWidthProperty);
660 SetValue(BorderlineWidthProperty, value);
661 NotifyPropertyChanged();
666 /// The color for the borderline of the View.
667 /// It is Color.Black by default.
671 /// Animatable - This property can be animated using <c>Animation</c> class.
673 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
677 /// <since_tizen> 9 </since_tizen>
678 public Color BorderlineColor
682 return (Color)GetValue(BorderlineColorProperty);
686 SetValue(BorderlineColorProperty, value);
687 NotifyPropertyChanged();
692 /// The color selector for the borderline of the View.
693 /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
694 /// So this API is internally used only.
696 internal Selector<Color> BorderlineColorSelector
700 return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
704 SetValue(BorderlineColorSelectorProperty, value);
705 NotifyPropertyChanged();
710 /// The Relative offset for the borderline of the View.
711 /// Recommended range : [-1.0f to 1.0f].
712 /// If -1.0f, draw borderline inside of the View.
713 /// If 1.0f, draw borderline outside of the View.
714 /// If 0.0f, draw borderline half inside and half outside.
715 /// It is 0.0f by default.
719 /// Animatable - This property can be animated using <c>Animation</c> class.
721 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
725 /// <since_tizen> 9 </since_tizen>
726 public float BorderlineOffset
730 return (float)GetValue(BorderlineOffsetProperty);
734 SetValue(BorderlineOffsetProperty, value);
735 NotifyPropertyChanged();
740 /// The current state of the view.
742 /// <since_tizen> 3 </since_tizen>
747 return (States)GetValue(StateProperty);
751 SetValue(StateProperty, value);
752 NotifyPropertyChanged();
757 /// The current sub state of the view.
759 /// <since_tizen> 3 </since_tizen>
760 public States SubState
764 return (States)GetValue(SubStateProperty);
768 SetValue(SubStateProperty, value);
769 NotifyPropertyChanged();
774 /// Displays a tooltip
776 /// <since_tizen> 3 </since_tizen>
777 public Tizen.NUI.PropertyMap Tooltip
781 return (PropertyMap)GetValue(TooltipProperty);
785 SetValue(TooltipProperty, value);
786 NotifyPropertyChanged();
791 /// Displays a tooltip as a text.
793 /// <since_tizen> 3 </since_tizen>
794 public string TooltipText
798 return GetValue(TooltipTextProperty) as string;
802 SetValue(TooltipTextProperty, value);
806 private string InternalTooltipText
810 using (var propertyValue = GetProperty(Property.TOOLTIP))
812 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
814 return retrivedValue;
816 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
817 return "error to get TooltipText";
822 var temp = new Tizen.NUI.PropertyValue(value);
823 SetProperty(View.Property.TOOLTIP, temp);
825 NotifyPropertyChanged();
830 /// The Child property of FlexContainer.<br />
831 /// The proportion of the free space in the container, the flex item will receive.<br />
832 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
834 /// <since_tizen> 3 </since_tizen>
835 [Obsolete("Deprecated in API8, will be removed in API10.")]
840 return (float)GetValue(FlexProperty);
844 SetValue(FlexProperty, value);
845 NotifyPropertyChanged();
850 /// The Child property of FlexContainer.<br />
851 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
853 /// <since_tizen> 3 </since_tizen>
854 [Obsolete("Deprecated in API8, will be removed in API10.")]
859 return (int)GetValue(AlignSelfProperty);
863 SetValue(AlignSelfProperty, value);
864 NotifyPropertyChanged();
869 /// The Child property of FlexContainer.<br />
870 /// The space around the flex item.<br />
873 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
875 /// <since_tizen> 3 </since_tizen>
876 [Obsolete("Deprecated in API8, will be removed in API10.")]
877 public Vector4 FlexMargin
881 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
882 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
886 SetValue(FlexMarginProperty, value);
887 NotifyPropertyChanged();
892 /// The top-left cell this child occupies, if not set, the first available cell is used.
895 /// The property cascade chaining set is not recommended.
896 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
899 /// This way is recommended for setting the property
901 /// var view = new View();
902 /// view.CellIndex = new Vector2(1, 3);
904 /// This way to set the property is prohibited
906 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
909 /// <since_tizen> 3 </since_tizen>
910 public Vector2 CellIndex
914 return (Vector2)GetValue(CellIndexProperty);
918 SetValue(CellIndexProperty, value);
919 NotifyPropertyChanged();
924 /// The number of rows this child occupies, if not set, the default value is 1.
927 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
929 /// <since_tizen> 3 </since_tizen>
934 return (float)GetValue(RowSpanProperty);
938 SetValue(RowSpanProperty, value);
939 NotifyPropertyChanged();
944 /// The number of columns this child occupies, if not set, the default value is 1.
947 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
949 /// <since_tizen> 3 </since_tizen>
950 public float ColumnSpan
954 return (float)GetValue(ColumnSpanProperty);
958 SetValue(ColumnSpanProperty, value);
959 NotifyPropertyChanged();
964 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
967 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
969 /// <since_tizen> 3 </since_tizen>
970 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
974 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
978 SetValue(CellHorizontalAlignmentProperty, value);
979 NotifyPropertyChanged();
984 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
987 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
989 /// <since_tizen> 3 </since_tizen>
990 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
994 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
998 SetValue(CellVerticalAlignmentProperty, value);
999 NotifyPropertyChanged();
1004 /// The left focusable view.<br />
1005 /// This will return null if not set.<br />
1006 /// This will also return null if the specified left focusable view is not on a window.<br />
1008 /// <since_tizen> 3 </since_tizen>
1009 public View LeftFocusableView
1011 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1014 return (View)GetValue(LeftFocusableViewProperty);
1018 SetValue(LeftFocusableViewProperty, value);
1019 NotifyPropertyChanged();
1024 /// The right focusable view.<br />
1025 /// This will return null if not set.<br />
1026 /// This will also return null if the specified right focusable view is not on a window.<br />
1028 /// <since_tizen> 3 </since_tizen>
1029 public View RightFocusableView
1031 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1034 return (View)GetValue(RightFocusableViewProperty);
1038 SetValue(RightFocusableViewProperty, value);
1039 NotifyPropertyChanged();
1044 /// The up focusable view.<br />
1045 /// This will return null if not set.<br />
1046 /// This will also return null if the specified up focusable view is not on a window.<br />
1048 /// <since_tizen> 3 </since_tizen>
1049 public View UpFocusableView
1051 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1054 return (View)GetValue(UpFocusableViewProperty);
1058 SetValue(UpFocusableViewProperty, value);
1059 NotifyPropertyChanged();
1064 /// The down focusable view.<br />
1065 /// This will return null if not set.<br />
1066 /// This will also return null if the specified down focusable view is not on a window.<br />
1068 /// <since_tizen> 3 </since_tizen>
1069 public View DownFocusableView
1071 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1074 return (View)GetValue(DownFocusableViewProperty);
1078 SetValue(DownFocusableViewProperty, value);
1079 NotifyPropertyChanged();
1084 /// The clockwise focusable view by rotary wheel.<br />
1085 /// This will return null if not set.<br />
1086 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1088 [EditorBrowsable(EditorBrowsableState.Never)]
1089 public View ClockwiseFocusableView
1091 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1094 return (View)GetValue(ClockwiseFocusableViewProperty);
1098 SetValue(ClockwiseFocusableViewProperty, value);
1099 NotifyPropertyChanged();
1104 /// The counter clockwise focusable view by rotary wheel.<br />
1105 /// This will return null if not set.<br />
1106 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1108 [EditorBrowsable(EditorBrowsableState.Never)]
1109 public View CounterClockwiseFocusableView
1111 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1114 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1118 SetValue(CounterClockwiseFocusableViewProperty, value);
1119 NotifyPropertyChanged();
1124 /// Whether the view should be focusable by keyboard navigation.
1126 /// <since_tizen> 3 </since_tizen>
1127 public bool Focusable
1131 SetValue(FocusableProperty, value);
1132 NotifyPropertyChanged();
1136 return (bool)GetValue(FocusableProperty);
1141 /// 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.
1142 /// Note : Default value is true.
1144 [EditorBrowsable(EditorBrowsableState.Never)]
1145 public bool FocusableChildren
1149 SetValue(FocusableChildrenProperty, value);
1150 NotifyPropertyChanged();
1154 return (bool)GetValue(FocusableChildrenProperty);
1159 /// Whether this view can focus by touch.
1160 /// If Focusable is false, FocusableInTouch is disabled.
1161 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1163 [EditorBrowsable(EditorBrowsableState.Never)]
1164 public bool FocusableInTouch
1168 SetValue(FocusableInTouchProperty, value);
1169 NotifyPropertyChanged();
1173 return (bool)GetValue(FocusableInTouchProperty);
1178 /// Retrieves the position of the view.
1179 /// The coordinates are relative to the view's parent.
1182 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1183 /// 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).
1184 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1185 /// and users can get the current actual values through them.
1187 /// <since_tizen> 3 </since_tizen>
1188 public Position CurrentPosition
1192 return GetCurrentPosition();
1197 /// Sets the size of a view for the width and the height.<br />
1198 /// Geometry can be scaled to fit within this area.<br />
1199 /// This does not interfere with the view's scale factor.<br />
1200 /// The views default depth is the minimum of width and height.<br />
1203 /// The property cascade chaining set is not recommended.
1206 /// This way is recommended for setting the property
1208 /// var view = new View();
1209 /// view.Size2D = new Size2D(100, 200);
1211 /// This way to set the property is prohibited
1213 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1216 /// <since_tizen> 3 </since_tizen>
1217 public Size2D Size2D
1221 var temp = (Size2D)GetValue(Size2DProperty);
1223 if (this.Layout == null)
1225 if (temp.Width < 0) { temp.Width = 0; }
1226 if (temp.Height < 0) { temp.Height = 0; }
1233 SetValue(Size2DProperty, value);
1235 NotifyPropertyChanged();
1240 /// Retrieves the size of the view.
1241 /// The coordinates are relative to the view's parent.
1244 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
1245 /// 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).
1246 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
1247 /// and users can get the current actual values through them.
1249 /// <since_tizen> 3 </since_tizen>
1250 public Size2D CurrentSize
1254 return GetCurrentSize();
1259 /// Retrieves and sets the view's opacity.<br />
1263 /// Animatable - This property can be animated using <c>Animation</c> class.
1265 /// animation.AnimateTo(view, "Opacity", 0.5f);
1269 /// <since_tizen> 3 </since_tizen>
1270 public float Opacity
1274 return (float)GetValue(OpacityProperty);
1278 SetValue(OpacityProperty, value);
1279 NotifyPropertyChanged();
1284 /// Sets the position of the view for X and Y.<br />
1285 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1286 /// If the position inheritance is disabled, sets the world position.<br />
1289 /// The property cascade chaining set is not recommended.
1292 /// This way is recommended for setting the property
1294 /// var view = new View();
1295 /// view.Position2D = new Position2D(100, 200);
1297 /// This way to set the property is prohibited
1299 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1302 /// <since_tizen> 3 </since_tizen>
1303 public Position2D Position2D
1307 return (Position2D)GetValue(Position2DProperty);
1311 SetValue(Position2DProperty, value);
1312 NotifyPropertyChanged();
1317 /// Retrieves the screen position of the view.<br />
1319 /// <since_tizen> 3 </since_tizen>
1320 public Vector2 ScreenPosition
1324 Vector2 temp = new Vector2(0.0f, 0.0f);
1325 var pValue = GetProperty(View.Property.ScreenPosition);
1333 /// Determines whether the pivot point should be used to determine the position of the view.
1334 /// This is false by default.
1336 /// <remarks>If false, then the top-left of the view is used for the position.
1337 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1339 /// <since_tizen> 3 </since_tizen>
1340 public bool PositionUsesPivotPoint
1344 return (bool)GetValue(PositionUsesPivotPointProperty);
1348 SetValue(PositionUsesPivotPointProperty, value);
1349 NotifyPropertyChanged();
1354 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1356 /// <since_tizen> 3 </since_tizen>
1357 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1359 "View view = new View(); " +
1360 "view.PivotPoint = PivotPoint.Center; " +
1361 "view.PositionUsesPivotPoint = true;" +
1362 " This has been deprecated in API5 and will be removed in API8")]
1363 [EditorBrowsable(EditorBrowsableState.Never)]
1364 public bool PositionUsesAnchorPoint
1368 return (bool)GetValue(PositionUsesAnchorPointProperty);
1372 SetValue(PositionUsesAnchorPointProperty, value);
1376 private bool InternalPositionUsesAnchorPoint
1381 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1382 pValue.Get(out temp);
1388 var temp = new Tizen.NUI.PropertyValue(value);
1389 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1391 NotifyPropertyChanged();
1396 /// Queries whether the view is connected to the stage.<br />
1397 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1399 /// <since_tizen> 3 </since_tizen>
1400 public bool IsOnWindow
1409 /// Gets the depth in the hierarchy for the view.
1411 /// <since_tizen> 3 </since_tizen>
1412 public int HierarchyDepth
1416 return GetHierarchyDepth();
1421 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1424 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1425 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1426 /// The values set by this property will likely change.
1428 /// <since_tizen> 3 </since_tizen>
1429 public int SiblingOrder
1433 return (int)GetValue(SiblingOrderProperty);
1437 SetValue(SiblingOrderProperty, value);
1439 Layout?.ChangeLayoutSiblingOrder(value);
1441 NotifyPropertyChanged();
1446 /// Returns the natural size of the view.
1449 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1451 /// <since_tizen> 5 </since_tizen>
1452 public Vector3 NaturalSize
1456 Vector3 ret = GetNaturalSize();
1457 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1463 /// Returns the natural size (Size2D) of the view.
1466 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1468 /// <since_tizen> 4 </since_tizen>
1469 public Size2D NaturalSize2D
1473 Vector3 temp = GetNaturalSize();
1474 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1476 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1483 /// Gets or sets the origin of a view within its parent's area.<br />
1484 /// 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 />
1485 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1486 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1488 /// <pre>The view has been initialized.</pre>
1489 /// <since_tizen> 3 </since_tizen>
1490 public Position ParentOrigin
1494 Position tmp = (Position)GetValue(ParentOriginProperty);
1495 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1499 SetValue(ParentOriginProperty, value);
1500 NotifyPropertyChanged();
1505 /// Gets or sets the anchor-point of a view.<br />
1506 /// 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 />
1507 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1508 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1509 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1510 /// <pre>The view has been initialized.</pre>
1513 /// The property cascade chaining set is not recommended.
1516 /// This way is recommended for setting the property
1518 /// var view = new View();
1519 /// view.PivotPoint = PivotPoint.Center;
1521 /// This way to set the property is prohibited
1523 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1526 /// <since_tizen> 3 </since_tizen>
1527 public Position PivotPoint
1531 return (Position)GetValue(PivotPointProperty);
1535 SetValue(PivotPointProperty, value);
1536 NotifyPropertyChanged();
1541 /// Gets or sets the size width of the view.
1545 /// Animatable - This property can be animated using <c>Animation</c> class.
1547 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1551 /// <since_tizen> 3 </since_tizen>
1552 public float SizeWidth
1556 return (float)GetValue(SizeWidthProperty);
1560 SetValue(SizeWidthProperty, value);
1561 NotifyPropertyChanged();
1566 /// Gets or sets the size height of the view.
1570 /// Animatable - This property can be animated using <c>Animation</c> class.
1573 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1576 /// <since_tizen> 3 </since_tizen>
1577 public float SizeHeight
1581 return (float)GetValue(SizeHeightProperty);
1585 SetValue(SizeHeightProperty, value);
1586 NotifyPropertyChanged();
1591 /// Gets or sets the position of the view.<br />
1592 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1593 /// If the position inheritance is disabled, sets the world position.<br />
1597 /// Animatable - This property can be animated using <c>Animation</c> class.
1599 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1602 /// The property cascade chaining set is not recommended.
1605 /// This way is recommended for setting the property
1607 /// var view = new View();
1608 /// view.Position = new Position(100, 200.5f, 0);
1610 /// This way to set the property is prohibited
1612 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1615 /// <since_tizen> 3 </since_tizen>
1616 public Position Position
1620 return (Position)GetValue(PositionProperty);
1624 SetValue(PositionProperty, value);
1625 NotifyPropertyChanged();
1630 /// Gets or sets the position X of the view.
1634 /// Animatable - This property can be animated using <c>Animation</c> class.
1636 /// animation.AnimateTo(view, "PositionX", 50.0f);
1640 /// <since_tizen> 3 </since_tizen>
1641 public float PositionX
1645 return (float)GetValue(PositionXProperty);
1649 SetValue(PositionXProperty, value);
1650 NotifyPropertyChanged();
1655 /// Gets or sets the position Y of the view.
1659 /// Animatable - This property can be animated using <c>Animation</c> class.
1661 /// animation.AnimateTo(view, "PositionY", 50.0f);
1665 /// <since_tizen> 3 </since_tizen>
1666 public float PositionY
1670 return (float)GetValue(PositionYProperty);
1674 SetValue(PositionYProperty, value);
1675 NotifyPropertyChanged();
1680 /// Gets or sets the position Z of the view.
1684 /// Animatable - This property can be animated using <c>Animation</c> class.
1686 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1690 /// <since_tizen> 3 </since_tizen>
1691 public float PositionZ
1695 return (float)GetValue(PositionZProperty);
1699 SetValue(PositionZProperty, value);
1700 NotifyPropertyChanged();
1705 /// Gets or sets the world position of the view.
1707 /// <since_tizen> 3 </since_tizen>
1708 public Vector3 WorldPosition
1712 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1713 var pValue = GetProperty(View.Property.WorldPosition);
1721 /// Gets or sets the orientation of the view.<br />
1722 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1726 /// This is an asynchronous method.
1729 /// Animatable - This property can be animated using <c>Animation</c> class.
1731 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1735 /// <since_tizen> 3 </since_tizen>
1736 public Rotation Orientation
1740 return (Rotation)GetValue(OrientationProperty);
1744 SetValue(OrientationProperty, value);
1745 NotifyPropertyChanged();
1750 /// Gets or sets the world orientation of the view.<br />
1752 /// <since_tizen> 3 </since_tizen>
1753 public Rotation WorldOrientation
1757 Rotation temp = new Rotation();
1758 var pValue = GetProperty(View.Property.WorldOrientation);
1766 /// Gets or sets the scale factor applied to the view.<br />
1770 /// Animatable - This property can be animated using <c>Animation</c> class.
1772 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1775 /// The property cascade chaining set is not recommended.
1778 /// This way is recommended for setting the property
1780 /// var view = new View();
1781 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1783 /// This way to set the property is prohibited
1785 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1788 /// <since_tizen> 3 </since_tizen>
1789 public Vector3 Scale
1793 return (Vector3)GetValue(ScaleProperty);
1797 SetValue(ScaleProperty, value);
1798 NotifyPropertyChanged();
1803 /// Gets or sets the scale X factor applied to the view.
1807 /// Animatable - This property can be animated using <c>Animation</c> class.
1809 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1813 /// <since_tizen> 3 </since_tizen>
1818 return (float)GetValue(ScaleXProperty);
1822 SetValue(ScaleXProperty, value);
1823 NotifyPropertyChanged();
1828 /// Gets or sets the scale Y factor applied to the view.
1832 /// Animatable - This property can be animated using <c>Animation</c> class.
1834 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1838 /// <since_tizen> 3 </since_tizen>
1843 return (float)GetValue(ScaleYProperty);
1847 SetValue(ScaleYProperty, value);
1848 NotifyPropertyChanged();
1853 /// Gets or sets the scale Z factor applied to the view.
1857 /// Animatable - This property can be animated using <c>Animation</c> class.
1859 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1863 /// <since_tizen> 3 </since_tizen>
1868 return (float)GetValue(ScaleZProperty);
1872 SetValue(ScaleZProperty, value);
1873 NotifyPropertyChanged();
1878 /// Gets the world scale of the view.
1880 /// <since_tizen> 3 </since_tizen>
1881 public Vector3 WorldScale
1885 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1886 var pValue = GetProperty(View.Property.WorldScale);
1894 /// Retrieves the visibility flag of the view.
1898 /// If the view is not visible, then the view and its children will not be rendered.
1899 /// 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.
1902 /// Animatable - This property can be animated using <c>Animation</c> class.
1904 /// animation.AnimateTo(view, "Visibility", false);
1908 /// <since_tizen> 3 </since_tizen>
1909 public bool Visibility
1914 var pValue = GetProperty(View.Property.VISIBLE);
1915 pValue.Get(out temp);
1922 /// Gets the view's world color.
1924 /// <since_tizen> 3 </since_tizen>
1925 public Vector4 WorldColor
1929 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1930 var pValue = GetProperty(View.Property.WorldColor);
1938 /// Gets or sets the view's name.
1940 /// <since_tizen> 3 </since_tizen>
1945 return (string)GetValue(NameProperty);
1949 SetValue(NameProperty, value);
1950 NotifyPropertyChanged();
1955 /// Get the number of children held by the view.
1957 /// <since_tizen> 3 </since_tizen>
1958 public new uint ChildCount
1962 return Convert.ToUInt32(Children.Count);
1967 /// Gets the view's ID.
1970 /// <since_tizen> 3 </since_tizen>
1980 /// Gets or sets the status of whether the view should emit touch or hover signals.
1981 /// If a View is made insensitive, then the View and its children are not hittable.
1983 /// <since_tizen> 3 </since_tizen>
1984 public bool Sensitive
1988 return (bool)GetValue(SensitiveProperty);
1992 SetValue(SensitiveProperty, value);
1993 NotifyPropertyChanged();
1998 /// Gets or sets the status of whether the view should be enabled user interactions.
1999 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
2001 /// <since_tizen> tizen_next </since_tizen>
2002 [EditorBrowsable(EditorBrowsableState.Never)]
2003 public bool IsEnabled
2007 return (bool)GetValue(IsEnabledProperty);
2011 SetValue(IsEnabledProperty, value);
2012 NotifyPropertyChanged();
2017 /// 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.
2019 /// <since_tizen> 3 </since_tizen>
2020 public bool LeaveRequired
2024 return (bool)GetValue(LeaveRequiredProperty);
2028 SetValue(LeaveRequiredProperty, value);
2029 NotifyPropertyChanged();
2034 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2036 /// <since_tizen> 3 </since_tizen>
2037 public bool InheritOrientation
2041 return (bool)GetValue(InheritOrientationProperty);
2045 SetValue(InheritOrientationProperty, value);
2046 NotifyPropertyChanged();
2051 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2053 /// <since_tizen> 3 </since_tizen>
2054 public bool InheritScale
2058 return (bool)GetValue(InheritScaleProperty);
2062 SetValue(InheritScaleProperty, value);
2063 NotifyPropertyChanged();
2068 /// Gets or sets the status of how the view and its children should be drawn.<br />
2069 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2070 /// 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 />
2071 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2072 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2073 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2075 /// <since_tizen> 3 </since_tizen>
2076 public DrawModeType DrawMode
2080 return (DrawModeType)GetValue(DrawModeProperty);
2084 SetValue(DrawModeProperty, value);
2085 NotifyPropertyChanged();
2090 /// Gets or sets the relative to parent size factor of the view.<br />
2091 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2092 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2095 /// The property cascade chaining set is not recommended.
2098 /// This way is recommended for setting the property
2100 /// var text = new TextField();
2101 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2103 /// This way to set the property is prohibited
2105 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2108 /// <since_tizen> 3 </since_tizen>
2109 public Vector3 SizeModeFactor
2113 return (Vector3)GetValue(SizeModeFactorProperty);
2117 SetValue(SizeModeFactorProperty, value);
2118 NotifyPropertyChanged();
2123 /// Gets or sets the width resize policy to be used.
2125 /// <since_tizen> 3 </since_tizen>
2126 public ResizePolicyType WidthResizePolicy
2130 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2134 SetValue(WidthResizePolicyProperty, value);
2135 NotifyPropertyChanged();
2140 /// Gets or sets the height resize policy to be used.
2142 /// <since_tizen> 3 </since_tizen>
2143 public ResizePolicyType HeightResizePolicy
2147 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2151 SetValue(HeightResizePolicyProperty, value);
2152 NotifyPropertyChanged();
2157 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2158 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2160 /// <since_tizen> 3 </since_tizen>
2161 public SizeScalePolicyType SizeScalePolicy
2165 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2169 SetValue(SizeScalePolicyProperty, value);
2170 NotifyPropertyChanged();
2175 /// Gets or sets the status of whether the width size is dependent on the height size.
2177 /// <since_tizen> 3 </since_tizen>
2178 public bool WidthForHeight
2182 return (bool)GetValue(WidthForHeightProperty);
2186 SetValue(WidthForHeightProperty, value);
2187 NotifyPropertyChanged();
2192 /// Gets or sets the status of whether the height size is dependent on the width size.
2194 /// <since_tizen> 3 </since_tizen>
2195 public bool HeightForWidth
2199 return (bool)GetValue(HeightForWidthProperty);
2203 SetValue(HeightForWidthProperty, value);
2204 NotifyPropertyChanged();
2209 /// Gets or sets the padding for use in layout.
2212 /// The property cascade chaining set is not recommended.
2215 /// This way is recommended for setting the property
2217 /// var view = new View();
2218 /// view.Padding = new Extents(5, 5, 5, 5);
2220 /// This way to set the property is prohibited
2222 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2225 /// <since_tizen> 5 </since_tizen>
2226 public Extents Padding
2230 return (Extents)GetValue(PaddingProperty);
2234 SetValue(PaddingProperty, value);
2235 NotifyPropertyChanged();
2240 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2242 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2244 /// The property cascade chaining set is not recommended.
2247 /// This way is recommended for setting the property
2249 /// var view = new View();
2250 /// view.MinimumSize = new Size2D(100, 200);
2252 /// This way to set the property is prohibited
2254 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2257 /// <since_tizen> 3 </since_tizen>
2258 public Size2D MinimumSize
2262 return (Size2D)GetValue(MinimumSizeProperty);
2268 throw new ArgumentNullException(nameof(value));
2272 // Note: it only works if minimum size is >= than natural size.
2273 // To force the size it should be done through the width&height spec or Size2D.
2274 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2275 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2276 layout.RequestLayout();
2278 SetValue(MinimumSizeProperty, value);
2279 NotifyPropertyChanged();
2284 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2287 /// This way is recommended for setting the property
2289 /// var view = new View();
2290 /// view.MaximumSize = new Size2D(100, 200);
2292 /// This way to set the property is prohibited
2294 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2297 /// <since_tizen> 3 </since_tizen>
2298 public Size2D MaximumSize
2302 return (Size2D)GetValue(MaximumSizeProperty);
2306 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2307 // MATCH_PARENT spec + parent container size can be used to limit
2310 layout.RequestLayout();
2312 SetValue(MaximumSizeProperty, value);
2313 NotifyPropertyChanged();
2318 /// Gets or sets whether a child view inherits it's parent's position.<br />
2319 /// Default is to inherit.<br />
2320 /// 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 />
2322 /// <since_tizen> 3 </since_tizen>
2323 public bool InheritPosition
2327 return (bool)GetValue(InheritPositionProperty);
2331 SetValue(InheritPositionProperty, value);
2332 NotifyPropertyChanged();
2337 /// Gets or sets the clipping behavior (mode) of it's children.
2339 /// <since_tizen> 3 </since_tizen>
2340 public ClippingModeType ClippingMode
2344 return (ClippingModeType)GetValue(ClippingModeProperty);
2348 SetValue(ClippingModeProperty, value);
2349 NotifyPropertyChanged();
2354 /// Gets the number of renderers held by the view.
2356 /// <since_tizen> 3 </since_tizen>
2357 public uint RendererCount
2361 return GetRendererCount();
2366 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2369 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2371 /// <since_tizen> 3 </since_tizen>
2372 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2374 "View view = new View(); " +
2375 "view.PivotPoint = PivotPoint.Center; " +
2376 "view.PositionUsesPivotPoint = true;")]
2377 [EditorBrowsable(EditorBrowsableState.Never)]
2378 public Position AnchorPoint
2382 return GetValue(AnchorPointProperty) as Position;
2386 SetValue(AnchorPointProperty, value);
2390 private Position InternalAnchorPoint
2394 Position temp = new Position(0.0f, 0.0f, 0.0f);
2395 var pValue = GetProperty(View.Property.AnchorPoint);
2398 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2404 var temp = new Tizen.NUI.PropertyValue(value);
2405 SetProperty(View.Property.AnchorPoint, temp);
2407 NotifyPropertyChanged();
2412 /// Sets the size of a view for the width, the height and the depth.<br />
2413 /// Geometry can be scaled to fit within this area.<br />
2414 /// This does not interfere with the view's scale factor.<br />
2415 /// The views default depth is the minimum of width and height.<br />
2419 /// Animatable - This property can be animated using <c>Animation</c> class.
2421 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2424 /// The property cascade chaining set is not recommended.
2427 /// This way is recommended for setting the property
2429 /// var view = new View();
2430 /// view.Size = new Size(100.5f, 200, 0);
2432 /// This way to set the property is prohibited
2434 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2437 /// <since_tizen> 5 </since_tizen>
2442 return (Size)GetValue(SizeProperty);
2446 SetValue(SizeProperty, value);
2447 NotifyPropertyChanged();
2452 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2454 /// <since_tizen> 3 </since_tizen>
2455 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2457 "Container parent = view.GetParent(); " +
2458 "View view = parent as View;")]
2459 [EditorBrowsable(EditorBrowsableState.Never)]
2460 public new View Parent
2465 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2466 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2467 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2469 if (basehandle is Layer layer)
2471 ret = new View(Layer.getCPtr(layer).Handle, false);
2472 NUILog.Error("This Parent property is deprecated, should do not be used");
2476 ret = basehandle as View;
2479 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2480 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2482 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2488 /// Gets/Sets whether inherit parent's the layout Direction.
2490 /// <since_tizen> 4 </since_tizen>
2491 public bool InheritLayoutDirection
2495 return (bool)GetValue(InheritLayoutDirectionProperty);
2499 SetValue(InheritLayoutDirectionProperty, value);
2500 NotifyPropertyChanged();
2505 /// Gets/Sets the layout Direction.
2507 /// <since_tizen> 4 </since_tizen>
2508 public ViewLayoutDirectionType LayoutDirection
2512 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2516 SetValue(LayoutDirectionProperty, value);
2517 NotifyPropertyChanged();
2518 layout?.RequestLayout();
2523 /// Gets or sets the Margin for use in layout.
2526 /// Margin property is supported by Layout algorithms and containers.
2527 /// Please Set Layout if you want to use Margin property.
2528 /// The property cascade chaining set is not recommended.
2531 /// This way is recommended for setting the property
2533 /// var view = new View();
2534 /// view.Margin = new Extents(10, 5, 15, 20);
2536 /// This way to set the property is prohibited
2538 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2541 /// <since_tizen> 4 </since_tizen>
2542 public Extents Margin
2546 return (Extents)GetValue(MarginProperty);
2550 SetValue(MarginProperty, value);
2551 NotifyPropertyChanged();
2556 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2560 /// // matchParentView matches its size to its parent size.
2561 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2562 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2564 /// // wrapContentView wraps its children with their desired size.
2565 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2566 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2568 /// // exactSizeView shows itself with an exact size.
2569 /// exactSizeView.WidthSpecification = 100;
2570 /// exactSizeView.HeightSpecification = 100;
2573 /// <since_tizen> 6 </since_tizen>
2574 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2575 public int WidthSpecification
2579 return (int)GetValue(WidthSpecificationProperty);
2583 SetValue(WidthSpecificationProperty, value);
2584 NotifyPropertyChanged();
2588 private int InternalWidthSpecification
2596 if (value == widthPolicy)
2599 widthPolicy = value;
2600 if (widthPolicy >= 0)
2602 if (heightPolicy >= 0) // Policy an exact value
2604 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2605 Size2D = new Size2D(widthPolicy, heightPolicy);
2608 layout?.RequestLayout();
2613 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2617 /// // matchParentView matches its size to its parent size.
2618 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2619 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2621 /// // wrapContentView wraps its children with their desired size.
2622 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2623 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2625 /// // exactSizeView shows itself with an exact size.
2626 /// exactSizeView.WidthSpecification = 100;
2627 /// exactSizeView.HeightSpecification = 100;
2630 /// <since_tizen> 6 </since_tizen>
2631 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2632 public int HeightSpecification
2636 return (int)GetValue(HeightSpecificationProperty);
2640 SetValue(HeightSpecificationProperty, value);
2641 NotifyPropertyChanged();
2645 private int InternalHeightSpecification
2649 return heightPolicy;
2653 if (value == heightPolicy)
2656 heightPolicy = value;
2657 if (heightPolicy >= 0)
2659 if (widthPolicy >= 0) // Policy an exact value
2661 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2662 Size2D = new Size2D(widthPolicy, heightPolicy);
2665 layout?.RequestLayout();
2670 /// Gets the List of transitions for this View.
2672 /// <since_tizen> 6 </since_tizen>
2673 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2677 if (layoutTransitions == null)
2679 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2681 return layoutTransitions;
2686 /// Sets a layout transitions for this View.
2688 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2690 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2692 /// <since_tizen> 6 </since_tizen>
2693 public LayoutTransition LayoutTransition
2697 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2701 SetValue(LayoutTransitionProperty, value);
2702 NotifyPropertyChanged();
2706 private LayoutTransition InternalLayoutTransition
2710 return layoutTransition;
2716 throw new global::System.ArgumentNullException(nameof(value));
2718 if (layoutTransitions == null)
2720 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2723 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2725 AttachTransitionsToChildren(value);
2727 layoutTransition = value;
2732 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2735 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2737 /// <since_tizen> 4 </since_tizen>
2738 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2739 [EditorBrowsable(EditorBrowsableState.Never)]
2740 public Extents PaddingEX
2744 return GetValue(PaddingEXProperty) as Extents;
2748 SetValue(PaddingEXProperty, value);
2752 private Extents InternalPaddingEX
2756 Extents temp = new Extents(0, 0, 0, 0);
2757 var pValue = GetProperty(View.Property.PADDING);
2760 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2766 var temp = new Tizen.NUI.PropertyValue(value);
2767 SetProperty(View.Property.PADDING, temp);
2769 NotifyPropertyChanged();
2770 layout?.RequestLayout();
2775 /// The Color of View. This is an RGBA value.
2776 /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
2777 /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
2778 /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
2779 /// Inherient of color value depend on <see cref="ColorMode"/>.
2783 /// Animatable - This property can be animated using <c>Animation</c> class.
2785 /// The property cascade chaining set is not recommended.
2788 /// This way is recommended for setting the property
2790 /// var view = new View();
2791 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2793 /// This way to set the property is prohibited
2795 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2798 [EditorBrowsable(EditorBrowsableState.Never)]
2803 return (Color)GetValue(ColorProperty);
2807 SetValue(ColorProperty, value);
2808 NotifyPropertyChanged();
2813 /// The Red component of View.Color.
2817 /// Animatable - This property can be animated using <c>Animation</c> class.
2820 [EditorBrowsable(EditorBrowsableState.Never)]
2821 public float ColorRed
2825 return (float)GetValue(ColorRedProperty);
2829 SetValue(ColorRedProperty, value);
2830 NotifyPropertyChanged();
2835 /// The Green component of View.Color.
2839 /// Animatable - This property can be animated using <c>Animation</c> class.
2842 [EditorBrowsable(EditorBrowsableState.Never)]
2843 public float ColorGreen
2847 return (float)GetValue(ColorGreenProperty);
2851 SetValue(ColorGreenProperty, value);
2852 NotifyPropertyChanged();
2857 /// The Blue component of View.Color.
2861 /// Animatable - This property can be animated using <c>Animation</c> class.
2864 [EditorBrowsable(EditorBrowsableState.Never)]
2865 public float ColorBlue
2869 return (float)GetValue(ColorBlueProperty);
2873 SetValue(ColorBlueProperty, value);
2874 NotifyPropertyChanged();
2879 /// Set the layout on this View. Replaces any existing Layout.
2882 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2884 /// <since_tizen> 6 </since_tizen>
2885 public LayoutItem Layout
2889 return GetValue(LayoutProperty) as LayoutItem;
2893 SetValue(LayoutProperty, value);
2897 private LayoutItem InternalLayout
2905 // Do nothing if layout provided is already set on this View.
2906 if (value == layout)
2911 LayoutingDisabled = false;
2914 // If new layout being set already has a owner then that owner receives a replacement default layout.
2915 // First check if the layout to be set already has a owner.
2916 if (value?.Owner != null)
2918 // Previous owner of the layout gets a default layout as a replacement.
2919 value.Owner.Layout = new AbsoluteLayout()
2921 // Copy Margin and Padding to replacement LayoutGroup.
2922 Margin = value.Margin,
2923 Padding = value.Padding,
2927 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2928 // View if no replacement. Previously margin and padding values would have been moved from
2929 // the View to the layout.
2930 if (layout != null) // Existing layout
2934 // Existing layout being replaced so copy over margin and padding values.
2935 value.Margin = layout.Margin;
2936 value.Padding = layout.Padding;
2937 value.SetPositionByLayout = !excludeLayouting;
2941 // Layout not being replaced so restore margin and padding to View.
2942 SetValue(MarginProperty, layout.Margin);
2943 SetValue(PaddingProperty, layout.Padding);
2944 NotifyPropertyChanged();
2949 // First Layout to be added to the View hence copy
2951 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2954 Extents margin = Margin;
2955 Extents padding = Padding;
2956 bool setMargin = false;
2957 bool setPadding = false;
2959 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2961 // If View already has a margin set then store it in Layout instead.
2962 value.Margin = margin;
2963 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2967 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
2969 // If View already has a padding set then store it in Layout instead.
2970 value.Padding = padding;
2971 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
2975 if (setMargin || setPadding)
2977 NotifyPropertyChanged();
2980 value.SetPositionByLayout = !excludeLayouting;
2984 // Remove existing layout from it's parent layout group.
2987 // Set layout to this view
2993 /// The weight of the View, used to share available space in a layout with siblings.
2995 /// <since_tizen> 6 </since_tizen>
3005 layout?.RequestLayout();
3010 /// Whether to load the BackgroundImage synchronously.
3011 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3012 /// Note: For Normal Quad images only.
3014 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
3015 [EditorBrowsable(EditorBrowsableState.Never)]
3016 public bool BackgroundImageSynchronosLoading
3020 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
3024 SetValue(BackgroundImageSynchronosLoadingProperty, value);
3025 NotifyPropertyChanged();
3029 private bool InternalBackgroundImageSynchronosLoading
3033 return BackgroundImageSynchronousLoading;
3037 BackgroundImageSynchronousLoading = value;
3042 /// Whether to load the BackgroundImage synchronously.
3043 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
3044 /// Note: For Normal Quad images only.
3046 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3047 [EditorBrowsable(EditorBrowsableState.Never)]
3048 public bool BackgroundImageSynchronousLoading
3052 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
3056 SetValue(BackgroundImageSynchronousLoadingProperty, value);
3057 NotifyPropertyChanged();
3061 private bool InternalBackgroundImageSynchronousLoading
3065 return backgroundImageSynchronousLoading;
3069 backgroundImageSynchronousLoading = value;
3071 string bgUrl = null;
3072 var pValue = Background.Find(ImageVisualProperty.URL);
3073 pValue?.Get(out bgUrl);
3076 if (!string.IsNullOrEmpty(bgUrl))
3078 PropertyMap bgMap = this.Background;
3079 var temp = new PropertyValue(backgroundImageSynchronousLoading);
3080 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
3087 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
3088 [EditorBrowsable(EditorBrowsableState.Never)]
3089 public Vector4 UpdateAreaHint
3093 return (Vector4)GetValue(UpdateAreaHintProperty);
3097 SetValue(UpdateAreaHintProperty, value);
3098 NotifyPropertyChanged();
3103 /// Enable/Disable ControlState propagation for children.
3104 /// It is false by default.
3105 /// If the View needs to share ControlState with descendants, please set it true.
3106 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3108 [EditorBrowsable(EditorBrowsableState.Never)]
3109 public bool EnableControlStatePropagation
3113 return (bool)GetValue(EnableControlStatePropagationProperty);
3117 SetValue(EnableControlStatePropagationProperty, value);
3118 NotifyPropertyChanged();
3122 private bool InternalEnableControlStatePropagation
3124 get => themeData?.ControlStatePropagation ?? false;
3127 if (InternalEnableControlStatePropagation == value) return;
3129 if (themeData == null) themeData = new ThemeData();
3131 themeData.ControlStatePropagation = value;
3133 foreach (View child in Children)
3135 child.EnableControlStatePropagation = value;
3141 /// The ControlStates can propagate from the parent.
3142 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3143 /// if parent view EnableControlState is true.
3144 /// <see cref="EnableControlState"/>.
3145 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3147 [EditorBrowsable(EditorBrowsableState.Never)]
3148 public ControlState PropagatableControlStates
3152 return (ControlState)GetValue(PropagatableControlStatesProperty);
3156 SetValue(PropagatableControlStatesProperty, value);
3157 NotifyPropertyChanged();
3161 private ControlState InternalPropagatableControlStates
3163 get => propagatableControlStates;
3164 set => propagatableControlStates = value;
3168 /// By default, it is false in View, true in Control.
3169 /// Note that if the value is true, the View will be a touch receptor.
3171 [EditorBrowsable(EditorBrowsableState.Never)]
3172 public bool EnableControlState
3176 return (bool)GetValue(EnableControlStateProperty);
3180 SetValue(EnableControlStateProperty, value);
3185 /// Whether the actor grab all touches even if touch leaves its boundary.
3187 /// <returns>true, if it grab all touch after start</returns>
3188 [EditorBrowsable(EditorBrowsableState.Never)]
3189 public bool GrabTouchAfterLeave
3193 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3197 SetValue(GrabTouchAfterLeaveProperty, value);
3201 private bool InternalGrabTouchAfterLeave
3206 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
3207 pValue.Get(out temp);
3213 var temp = new Tizen.NUI.PropertyValue(value);
3214 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
3216 NotifyPropertyChanged();
3221 /// Whether the view will only receive own touch.
3223 /// <returns>true, if it only receives touches that started from itself.</returns>
3224 [EditorBrowsable(EditorBrowsableState.Never)]
3225 public bool AllowOnlyOwnTouch
3229 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3233 SetValue(AllowOnlyOwnTouchProperty, value);
3237 private bool InternalAllowOnlyOwnTouch
3242 var pValue = GetProperty(View.Property.AllowOnlyOwnTouch);
3243 pValue.Get(out temp);
3249 var temp = new Tizen.NUI.PropertyValue(value);
3250 SetProperty(View.Property.AllowOnlyOwnTouch, temp);
3252 NotifyPropertyChanged();
3257 /// Determines which blend equation will be used to render renderers of this actor.
3259 /// <returns>blend equation enum currently assigned</returns>
3260 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3261 [EditorBrowsable(EditorBrowsableState.Never)]
3262 public BlendEquationType BlendEquation
3266 return (BlendEquationType)GetValue(BlendEquationProperty);
3270 SetValue(BlendEquationProperty, value);
3274 private BlendEquationType InternalBlendEquation
3279 var pValue = GetProperty(View.Property.BlendEquation);
3280 pValue.Get(out temp);
3282 return (BlendEquationType)temp;
3286 var temp = new Tizen.NUI.PropertyValue((int)value);
3287 SetProperty(View.Property.BlendEquation, temp);
3289 NotifyPropertyChanged();
3294 /// If the value is true, the View will change its style as the theme changes.
3295 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3297 /// <since_tizen> 9 </since_tizen>
3298 public bool ThemeChangeSensitive
3300 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3301 set => SetValue(ThemeChangeSensitiveProperty, value);
3305 /// Create Style, it is abstract function and must be override.
3307 [EditorBrowsable(EditorBrowsableState.Never)]
3308 protected virtual ViewStyle CreateViewStyle()
3310 return new ViewStyle();
3314 /// Called after the View's ControlStates changed.
3316 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3317 [EditorBrowsable(EditorBrowsableState.Never)]
3318 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3324 [EditorBrowsable(EditorBrowsableState.Never)]
3325 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3327 isThemeChanged = true;
3328 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3329 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3330 isThemeChanged = false;
3334 /// Apply style instance to the view.
3335 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3337 /// <since_tizen> 9 </since_tizen>
3338 public virtual void ApplyStyle(ViewStyle viewStyle)
3340 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3342 if (themeData == null) themeData = new ThemeData();
3344 themeData.viewStyle = viewStyle;
3346 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3352 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3354 if (bindablePropertyOfView == null)
3359 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3360 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3362 foreach (var sourceProperty in dirtyStyleProperties)
3364 var sourceValue = viewStyle.GetValue(sourceProperty);
3366 if (sourceValue == null)
3371 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3373 // Do not set value again when theme is changed and the value has been set already.
3374 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3379 if (destinationProperty != null)
3381 InternalSetValue(destinationProperty, sourceValue);
3387 /// Get whether the View is culled or not.
3388 /// True means that the View is out of the view frustum.
3391 /// Hidden-API (Inhouse-API).
3393 [EditorBrowsable(EditorBrowsableState.Never)]
3399 var pValue = GetProperty(View.Property.Culled);
3400 pValue.Get(out temp);
3407 /// Set or Get TransitionOptions for the page transition.
3408 /// This property is used to define how this view will be transitioned during Page switching.
3410 /// <since_tizen> 9 </since_tizen>
3411 public TransitionOptions TransitionOptions
3415 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3419 SetValue(TransitionOptionsProperty, value);
3420 NotifyPropertyChanged();
3424 private TransitionOptions InternalTransitionOptions
3428 transitionOptions = value;
3432 return transitionOptions;
3437 /// Gets or sets the status of whether the view should emit key event signals.
3438 /// If a View's DispatchKeyEvents is set to false, then it's children will not emit a key event signal either.
3440 [EditorBrowsable(EditorBrowsableState.Never)]
3441 public bool DispatchKeyEvents
3445 return (bool)GetValue(DispatchKeyEventsProperty);
3449 SetValue(DispatchKeyEventsProperty, value);
3450 NotifyPropertyChanged();
3455 /// Gets or sets the status of whether touch events can be dispatched.
3456 /// 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.
3457 /// This works without adding a TouchEvent callback in the View.
3459 /// 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.
3462 [EditorBrowsable(EditorBrowsableState.Never)]
3463 public bool DispatchTouchEvents
3467 return dispatchTouchEvents;
3471 if (dispatchTouchEvents != value)
3473 dispatchTouchEvents = value;
3474 if (dispatchTouchEvents == false)
3476 TouchEvent += OnDispatchTouchEvent;
3480 TouchEvent -= OnDispatchTouchEvent;
3486 private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
3492 /// Called when the view is hit through TouchEvent or GestureEvent.
3493 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3494 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3495 /// User can override whether hit or not in HitTest.
3496 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3497 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3499 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3500 [EditorBrowsable(EditorBrowsableState.Never)]
3501 protected virtual bool HitTest(Touch touch)
3507 /// Retrieve the View's current Color.
3510 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3511 /// 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).
3512 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3513 /// and users can get the current actual values through them.
3515 [EditorBrowsable(EditorBrowsableState.Never)]
3516 public Color CurrentColor => GetCurrentColor();
3519 /// Retrieve the current scale factor applied to the View.
3522 /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
3523 /// 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).
3524 /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
3525 /// and users can get the current actual values through them.
3527 [EditorBrowsable(EditorBrowsableState.Never)]
3528 public Vector3 CurrentScale => GetCurrentScale();