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;
77 RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
78 RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
79 RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
80 RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
82 RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
83 RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
84 RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
85 RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
87 RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
88 RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
89 RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
90 RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
92 RegisterAccessibilityDelegate();
96 /// Creates a new instance of a view.
98 /// <since_tizen> 3 </since_tizen>
99 public View() : this(Interop.View.New(), true)
101 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
105 [EditorBrowsable(EditorBrowsableState.Never)]
106 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
111 /// Create a new instance of a View with setting the status of shown or hidden.
113 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
114 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
115 [EditorBrowsable(EditorBrowsableState.Never)]
116 public View(bool shown) : this(Interop.View.New(), true)
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
124 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
130 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
133 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
135 InitializeStyle(viewStyle);
138 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
142 PositionUsesPivotPoint = false;
145 onWindowSendEventCallback = SendViewAddedEventToWindow;
146 using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
147 signal?.Connect(onWindowSendEventCallback);
149 hitTestResultDataCallback = OnHitTestResult;
150 using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
151 touchDataSignal?.Connect(hitTestResultDataCallback);
158 GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
159 AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
162 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
164 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173 /// The event that is triggered when the View's ControlState is changed.
175 [EditorBrowsable(EditorBrowsableState.Never)]
176 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
178 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
182 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
184 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
185 [EditorBrowsable(EditorBrowsableState.Never)]
186 public bool LayoutSet
195 /// Flag to allow Layouting to be disabled for Views.
196 /// Once a View has a Layout set then any children added to Views from then on will receive
197 /// automatic Layouts.
199 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
200 [EditorBrowsable(EditorBrowsableState.Never)]
201 public static bool LayoutingDisabled { get; set; } = true;
204 /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
206 /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
207 [EditorBrowsable(EditorBrowsableState.Never)]
208 public static void SetDefaultGrabTouchAfterLeave(bool enable)
210 defaultGrabTouchAfterLeave = enable;
214 /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
216 /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
217 [EditorBrowsable(EditorBrowsableState.Never)]
218 public static void SetDefaultAllowOnlyOwnTouch(bool enable)
220 defaultAllowOnlyOwnTouch = enable;
224 /// Deprecate. Do not use this.
225 /// The style instance applied to this view.
226 /// Note that do not modify the ViewStyle.
227 /// Modifying ViewStyle will affect other views with same ViewStyle.
229 [EditorBrowsable(EditorBrowsableState.Never)]
230 protected ViewStyle ViewStyle
234 if (themeData == null) themeData = new ThemeData();
236 if (themeData.viewStyle == null)
238 ApplyStyle(CreateViewStyle());
240 return themeData.viewStyle;
245 /// Get/Set the control state.
246 /// Note that the ControlState only available for the classes derived from Control.
247 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
248 /// please set <see cref="EnableControlState"/> to true.
250 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
251 [EditorBrowsable(EditorBrowsableState.Never)]
252 public ControlState ControlState
256 return themeData == null ? ControlState.Normal : themeData.controlStates;
260 if (ControlState == value)
265 var prevState = ControlState;
267 if (themeData == null) themeData = new ThemeData();
268 themeData.controlStates = value;
270 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
272 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
274 if (themeData.ControlStatePropagation)
276 foreach (View child in Children)
278 ControlState allowed = child.PropagatableControlStates;
279 if (allowed.Contains(ControlState.All))
281 child.ControlState = value;
285 ControlState newControlState = child.ControlState;
287 if (allowed.Contains(ControlState.Normal))
289 if (value.Contains(ControlState.Normal))
291 newControlState += ControlState.Normal;
295 newControlState -= ControlState.Normal;
299 if (allowed.Contains(ControlState.Disabled))
301 if (value.Contains(ControlState.Disabled))
303 newControlState += ControlState.Disabled;
307 newControlState -= ControlState.Disabled;
311 if (allowed.Contains(ControlState.Selected))
313 if (value.Contains(ControlState.Selected))
315 newControlState += ControlState.Selected;
319 newControlState -= ControlState.Selected;
323 if (allowed.Contains(ControlState.Pressed))
325 if (value.Contains(ControlState.Pressed))
327 newControlState += ControlState.Pressed;
331 newControlState -= ControlState.Pressed;
335 if (allowed.Contains(ControlState.Focused))
337 if (value.Contains(ControlState.Focused))
339 newControlState += ControlState.Focused;
343 newControlState -= ControlState.Focused;
347 if (allowed.Contains(ControlState.Other))
349 if (value.Contains(ControlState.Other))
351 newControlState += ControlState.Other;
355 newControlState -= ControlState.Other;
359 if (child.ControlState != newControlState)
360 child.ControlState = newControlState;
365 OnControlStateChanged(changeInfo);
367 ControlStateChangedEvent?.Invoke(this, changeInfo);
372 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
374 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
375 [EditorBrowsable(EditorBrowsableState.Never)]
376 public bool ExcludeLayouting
380 return (bool)GetValue(ExcludeLayoutingProperty);
384 SetValue(ExcludeLayoutingProperty, value);
385 NotifyPropertyChanged();
389 private bool InternalExcludeLayouting
393 return excludeLayouting;
397 excludeLayouting = value;
398 if (Layout != null && Layout.SetPositionByLayout == value)
400 Layout.SetPositionByLayout = !value;
401 Layout.RequestLayout();
407 /// The StyleName, type string.
408 /// The value indicates DALi style name defined in json theme file.
410 /// <since_tizen> 3 </since_tizen>
411 public string StyleName
415 return (string)GetValue(StyleNameProperty);
419 SetValue(StyleNameProperty, value);
420 NotifyPropertyChanged();
425 /// The KeyInputFocus, type bool.
427 [EditorBrowsable(EditorBrowsableState.Never)]
428 public bool KeyInputFocus
432 return (bool)GetValue(KeyInputFocusProperty);
436 SetValue(KeyInputFocusProperty, value);
437 NotifyPropertyChanged();
442 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
446 /// The property cascade chaining set is not recommended.
449 /// Animatable - This property can be animated using <c>Animation</c> class.
451 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
456 /// This way is recommended for setting the property
458 /// var view = new View();
459 /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
461 /// This way to set the property is prohibited
463 /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
466 /// <since_tizen> 3 </since_tizen>
467 public Color BackgroundColor
471 return (Color)GetValue(BackgroundColorProperty);
475 SetValue(BackgroundColorProperty, value);
476 NotifyPropertyChanged();
481 /// The mutually exclusive with "backgroundColor" and "background" type Map.
483 /// <since_tizen> 3 </since_tizen>
484 public string BackgroundImage
488 return (string)GetValue(BackgroundImageProperty);
492 SetValue(BackgroundImageProperty, value);
493 NotifyPropertyChanged();
498 /// Get or set the border of background image.
500 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
501 [EditorBrowsable(EditorBrowsableState.Never)]
502 public Rectangle BackgroundImageBorder
506 return (Rectangle)GetValue(BackgroundImageBorderProperty);
510 SetValue(BackgroundImageBorderProperty, value);
511 NotifyPropertyChanged();
516 /// The background of view.
518 /// <since_tizen> 3 </since_tizen>
519 public Tizen.NUI.PropertyMap Background
523 return (PropertyMap)GetValue(BackgroundProperty);
527 SetValue(BackgroundProperty, value);
528 NotifyPropertyChanged();
533 /// Describes a shadow as an image for a View.
534 /// It is null by default.
537 /// Getter returns copied instance of current shadow.
540 /// The mutually exclusive with "BoxShadow".
544 /// Animatable - This property can be animated using <c>Animation</c> class.
545 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
547 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
549 /// Animatable sub-property : Offset.
552 [EditorBrowsable(EditorBrowsableState.Never)]
553 public ImageShadow ImageShadow
557 return (ImageShadow)GetValue(ImageShadowProperty);
561 SetValue(ImageShadowProperty, value);
562 NotifyPropertyChanged();
567 /// Describes a box shaped shadow drawing for a View.
568 /// It is null by default.
571 /// The mutually exclusive with "ImageShadow".
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, "BoxShadow.BlurRadius".
578 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
580 /// Animatable sub-property : Offset, Color, BlurRadius.
583 /// <since_tizen> 9 </since_tizen>
584 public Shadow BoxShadow
588 return (Shadow)GetValue(BoxShadowProperty);
592 SetValue(BoxShadowProperty, value);
593 NotifyPropertyChanged();
598 /// The radius for the rounded corners of the View.
599 /// This will rounds background and shadow edges.
600 /// 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).
601 /// Each radius will clamp internally to the half of smaller of the view's width or height.
602 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
606 /// Animatable - This property can be animated using <c>Animation</c> class.
608 /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
612 /// <since_tizen> 9 </since_tizen>
613 public Vector4 CornerRadius
617 return (Vector4)GetValue(CornerRadiusProperty);
621 SetValue(CornerRadiusProperty, value);
622 NotifyPropertyChanged();
627 /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
628 /// It is absolute by default.
629 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
631 /// <since_tizen> 9 </since_tizen>
632 public VisualTransformPolicyType CornerRadiusPolicy
634 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
635 set => SetValue(CornerRadiusPolicyProperty, value);
639 /// The width for the borderline of the View.
643 /// Animatable - This property can be animated using <c>Animation</c> class.
645 /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
648 /// Note that, an image background may not have borderline if it uses the Border property.
650 /// <since_tizen> 9 </since_tizen>
651 public float BorderlineWidth
655 return (float)GetValue(BorderlineWidthProperty);
659 SetValue(BorderlineWidthProperty, value);
660 NotifyPropertyChanged();
665 /// The color for the borderline of the View.
666 /// It is Color.Black by default.
670 /// Animatable - This property can be animated using <c>Animation</c> class.
672 /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
676 /// <since_tizen> 9 </since_tizen>
677 public Color BorderlineColor
681 return (Color)GetValue(BorderlineColorProperty);
685 SetValue(BorderlineColorProperty, value);
686 NotifyPropertyChanged();
691 /// The Relative offset for the borderline of the View.
692 /// Recommended range : [-1.0f to 1.0f].
693 /// If -1.0f, draw borderline inside of the View.
694 /// If 1.0f, draw borderline outside of the View.
695 /// If 0.0f, draw borderline half inside and half outside.
696 /// It is 0.0f by default.
700 /// Animatable - This property can be animated using <c>Animation</c> class.
702 /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
706 /// <since_tizen> 9 </since_tizen>
707 public float BorderlineOffset
711 return (float)GetValue(BorderlineOffsetProperty);
715 SetValue(BorderlineOffsetProperty, value);
716 NotifyPropertyChanged();
721 /// The current state of the view.
723 /// <since_tizen> 3 </since_tizen>
728 return (States)GetValue(StateProperty);
732 SetValue(StateProperty, value);
733 NotifyPropertyChanged();
738 /// The current sub state of the view.
740 /// <since_tizen> 3 </since_tizen>
741 public States SubState
745 return (States)GetValue(SubStateProperty);
749 SetValue(SubStateProperty, value);
750 NotifyPropertyChanged();
755 /// Displays a tooltip
757 /// <since_tizen> 3 </since_tizen>
758 public Tizen.NUI.PropertyMap Tooltip
762 return (PropertyMap)GetValue(TooltipProperty);
766 SetValue(TooltipProperty, value);
767 NotifyPropertyChanged();
772 /// Displays a tooltip as a text.
774 /// <since_tizen> 3 </since_tizen>
775 public string TooltipText
779 return GetValue(TooltipTextProperty) as string;
783 SetValue(TooltipTextProperty, value);
787 private string InternalTooltipText
791 using (var propertyValue = GetProperty(Property.TOOLTIP))
793 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
795 return retrivedValue;
797 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
798 return "error to get TooltipText";
803 var temp = new Tizen.NUI.PropertyValue(value);
804 SetProperty(View.Property.TOOLTIP, temp);
806 NotifyPropertyChanged();
811 /// The Child property of FlexContainer.<br />
812 /// The proportion of the free space in the container, the flex item will receive.<br />
813 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
815 /// <since_tizen> 3 </since_tizen>
816 [Obsolete("Deprecated in API8, will be removed in API10.")]
821 return (float)GetValue(FlexProperty);
825 SetValue(FlexProperty, value);
826 NotifyPropertyChanged();
831 /// The Child property of FlexContainer.<br />
832 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
834 /// <since_tizen> 3 </since_tizen>
835 [Obsolete("Deprecated in API8, will be removed in API10.")]
840 return (int)GetValue(AlignSelfProperty);
844 SetValue(AlignSelfProperty, value);
845 NotifyPropertyChanged();
850 /// The Child property of FlexContainer.<br />
851 /// The space around the flex item.<br />
854 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
856 /// <since_tizen> 3 </since_tizen>
857 [Obsolete("Deprecated in API8, will be removed in API10.")]
858 public Vector4 FlexMargin
862 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
863 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
867 SetValue(FlexMarginProperty, value);
868 NotifyPropertyChanged();
873 /// The top-left cell this child occupies, if not set, the first available cell is used.
876 /// The property cascade chaining set is not recommended.
877 /// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
880 /// This way is recommended for setting the property
882 /// var view = new View();
883 /// view.CellIndex = new Vector2(1, 3);
885 /// This way to set the property is prohibited
887 /// view.CellIndex.X = 1; //This does not guarantee a proper operation
890 /// <since_tizen> 3 </since_tizen>
891 public Vector2 CellIndex
895 return (Vector2)GetValue(CellIndexProperty);
899 SetValue(CellIndexProperty, value);
900 NotifyPropertyChanged();
905 /// The number of rows this child occupies, if not set, the default value is 1.
908 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
910 /// <since_tizen> 3 </since_tizen>
915 return (float)GetValue(RowSpanProperty);
919 SetValue(RowSpanProperty, value);
920 NotifyPropertyChanged();
925 /// The number of columns this child occupies, if not set, the default value is 1.
928 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
930 /// <since_tizen> 3 </since_tizen>
931 public float ColumnSpan
935 return (float)GetValue(ColumnSpanProperty);
939 SetValue(ColumnSpanProperty, value);
940 NotifyPropertyChanged();
945 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
948 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
950 /// <since_tizen> 3 </since_tizen>
951 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
955 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
959 SetValue(CellHorizontalAlignmentProperty, value);
960 NotifyPropertyChanged();
965 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
968 /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
970 /// <since_tizen> 3 </since_tizen>
971 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
975 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
979 SetValue(CellVerticalAlignmentProperty, value);
980 NotifyPropertyChanged();
985 /// The left focusable view.<br />
986 /// This will return null if not set.<br />
987 /// This will also return null if the specified left focusable view is not on a window.<br />
989 /// <since_tizen> 3 </since_tizen>
990 public View LeftFocusableView
992 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
995 return (View)GetValue(LeftFocusableViewProperty);
999 SetValue(LeftFocusableViewProperty, value);
1000 NotifyPropertyChanged();
1005 /// The right focusable view.<br />
1006 /// This will return null if not set.<br />
1007 /// This will also return null if the specified right focusable view is not on a window.<br />
1009 /// <since_tizen> 3 </since_tizen>
1010 public View RightFocusableView
1012 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1015 return (View)GetValue(RightFocusableViewProperty);
1019 SetValue(RightFocusableViewProperty, value);
1020 NotifyPropertyChanged();
1025 /// The up focusable view.<br />
1026 /// This will return null if not set.<br />
1027 /// This will also return null if the specified up focusable view is not on a window.<br />
1029 /// <since_tizen> 3 </since_tizen>
1030 public View UpFocusableView
1032 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1035 return (View)GetValue(UpFocusableViewProperty);
1039 SetValue(UpFocusableViewProperty, value);
1040 NotifyPropertyChanged();
1045 /// The down focusable view.<br />
1046 /// This will return null if not set.<br />
1047 /// This will also return null if the specified down focusable view is not on a window.<br />
1049 /// <since_tizen> 3 </since_tizen>
1050 public View DownFocusableView
1052 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1055 return (View)GetValue(DownFocusableViewProperty);
1059 SetValue(DownFocusableViewProperty, value);
1060 NotifyPropertyChanged();
1065 /// The clockwise focusable view by rotary wheel.<br />
1066 /// This will return null if not set.<br />
1067 /// This will also return null if the specified clockwise focusable view is not on a window.<br />
1069 [EditorBrowsable(EditorBrowsableState.Never)]
1070 public View ClockwiseFocusableView
1072 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1075 return (View)GetValue(ClockwiseFocusableViewProperty);
1079 SetValue(ClockwiseFocusableViewProperty, value);
1080 NotifyPropertyChanged();
1085 /// The counter clockwise focusable view by rotary wheel.<br />
1086 /// This will return null if not set.<br />
1087 /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
1089 [EditorBrowsable(EditorBrowsableState.Never)]
1090 public View CounterClockwiseFocusableView
1092 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1095 return (View)GetValue(CounterClockwiseFocusableViewProperty);
1099 SetValue(CounterClockwiseFocusableViewProperty, value);
1100 NotifyPropertyChanged();
1105 /// Whether the view should be focusable by keyboard navigation.
1107 /// <since_tizen> 3 </since_tizen>
1108 public bool Focusable
1112 SetValue(FocusableProperty, value);
1113 NotifyPropertyChanged();
1117 return (bool)GetValue(FocusableProperty);
1122 /// 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.
1123 /// Note : Default value is true.
1125 [EditorBrowsable(EditorBrowsableState.Never)]
1126 public bool FocusableChildren
1130 SetValue(FocusableChildrenProperty, value);
1131 NotifyPropertyChanged();
1135 return (bool)GetValue(FocusableChildrenProperty);
1140 /// Whether this view can focus by touch.
1141 /// If Focusable is false, FocusableInTouch is disabled.
1142 /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
1144 [EditorBrowsable(EditorBrowsableState.Never)]
1145 public bool FocusableInTouch
1149 SetValue(FocusableInTouchProperty, value);
1150 NotifyPropertyChanged();
1154 return (bool)GetValue(FocusableInTouchProperty);
1159 /// Retrieves the position of the view.<br />
1160 /// The coordinates are relative to the view's parent.<br />
1162 /// <since_tizen> 3 </since_tizen>
1163 public Position CurrentPosition
1167 return GetCurrentPosition();
1172 /// Sets the size of a view for the width and the height.<br />
1173 /// Geometry can be scaled to fit within this area.<br />
1174 /// This does not interfere with the view's scale factor.<br />
1175 /// The views default depth is the minimum of width and height.<br />
1178 /// The property cascade chaining set is not recommended.
1181 /// This way is recommended for setting the property
1183 /// var view = new View();
1184 /// view.Size2D = new Size2D(100, 200);
1186 /// This way to set the property is prohibited
1188 /// view.Size2D.Width = 100; //This does not guarantee a proper operation
1191 /// <since_tizen> 3 </since_tizen>
1192 public Size2D Size2D
1196 var temp = (Size2D)GetValue(Size2DProperty);
1198 if (this.Layout == null)
1200 if (temp.Width < 0) { temp.Width = 0; }
1201 if (temp.Height < 0) { temp.Height = 0; }
1208 SetValue(Size2DProperty, value);
1210 NotifyPropertyChanged();
1215 /// Retrieves the size of the view.<br />
1216 /// The coordinates are relative to the view's parent.<br />
1218 /// <since_tizen> 3 </since_tizen>
1219 public Size2D CurrentSize
1223 return GetCurrentSize();
1228 /// Retrieves and sets the view's opacity.<br />
1232 /// Animatable - This property can be animated using <c>Animation</c> class.
1234 /// animation.AnimateTo(view, "Opacity", 0.5f);
1238 /// <since_tizen> 3 </since_tizen>
1239 public float Opacity
1243 return (float)GetValue(OpacityProperty);
1247 SetValue(OpacityProperty, value);
1248 NotifyPropertyChanged();
1253 /// Sets the position of the view for X and Y.<br />
1254 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1255 /// If the position inheritance is disabled, sets the world position.<br />
1258 /// The property cascade chaining set is not recommended.
1261 /// This way is recommended for setting the property
1263 /// var view = new View();
1264 /// view.Position2D = new Position2D(100, 200);
1266 /// This way to set the property is prohibited
1268 /// view.Position2D.X = 100; //This does not guarantee a proper operation
1271 /// <since_tizen> 3 </since_tizen>
1272 public Position2D Position2D
1276 return (Position2D)GetValue(Position2DProperty);
1280 SetValue(Position2DProperty, value);
1281 NotifyPropertyChanged();
1286 /// Retrieves the screen position of the view.<br />
1288 /// <since_tizen> 3 </since_tizen>
1289 public Vector2 ScreenPosition
1293 Vector2 temp = new Vector2(0.0f, 0.0f);
1294 var pValue = GetProperty(View.Property.ScreenPosition);
1302 /// Determines whether the pivot point should be used to determine the position of the view.
1303 /// This is false by default.
1305 /// <remarks>If false, then the top-left of the view is used for the position.
1306 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1308 /// <since_tizen> 3 </since_tizen>
1309 public bool PositionUsesPivotPoint
1313 return (bool)GetValue(PositionUsesPivotPointProperty);
1317 SetValue(PositionUsesPivotPointProperty, value);
1318 NotifyPropertyChanged();
1323 /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
1325 /// <since_tizen> 3 </since_tizen>
1326 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
1328 "View view = new View(); " +
1329 "view.PivotPoint = PivotPoint.Center; " +
1330 "view.PositionUsesPivotPoint = true;" +
1331 " This has been deprecated in API5 and will be removed in API8")]
1332 [EditorBrowsable(EditorBrowsableState.Never)]
1333 public bool PositionUsesAnchorPoint
1337 return (bool)GetValue(PositionUsesAnchorPointProperty);
1341 SetValue(PositionUsesAnchorPointProperty, value);
1345 private bool InternalPositionUsesAnchorPoint
1350 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1351 pValue.Get(out temp);
1357 var temp = new Tizen.NUI.PropertyValue(value);
1358 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1360 NotifyPropertyChanged();
1365 /// Queries whether the view is connected to the stage.<br />
1366 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1368 /// <since_tizen> 3 </since_tizen>
1369 public bool IsOnWindow
1378 /// Gets the depth in the hierarchy for the view.
1380 /// <since_tizen> 3 </since_tizen>
1381 public int HierarchyDepth
1385 return GetHierarchyDepth();
1390 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1393 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1394 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1395 /// The values set by this property will likely change.
1397 /// <since_tizen> 3 </since_tizen>
1398 public int SiblingOrder
1402 return (int)GetValue(SiblingOrderProperty);
1406 SetValue(SiblingOrderProperty, value);
1408 Layout?.ChangeLayoutSiblingOrder(value);
1410 NotifyPropertyChanged();
1415 /// Returns the natural size of the view.
1418 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1420 /// <since_tizen> 5 </since_tizen>
1421 public Vector3 NaturalSize
1425 Vector3 ret = GetNaturalSize();
1426 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1432 /// Returns the natural size (Size2D) of the view.
1435 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1437 /// <since_tizen> 4 </since_tizen>
1438 public Size2D NaturalSize2D
1442 Vector3 temp = GetNaturalSize();
1443 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1445 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1452 /// Gets or sets the origin of a view within its parent's area.<br />
1453 /// 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 />
1454 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1455 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1457 /// <pre>The view has been initialized.</pre>
1458 /// <since_tizen> 3 </since_tizen>
1459 public Position ParentOrigin
1463 Position tmp = (Position)GetValue(ParentOriginProperty);
1464 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1468 SetValue(ParentOriginProperty, value);
1469 NotifyPropertyChanged();
1474 /// Gets or sets the anchor-point of a view.<br />
1475 /// 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 />
1476 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1477 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1478 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1479 /// <pre>The view has been initialized.</pre>
1482 /// The property cascade chaining set is not recommended.
1485 /// This way is recommended for setting the property
1487 /// var view = new View();
1488 /// view.PivotPoint = PivotPoint.Center;
1490 /// This way to set the property is prohibited
1492 /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
1495 /// <since_tizen> 3 </since_tizen>
1496 public Position PivotPoint
1500 return (Position)GetValue(PivotPointProperty);
1504 SetValue(PivotPointProperty, value);
1505 NotifyPropertyChanged();
1510 /// Gets or sets the size width of the view.
1514 /// Animatable - This property can be animated using <c>Animation</c> class.
1516 /// animation.AnimateTo(view, "SizeWidth", 500.0f);
1520 /// <since_tizen> 3 </since_tizen>
1521 public float SizeWidth
1525 return (float)GetValue(SizeWidthProperty);
1529 SetValue(SizeWidthProperty, value);
1530 NotifyPropertyChanged();
1535 /// Gets or sets the size height of the view.
1539 /// Animatable - This property can be animated using <c>Animation</c> class.
1542 /// animation.AnimateTo(view, "SizeHeight", 500.0f);
1545 /// <since_tizen> 3 </since_tizen>
1546 public float SizeHeight
1550 return (float)GetValue(SizeHeightProperty);
1554 SetValue(SizeHeightProperty, value);
1555 NotifyPropertyChanged();
1560 /// Gets or sets the position of the view.<br />
1561 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1562 /// If the position inheritance is disabled, sets the world position.<br />
1566 /// Animatable - This property can be animated using <c>Animation</c> class.
1568 /// animation.AnimateTo(view, "Position", new Position(50, 0));
1571 /// The property cascade chaining set is not recommended.
1574 /// This way is recommended for setting the property
1576 /// var view = new View();
1577 /// view.Position = new Position(100, 200.5f, 0);
1579 /// This way to set the property is prohibited
1581 /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
1584 /// <since_tizen> 3 </since_tizen>
1585 public Position Position
1589 return (Position)GetValue(PositionProperty);
1593 SetValue(PositionProperty, value);
1594 NotifyPropertyChanged();
1599 /// Gets or sets the position X of the view.
1603 /// Animatable - This property can be animated using <c>Animation</c> class.
1605 /// animation.AnimateTo(view, "PositionX", 50.0f);
1609 /// <since_tizen> 3 </since_tizen>
1610 public float PositionX
1614 return (float)GetValue(PositionXProperty);
1618 SetValue(PositionXProperty, value);
1619 NotifyPropertyChanged();
1624 /// Gets or sets the position Y of the view.
1628 /// Animatable - This property can be animated using <c>Animation</c> class.
1630 /// animation.AnimateTo(view, "PositionY", 50.0f);
1634 /// <since_tizen> 3 </since_tizen>
1635 public float PositionY
1639 return (float)GetValue(PositionYProperty);
1643 SetValue(PositionYProperty, value);
1644 NotifyPropertyChanged();
1649 /// Gets or sets the position Z of the view.
1653 /// Animatable - This property can be animated using <c>Animation</c> class.
1655 /// animation.AnimateTo(view, "PositionZ", 50.0f);
1659 /// <since_tizen> 3 </since_tizen>
1660 public float PositionZ
1664 return (float)GetValue(PositionZProperty);
1668 SetValue(PositionZProperty, value);
1669 NotifyPropertyChanged();
1674 /// Gets or sets the world position of the view.
1676 /// <since_tizen> 3 </since_tizen>
1677 public Vector3 WorldPosition
1681 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1682 var pValue = GetProperty(View.Property.WorldPosition);
1690 /// Gets or sets the orientation of the view.<br />
1691 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1695 /// This is an asynchronous method.
1698 /// Animatable - This property can be animated using <c>Animation</c> class.
1700 /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
1704 /// <since_tizen> 3 </since_tizen>
1705 public Rotation Orientation
1709 return (Rotation)GetValue(OrientationProperty);
1713 SetValue(OrientationProperty, value);
1714 NotifyPropertyChanged();
1719 /// Gets or sets the world orientation of the view.<br />
1721 /// <since_tizen> 3 </since_tizen>
1722 public Rotation WorldOrientation
1726 Rotation temp = new Rotation();
1727 var pValue = GetProperty(View.Property.WorldOrientation);
1735 /// Gets or sets the scale factor applied to the view.<br />
1739 /// Animatable - This property can be animated using <c>Animation</c> class.
1741 /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
1744 /// The property cascade chaining set is not recommended.
1747 /// This way is recommended for setting the property
1749 /// var view = new View();
1750 /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
1752 /// This way to set the property is prohibited
1754 /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
1757 /// <since_tizen> 3 </since_tizen>
1758 public Vector3 Scale
1762 return (Vector3)GetValue(ScaleProperty);
1766 SetValue(ScaleProperty, value);
1767 NotifyPropertyChanged();
1772 /// Gets or sets the scale X factor applied to the view.
1776 /// Animatable - This property can be animated using <c>Animation</c> class.
1778 /// animation.AnimateTo(view, "ScaleX", 1.5f);
1782 /// <since_tizen> 3 </since_tizen>
1787 return (float)GetValue(ScaleXProperty);
1791 SetValue(ScaleXProperty, value);
1792 NotifyPropertyChanged();
1797 /// Gets or sets the scale Y factor applied to the view.
1801 /// Animatable - This property can be animated using <c>Animation</c> class.
1803 /// animation.AnimateTo(view, "ScaleY", 1.5f);
1807 /// <since_tizen> 3 </since_tizen>
1812 return (float)GetValue(ScaleYProperty);
1816 SetValue(ScaleYProperty, value);
1817 NotifyPropertyChanged();
1822 /// Gets or sets the scale Z factor applied to the view.
1826 /// Animatable - This property can be animated using <c>Animation</c> class.
1828 /// animation.AnimateTo(view, "ScaleZ", 1.5f);
1832 /// <since_tizen> 3 </since_tizen>
1837 return (float)GetValue(ScaleZProperty);
1841 SetValue(ScaleZProperty, value);
1842 NotifyPropertyChanged();
1847 /// Gets the world scale of the view.
1849 /// <since_tizen> 3 </since_tizen>
1850 public Vector3 WorldScale
1854 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1855 var pValue = GetProperty(View.Property.WorldScale);
1863 /// Retrieves the visibility flag of the view.
1867 /// If the view is not visible, then the view and its children will not be rendered.
1868 /// 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.
1871 /// Animatable - This property can be animated using <c>Animation</c> class.
1873 /// animation.AnimateTo(view, "Visibility", false);
1877 /// <since_tizen> 3 </since_tizen>
1878 public bool Visibility
1883 var pValue = GetProperty(View.Property.VISIBLE);
1884 pValue.Get(out temp);
1891 /// Gets the view's world color.
1893 /// <since_tizen> 3 </since_tizen>
1894 public Vector4 WorldColor
1898 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1899 var pValue = GetProperty(View.Property.WorldColor);
1907 /// Gets or sets the view's name.
1909 /// <since_tizen> 3 </since_tizen>
1914 return (string)GetValue(NameProperty);
1918 SetValue(NameProperty, value);
1919 NotifyPropertyChanged();
1924 /// Get the number of children held by the view.
1926 /// <since_tizen> 3 </since_tizen>
1927 public new uint ChildCount
1931 return Convert.ToUInt32(Children.Count);
1936 /// Gets the view's ID.
1939 /// <since_tizen> 3 </since_tizen>
1949 /// Gets or sets the status of whether the view should emit touch or hover signals.
1950 /// If a View is made insensitive, then the View and its children are not hittable.
1952 /// <since_tizen> 3 </since_tizen>
1953 public bool Sensitive
1957 return (bool)GetValue(SensitiveProperty);
1961 SetValue(SensitiveProperty, value);
1962 NotifyPropertyChanged();
1967 /// Gets or sets the status of whether the view should be enabled user interactions.
1968 /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
1970 /// <since_tizen> tizen_next </since_tizen>
1971 [EditorBrowsable(EditorBrowsableState.Never)]
1972 public bool IsEnabled
1976 return (bool)GetValue(IsEnabledProperty);
1980 SetValue(IsEnabledProperty, value);
1981 NotifyPropertyChanged();
1986 /// 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.
1988 /// <since_tizen> 3 </since_tizen>
1989 public bool LeaveRequired
1993 return (bool)GetValue(LeaveRequiredProperty);
1997 SetValue(LeaveRequiredProperty, value);
1998 NotifyPropertyChanged();
2003 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
2005 /// <since_tizen> 3 </since_tizen>
2006 public bool InheritOrientation
2010 return (bool)GetValue(InheritOrientationProperty);
2014 SetValue(InheritOrientationProperty, value);
2015 NotifyPropertyChanged();
2020 /// Gets or sets the status of whether a child view inherits it's parent's scale.
2022 /// <since_tizen> 3 </since_tizen>
2023 public bool InheritScale
2027 return (bool)GetValue(InheritScaleProperty);
2031 SetValue(InheritScaleProperty, value);
2032 NotifyPropertyChanged();
2037 /// Gets or sets the status of how the view and its children should be drawn.<br />
2038 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
2039 /// 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 />
2040 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
2041 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
2042 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
2044 /// <since_tizen> 3 </since_tizen>
2045 public DrawModeType DrawMode
2049 return (DrawModeType)GetValue(DrawModeProperty);
2053 SetValue(DrawModeProperty, value);
2054 NotifyPropertyChanged();
2059 /// Gets or sets the relative to parent size factor of the view.<br />
2060 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
2061 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
2064 /// The property cascade chaining set is not recommended.
2067 /// This way is recommended for setting the property
2069 /// var text = new TextField();
2070 /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
2072 /// This way to set the property is prohibited
2074 /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
2077 /// <since_tizen> 3 </since_tizen>
2078 public Vector3 SizeModeFactor
2082 return (Vector3)GetValue(SizeModeFactorProperty);
2086 SetValue(SizeModeFactorProperty, value);
2087 NotifyPropertyChanged();
2092 /// Gets or sets the width resize policy to be used.
2094 /// <since_tizen> 3 </since_tizen>
2095 public ResizePolicyType WidthResizePolicy
2099 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
2103 SetValue(WidthResizePolicyProperty, value);
2104 NotifyPropertyChanged();
2109 /// Gets or sets the height resize policy to be used.
2111 /// <since_tizen> 3 </since_tizen>
2112 public ResizePolicyType HeightResizePolicy
2116 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
2120 SetValue(HeightResizePolicyProperty, value);
2121 NotifyPropertyChanged();
2126 /// Gets or sets the policy to use when setting size with size negotiation.<br />
2127 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
2129 /// <since_tizen> 3 </since_tizen>
2130 public SizeScalePolicyType SizeScalePolicy
2134 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
2138 SetValue(SizeScalePolicyProperty, value);
2139 NotifyPropertyChanged();
2144 /// Gets or sets the status of whether the width size is dependent on the height size.
2146 /// <since_tizen> 3 </since_tizen>
2147 public bool WidthForHeight
2151 return (bool)GetValue(WidthForHeightProperty);
2155 SetValue(WidthForHeightProperty, value);
2156 NotifyPropertyChanged();
2161 /// Gets or sets the status of whether the height size is dependent on the width size.
2163 /// <since_tizen> 3 </since_tizen>
2164 public bool HeightForWidth
2168 return (bool)GetValue(HeightForWidthProperty);
2172 SetValue(HeightForWidthProperty, value);
2173 NotifyPropertyChanged();
2178 /// Gets or sets the padding for use in layout.
2181 /// The property cascade chaining set is not recommended.
2184 /// This way is recommended for setting the property
2186 /// var view = new View();
2187 /// view.Padding = new Extents(5, 5, 5, 5);
2189 /// This way to set the property is prohibited
2191 /// view.Padding.Start = 5; //This does not guarantee a proper operation
2194 /// <since_tizen> 5 </since_tizen>
2195 public Extents Padding
2199 return (Extents)GetValue(PaddingProperty);
2203 SetValue(PaddingProperty, value);
2204 NotifyPropertyChanged();
2209 /// Gets or sets the minimum size the view can be assigned in size negotiation.
2211 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2213 /// The property cascade chaining set is not recommended.
2216 /// This way is recommended for setting the property
2218 /// var view = new View();
2219 /// view.MinimumSize = new Size2D(100, 200);
2221 /// This way to set the property is prohibited
2223 /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
2226 /// <since_tizen> 3 </since_tizen>
2227 public Size2D MinimumSize
2231 return (Size2D)GetValue(MinimumSizeProperty);
2237 throw new ArgumentNullException(nameof(value));
2241 // Note: it only works if minimum size is >= than natural size.
2242 // To force the size it should be done through the width&height spec or Size2D.
2243 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
2244 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
2245 layout.RequestLayout();
2247 SetValue(MinimumSizeProperty, value);
2248 NotifyPropertyChanged();
2253 /// Gets or sets the maximum size the view can be assigned in size negotiation.
2256 /// This way is recommended for setting the property
2258 /// var view = new View();
2259 /// view.MaximumSize = new Size2D(100, 200);
2261 /// This way to set the property is prohibited
2263 /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
2266 /// <since_tizen> 3 </since_tizen>
2267 public Size2D MaximumSize
2271 return (Size2D)GetValue(MaximumSizeProperty);
2275 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2276 // MATCH_PARENT spec + parent container size can be used to limit
2279 layout.RequestLayout();
2281 SetValue(MaximumSizeProperty, value);
2282 NotifyPropertyChanged();
2287 /// Gets or sets whether a child view inherits it's parent's position.<br />
2288 /// Default is to inherit.<br />
2289 /// 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 />
2291 /// <since_tizen> 3 </since_tizen>
2292 public bool InheritPosition
2296 return (bool)GetValue(InheritPositionProperty);
2300 SetValue(InheritPositionProperty, value);
2301 NotifyPropertyChanged();
2306 /// Gets or sets the clipping behavior (mode) of it's children.
2308 /// <since_tizen> 3 </since_tizen>
2309 public ClippingModeType ClippingMode
2313 return (ClippingModeType)GetValue(ClippingModeProperty);
2317 SetValue(ClippingModeProperty, value);
2318 NotifyPropertyChanged();
2323 /// Gets the number of renderers held by the view.
2325 /// <since_tizen> 3 </since_tizen>
2326 public uint RendererCount
2330 return GetRendererCount();
2335 /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
2338 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2340 /// <since_tizen> 3 </since_tizen>
2341 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
2343 "View view = new View(); " +
2344 "view.PivotPoint = PivotPoint.Center; " +
2345 "view.PositionUsesPivotPoint = true;")]
2346 [EditorBrowsable(EditorBrowsableState.Never)]
2347 public Position AnchorPoint
2351 return GetValue(AnchorPointProperty) as Position;
2355 SetValue(AnchorPointProperty, value);
2359 private Position InternalAnchorPoint
2363 Position temp = new Position(0.0f, 0.0f, 0.0f);
2364 var pValue = GetProperty(View.Property.AnchorPoint);
2367 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2373 var temp = new Tizen.NUI.PropertyValue(value);
2374 SetProperty(View.Property.AnchorPoint, temp);
2376 NotifyPropertyChanged();
2381 /// Sets the size of a view for the width, the height and the depth.<br />
2382 /// Geometry can be scaled to fit within this area.<br />
2383 /// This does not interfere with the view's scale factor.<br />
2384 /// The views default depth is the minimum of width and height.<br />
2388 /// Animatable - This property can be animated using <c>Animation</c> class.
2390 /// animation.AnimateTo(view, "Size", new Size(100, 100));
2393 /// The property cascade chaining set is not recommended.
2396 /// This way is recommended for setting the property
2398 /// var view = new View();
2399 /// view.Size = new Size(100.5f, 200, 0);
2401 /// This way to set the property is prohibited
2403 /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
2406 /// <since_tizen> 5 </since_tizen>
2411 return (Size)GetValue(SizeProperty);
2415 SetValue(SizeProperty, value);
2416 NotifyPropertyChanged();
2421 /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
2423 /// <since_tizen> 3 </since_tizen>
2424 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
2426 "Container parent = view.GetParent(); " +
2427 "View view = parent as View;")]
2428 [EditorBrowsable(EditorBrowsableState.Never)]
2429 public new View Parent
2434 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2435 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2436 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2438 if (basehandle is Layer layer)
2440 ret = new View(Layer.getCPtr(layer).Handle, false);
2441 NUILog.Error("This Parent property is deprecated, should do not be used");
2445 ret = basehandle as View;
2448 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2449 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2451 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2457 /// Gets/Sets whether inherit parent's the layout Direction.
2459 /// <since_tizen> 4 </since_tizen>
2460 public bool InheritLayoutDirection
2464 return (bool)GetValue(InheritLayoutDirectionProperty);
2468 SetValue(InheritLayoutDirectionProperty, value);
2469 NotifyPropertyChanged();
2474 /// Gets/Sets the layout Direction.
2476 /// <since_tizen> 4 </since_tizen>
2477 public ViewLayoutDirectionType LayoutDirection
2481 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2485 SetValue(LayoutDirectionProperty, value);
2486 NotifyPropertyChanged();
2487 layout?.RequestLayout();
2492 /// Gets or sets the Margin for use in layout.
2495 /// Margin property is supported by Layout algorithms and containers.
2496 /// Please Set Layout if you want to use Margin property.
2497 /// The property cascade chaining set is not recommended.
2500 /// This way is recommended for setting the property
2502 /// var view = new View();
2503 /// view.Margin = new Extents(10, 5, 15, 20);
2505 /// This way to set the property is prohibited
2507 /// view.Margin.Top = 15; //This does not guarantee a proper operation
2510 /// <since_tizen> 4 </since_tizen>
2511 public Extents Margin
2515 return (Extents)GetValue(MarginProperty);
2519 SetValue(MarginProperty, value);
2520 NotifyPropertyChanged();
2525 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2529 /// // matchParentView matches its size to its parent size.
2530 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2531 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2533 /// // wrapContentView wraps its children with their desired size.
2534 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2535 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2537 /// // exactSizeView shows itself with an exact size.
2538 /// exactSizeView.WidthSpecification = 100;
2539 /// exactSizeView.HeightSpecification = 100;
2542 /// <since_tizen> 6 </since_tizen>
2543 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2544 public int WidthSpecification
2548 return (int)GetValue(WidthSpecificationProperty);
2552 SetValue(WidthSpecificationProperty, value);
2553 NotifyPropertyChanged();
2557 private int InternalWidthSpecification
2565 if (value == widthPolicy)
2568 widthPolicy = value;
2569 if (widthPolicy >= 0)
2571 if (heightPolicy >= 0) // Policy an exact value
2573 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2574 Size2D = new Size2D(widthPolicy, heightPolicy);
2577 layout?.RequestLayout();
2582 /// The required policy for this dimension, <see cref="LayoutParamPolicies"/> values or exact value.
2586 /// // matchParentView matches its size to its parent size.
2587 /// matchParentView.WidthSpecification = LayoutParamPolicies.MatchParent;
2588 /// matchParentView.HeightSpecification = LayoutParamPolicies.MatchParent;
2590 /// // wrapContentView wraps its children with their desired size.
2591 /// wrapContentView.WidthSpecification = LayoutParamPolicies.WrapContent;
2592 /// wrapContentView.HeightSpecification = LayoutParamPolicies.WrapContent;
2594 /// // exactSizeView shows itself with an exact size.
2595 /// exactSizeView.WidthSpecification = 100;
2596 /// exactSizeView.HeightSpecification = 100;
2599 /// <since_tizen> 6 </since_tizen>
2600 [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
2601 public int HeightSpecification
2605 return (int)GetValue(HeightSpecificationProperty);
2609 SetValue(HeightSpecificationProperty, value);
2610 NotifyPropertyChanged();
2614 private int InternalHeightSpecification
2618 return heightPolicy;
2622 if (value == heightPolicy)
2625 heightPolicy = value;
2626 if (heightPolicy >= 0)
2628 if (widthPolicy >= 0) // Policy an exact value
2630 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2631 Size2D = new Size2D(widthPolicy, heightPolicy);
2634 layout?.RequestLayout();
2639 /// Gets the List of transitions for this View.
2641 /// <since_tizen> 6 </since_tizen>
2642 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2646 if (layoutTransitions == null)
2648 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2650 return layoutTransitions;
2655 /// Sets a layout transitions for this View.
2657 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2659 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2661 /// <since_tizen> 6 </since_tizen>
2662 public LayoutTransition LayoutTransition
2666 return GetValue(LayoutTransitionProperty) as LayoutTransition;
2670 SetValue(LayoutTransitionProperty, value);
2671 NotifyPropertyChanged();
2675 private LayoutTransition InternalLayoutTransition
2679 return layoutTransition;
2685 throw new global::System.ArgumentNullException(nameof(value));
2687 if (layoutTransitions == null)
2689 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2692 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2694 AttachTransitionsToChildren(value);
2696 layoutTransition = value;
2701 /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
2704 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2706 /// <since_tizen> 4 </since_tizen>
2707 [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
2708 [EditorBrowsable(EditorBrowsableState.Never)]
2709 public Extents PaddingEX
2713 return GetValue(PaddingEXProperty) as Extents;
2717 SetValue(PaddingEXProperty, value);
2721 private Extents InternalPaddingEX
2725 Extents temp = new Extents(0, 0, 0, 0);
2726 var pValue = GetProperty(View.Property.PADDING);
2729 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2735 var temp = new Tizen.NUI.PropertyValue(value);
2736 SetProperty(View.Property.PADDING, temp);
2738 NotifyPropertyChanged();
2739 layout?.RequestLayout();
2744 /// The Color of View. This is an RGBA value.
2748 /// Animatable - This property can be animated using <c>Animation</c> class.
2750 /// The property cascade chaining set is not recommended.
2753 /// This way is recommended for setting the property
2755 /// var view = new View();
2756 /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
2758 /// This way to set the property is prohibited
2760 /// view.Color.A = 0.5f; //This does not guarantee a proper operation
2763 [EditorBrowsable(EditorBrowsableState.Never)]
2768 return (Color)GetValue(ColorProperty);
2772 SetValue(ColorProperty, value);
2773 NotifyPropertyChanged();
2778 /// Set the layout on this View. Replaces any existing Layout.
2781 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2783 /// <since_tizen> 6 </since_tizen>
2784 public LayoutItem Layout
2788 return GetValue(LayoutProperty) as LayoutItem;
2792 SetValue(LayoutProperty, value);
2796 private LayoutItem InternalLayout
2804 // Do nothing if layout provided is already set on this View.
2805 if (value == layout)
2810 LayoutingDisabled = false;
2813 // If new layout being set already has a owner then that owner receives a replacement default layout.
2814 // First check if the layout to be set already has a owner.
2815 if (value?.Owner != null)
2817 // Previous owner of the layout gets a default layout as a replacement.
2818 value.Owner.Layout = new AbsoluteLayout()
2820 // Copy Margin and Padding to replacement LayoutGroup.
2821 Margin = value.Margin,
2822 Padding = value.Padding,
2826 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2827 // View if no replacement. Previously margin and padding values would have been moved from
2828 // the View to the layout.
2829 if (layout != null) // Existing layout
2833 // Existing layout being replaced so copy over margin and padding values.
2834 value.Margin = layout.Margin;
2835 value.Padding = layout.Padding;
2836 value.SetPositionByLayout = !excludeLayouting;
2840 // Layout not being replaced so restore margin and padding to View.
2841 SetValue(MarginProperty, layout.Margin);
2842 SetValue(PaddingProperty, layout.Padding);
2843 NotifyPropertyChanged();
2848 // First Layout to be added to the View hence copy
2850 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2853 Extents margin = Margin;
2854 Extents padding = Padding;
2855 bool setMargin = false;
2856 bool setPadding = false;
2858 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2860 // If View already has a margin set then store it in Layout instead.
2861 value.Margin = margin;
2862 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2866 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
2868 // If View already has a padding set then store it in Layout instead.
2869 value.Padding = padding;
2870 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
2874 if (setMargin || setPadding)
2876 NotifyPropertyChanged();
2879 value.SetPositionByLayout = !excludeLayouting;
2883 // Remove existing layout from it's parent layout group.
2886 // Set layout to this view
2892 /// The weight of the View, used to share available space in a layout with siblings.
2894 /// <since_tizen> 6 </since_tizen>
2904 layout?.RequestLayout();
2909 /// Whether to load the BackgroundImage synchronously.
2910 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2911 /// Note: For Normal Quad images only.
2913 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2914 [EditorBrowsable(EditorBrowsableState.Never)]
2915 public bool BackgroundImageSynchronosLoading
2919 return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
2923 SetValue(BackgroundImageSynchronosLoadingProperty, value);
2924 NotifyPropertyChanged();
2928 private bool InternalBackgroundImageSynchronosLoading
2932 return BackgroundImageSynchronousLoading;
2936 BackgroundImageSynchronousLoading = value;
2941 /// Whether to load the BackgroundImage synchronously.
2942 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2943 /// Note: For Normal Quad images only.
2945 /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2946 [EditorBrowsable(EditorBrowsableState.Never)]
2947 public bool BackgroundImageSynchronousLoading
2951 return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
2955 SetValue(BackgroundImageSynchronousLoadingProperty, value);
2956 NotifyPropertyChanged();
2960 private bool InternalBackgroundImageSynchronousLoading
2964 return backgroundImageSynchronousLoading;
2968 backgroundImageSynchronousLoading = value;
2970 string bgUrl = null;
2971 var pValue = Background.Find(ImageVisualProperty.URL);
2972 pValue?.Get(out bgUrl);
2975 if (!string.IsNullOrEmpty(bgUrl))
2977 PropertyMap bgMap = this.Background;
2978 var temp = new PropertyValue(backgroundImageSynchronousLoading);
2979 bgMap[ImageVisualProperty.SynchronousLoading] = temp;
2986 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2987 [EditorBrowsable(EditorBrowsableState.Never)]
2988 public Vector2 UpdateSizeHint
2992 return (Vector2)GetValue(UpdateSizeHintProperty);
2996 SetValue(UpdateSizeHintProperty, value);
2997 NotifyPropertyChanged();
3002 /// Enable/Disable ControlState propagation for children.
3003 /// It is false by default.
3004 /// If the View needs to share ControlState with descendants, please set it true.
3005 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
3007 [EditorBrowsable(EditorBrowsableState.Never)]
3008 public bool EnableControlStatePropagation
3012 return (bool)GetValue(EnableControlStatePropagationProperty);
3016 SetValue(EnableControlStatePropagationProperty, value);
3017 NotifyPropertyChanged();
3021 private bool InternalEnableControlStatePropagation
3023 get => themeData?.ControlStatePropagation ?? false;
3026 if (InternalEnableControlStatePropagation == value) return;
3028 if (themeData == null) themeData = new ThemeData();
3030 themeData.ControlStatePropagation = value;
3032 foreach (View child in Children)
3034 child.EnableControlStatePropagation = value;
3040 /// The ControlStates can propagate from the parent.
3041 /// Listed ControlStates will be accepted propagation of the parent ControlState changes
3042 /// if parent view EnableControlState is true.
3043 /// <see cref="EnableControlState"/>.
3044 /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
3046 [EditorBrowsable(EditorBrowsableState.Never)]
3047 public ControlState PropagatableControlStates
3051 return (ControlState)GetValue(PropagatableControlStatesProperty);
3055 SetValue(PropagatableControlStatesProperty, value);
3056 NotifyPropertyChanged();
3060 private ControlState InternalPropagatableControlStates
3062 get => propagatableControlStates;
3063 set => propagatableControlStates = value;
3067 /// By default, it is false in View, true in Control.
3068 /// Note that if the value is true, the View will be a touch receptor.
3070 [EditorBrowsable(EditorBrowsableState.Never)]
3071 public bool EnableControlState
3075 return (bool)GetValue(EnableControlStateProperty);
3079 SetValue(EnableControlStateProperty, value);
3084 /// Whether the actor grab all touches even if touch leaves its boundary.
3086 /// <returns>true, if it grab all touch after start</returns>
3087 [EditorBrowsable(EditorBrowsableState.Never)]
3088 public bool GrabTouchAfterLeave
3092 return (bool)GetValue(GrabTouchAfterLeaveProperty);
3096 SetValue(GrabTouchAfterLeaveProperty, value);
3100 private bool InternalGrabTouchAfterLeave
3105 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
3106 pValue.Get(out temp);
3112 var temp = new Tizen.NUI.PropertyValue(value);
3113 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
3115 NotifyPropertyChanged();
3120 /// Whether the view will only receive own touch.
3122 /// <returns>true, if it only receives touches that started from itself.</returns>
3123 [EditorBrowsable(EditorBrowsableState.Never)]
3124 public bool AllowOnlyOwnTouch
3128 return (bool)GetValue(AllowOnlyOwnTouchProperty);
3132 SetValue(AllowOnlyOwnTouchProperty, value);
3136 private bool InternalAllowOnlyOwnTouch
3141 var pValue = GetProperty(View.Property.AllowOnlyOwnTouch);
3142 pValue.Get(out temp);
3148 var temp = new Tizen.NUI.PropertyValue(value);
3149 SetProperty(View.Property.AllowOnlyOwnTouch, temp);
3151 NotifyPropertyChanged();
3156 /// Determines which blend equation will be used to render renderers of this actor.
3158 /// <returns>blend equation enum currently assigned</returns>
3159 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
3160 [EditorBrowsable(EditorBrowsableState.Never)]
3161 public BlendEquationType BlendEquation
3165 return (BlendEquationType)GetValue(BlendEquationProperty);
3169 SetValue(BlendEquationProperty, value);
3173 private BlendEquationType InternalBlendEquation
3178 var pValue = GetProperty(View.Property.BlendEquation);
3179 pValue.Get(out temp);
3181 return (BlendEquationType)temp;
3185 var temp = new Tizen.NUI.PropertyValue((int)value);
3186 SetProperty(View.Property.BlendEquation, temp);
3188 NotifyPropertyChanged();
3193 /// If the value is true, the View will change its style as the theme changes.
3194 /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
3196 /// <since_tizen> 9 </since_tizen>
3197 public bool ThemeChangeSensitive
3199 get => (bool)GetValue(ThemeChangeSensitiveProperty);
3200 set => SetValue(ThemeChangeSensitiveProperty, value);
3204 /// Create Style, it is abstract function and must be override.
3206 [EditorBrowsable(EditorBrowsableState.Never)]
3207 protected virtual ViewStyle CreateViewStyle()
3209 return new ViewStyle();
3213 /// Called after the View's ControlStates changed.
3215 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
3216 [EditorBrowsable(EditorBrowsableState.Never)]
3217 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
3223 [EditorBrowsable(EditorBrowsableState.Never)]
3224 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
3226 isThemeChanged = true;
3227 if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
3228 else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
3229 isThemeChanged = false;
3233 /// Apply style instance to the view.
3234 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
3236 /// <since_tizen> 9 </since_tizen>
3237 public virtual void ApplyStyle(ViewStyle viewStyle)
3239 if (viewStyle == null || themeData?.viewStyle == viewStyle) return;
3241 if (themeData == null) themeData = new ThemeData();
3243 themeData.viewStyle = viewStyle;
3245 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
3251 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
3253 if (bindablePropertyOfView == null)
3258 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
3259 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
3261 foreach (var sourceProperty in dirtyStyleProperties)
3263 var sourceValue = viewStyle.GetValue(sourceProperty);
3265 if (sourceValue == null)
3270 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
3272 // Do not set value again when theme is changed and the value has been set already.
3273 if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
3278 if (destinationProperty != null)
3280 InternalSetValue(destinationProperty, sourceValue);
3286 /// Get whether the View is culled or not.
3287 /// True means that the View is out of the view frustum.
3290 /// Hidden-API (Inhouse-API).
3292 [EditorBrowsable(EditorBrowsableState.Never)]
3298 var pValue = GetProperty(View.Property.Culled);
3299 pValue.Get(out temp);
3306 /// Set or Get TransitionOptions for the page transition.
3307 /// This property is used to define how this view will be transitioned during Page switching.
3309 /// <since_tizen> 9 </since_tizen>
3310 public TransitionOptions TransitionOptions
3314 return GetValue(TransitionOptionsProperty) as TransitionOptions;
3318 SetValue(TransitionOptionsProperty, value);
3319 NotifyPropertyChanged();
3323 private TransitionOptions InternalTransitionOptions
3327 transitionOptions = value;
3331 return transitionOptions;
3336 /// Gets or sets the status of whether the view should emit key event signals.
3337 /// If a View's DispatchKeyEvents is set to false, then it's children will not emit a key event signal either.
3339 [EditorBrowsable(EditorBrowsableState.Never)]
3340 public bool DispatchKeyEvents
3344 return (bool)GetValue(DispatchKeyEventsProperty);
3348 SetValue(DispatchKeyEventsProperty, value);
3349 NotifyPropertyChanged();
3354 /// Called when the view is hit through TouchEvent or GestureEvent.
3355 /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
3356 /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
3357 /// User can override whether hit or not in HitTest.
3358 /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
3359 /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
3361 // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
3362 [EditorBrowsable(EditorBrowsableState.Never)]
3363 protected virtual bool HitTest(Touch touch)