2 * Copyright(c) 2021 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;
22 using Tizen.NUI.Components;
24 namespace Tizen.NUI.BaseComponents
27 /// View is the base class for all views.
29 /// <since_tizen> 3 </since_tizen>
30 public partial class View : Container, IResourcesProvider
32 internal BackgroundExtraData backgroundExtraData;
34 private bool layoutSet = false;
35 private LayoutItem layout; // Exclusive layout assigned to this View.
37 // List of transitions paired with the condition that uses the transition.
38 private Dictionary<TransitionCondition, TransitionList> layoutTransitions;
39 private int widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
40 private int heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
41 private float weight = 0.0f; // Weighting of child View in a Layout
42 private bool backgroundImageSynchronosLoading = false;
43 private bool controlStatePropagation = false;
44 private ViewStyle viewStyle;
45 private bool themeChangeSensitive = false;
46 private bool excludeLayouting = false;
47 private LayoutTransition layoutTransition;
48 private ControlState controlStates = ControlState.Normal;
49 private TransitionOptions transitionOptions = null;
54 /// Creates a new instance of a view.
56 /// <since_tizen> 3 </since_tizen>
57 public View() : this(Interop.View.New(), true)
59 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
62 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
63 [EditorBrowsable(EditorBrowsableState.Never)]
64 public View(ViewStyle viewStyle) : this(Interop.View.New(), true, viewStyle)
69 /// Create a new instance of a View with setting the status of shown or hidden.
71 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
72 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
73 [EditorBrowsable(EditorBrowsableState.Never)]
74 public View(bool shown) : this(Interop.View.New(), true)
76 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
80 internal View(View uiControl, bool shown = true) : this(Interop.View.NewView(View.getCPtr(uiControl)), true)
82 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
88 backgroundExtraData = uiControl.backgroundExtraData == null ? null : new BackgroundExtraData(uiControl.backgroundExtraData);
91 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
93 InitializeStyle(viewStyle);
96 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(cPtr, cMemoryOwn)
100 PositionUsesPivotPoint = false;
103 onWindowSendEventCallback = SendViewAddedEventToWindow;
104 this.OnWindowSignal().Connect(onWindowSendEventCallback);
112 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
114 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
123 /// The event that is triggered when the View's ControlState is changed.
125 [EditorBrowsable(EditorBrowsableState.Never)]
126 public event EventHandler<ControlStateChangedEventArgs> ControlStateChangedEvent;
128 internal event EventHandler<ControlStateChangedEventArgs> ControlStateChangeEventInternal;
132 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
134 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
135 [EditorBrowsable(EditorBrowsableState.Never)]
136 public bool LayoutSet
145 /// Flag to allow Layouting to be disabled for Views.
146 /// Once a View has a Layout set then any children added to Views from then on will receive
147 /// automatic Layouts.
149 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
150 [EditorBrowsable(EditorBrowsableState.Never)]
151 public static bool LayoutingDisabled { get; set; } = true;
154 /// The style instance applied to this view.
155 /// Note that please do not modify the ViewStyle.
156 /// Modifying ViewStyle will affect other views with same ViewStyle.
158 [EditorBrowsable(EditorBrowsableState.Never)]
159 protected ViewStyle ViewStyle
163 if (null == viewStyle)
165 ApplyStyle(CreateViewStyle());
173 /// Get/Set the control state.
174 /// Note that the ControlState only available for the classes derived from Control.
175 /// If the classes that are not derived from Control (such as View, ImageView and TextLabel) want to use this system,
176 /// please set <see cref="EnableControlState"/> to true.
178 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
179 [EditorBrowsable(EditorBrowsableState.Never)]
180 public ControlState ControlState
184 return controlStates;
188 if (controlStates == value)
193 var prevState = controlStates;
195 controlStates = value;
197 var changeInfo = new ControlStateChangedEventArgs(prevState, value);
199 ControlStateChangeEventInternal?.Invoke(this, changeInfo);
201 if (controlStatePropagation)
203 foreach (View child in Children)
205 child.ControlState = value;
209 OnControlStateChanged(changeInfo);
211 ControlStateChangedEvent?.Invoke(this, changeInfo);
216 /// Gets / Sets the status of whether the view is excluded from its parent's layouting or not.
218 /// This will be public opened later after ACR done. Before ACR, need to be hidden as inhouse API.
219 [EditorBrowsable(EditorBrowsableState.Never)]
220 public bool ExcludeLayouting
224 return excludeLayouting;
228 excludeLayouting = value;
229 if (Layout != null && Layout.SetPositionByLayout == value)
231 Layout.SetPositionByLayout = !value;
232 Layout.RequestLayout();
237 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
238 [EditorBrowsable(EditorBrowsableState.Never)]
239 public bool IsResourcesCreated
243 return Application.Current.IsResourcesCreated;
247 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
248 [EditorBrowsable(EditorBrowsableState.Never)]
249 public ResourceDictionary XamlResources
253 return Application.Current.XamlResources;
257 Application.Current.XamlResources = value;
262 /// The StyleName, type string.
263 /// The value indicates DALi style name defined in json theme file.
265 /// <since_tizen> 3 </since_tizen>
266 public string StyleName
270 return (string)GetValue(StyleNameProperty);
274 SetValue(StyleNameProperty, value);
275 NotifyPropertyChanged();
280 /// The KeyInputFocus, type bool.
282 [EditorBrowsable(EditorBrowsableState.Never)]
283 public bool KeyInputFocus
287 return (bool)GetValue(KeyInputFocusProperty);
291 SetValue(KeyInputFocusProperty, value);
292 NotifyPropertyChanged();
297 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
301 /// The property cascade chaining set is possible. For example, this (view.BackgroundColor.X = 0.1f;) is possible.
304 /// Animatable - This property can be animated using <c>Animation</c> class.
306 /// animation.AnimateTo(view, "BackgroundColor", new Color(r, g, b, a));
310 /// <since_tizen> 3 </since_tizen>
311 public Color BackgroundColor
315 Color temp = (Color)GetValue(BackgroundColorProperty);
316 return new Color(OnBackgroundColorChanged, temp.R, temp.G, temp.B, temp.A);
320 SetValue(BackgroundColorProperty, value);
321 if (selectorData != null)
323 selectorData.BackgroundImage?.Reset(this);
324 selectorData.BackgroundColor?.Reset(this);
326 NotifyPropertyChanged();
331 /// The mutually exclusive with "backgroundColor" and "background" type Map.
333 /// <since_tizen> 3 </since_tizen>
334 public string BackgroundImage
338 return (string)GetValue(BackgroundImageProperty);
342 SetValue(BackgroundImageProperty, value);
343 if (selectorData != null)
345 selectorData.BackgroundColor?.Reset(this);
346 selectorData.BackgroundImage?.Reset(this);
348 NotifyPropertyChanged();
353 /// Get or set the border of background image.
355 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
356 [EditorBrowsable(EditorBrowsableState.Never)]
357 public Rectangle BackgroundImageBorder
361 return (Rectangle)GetValue(BackgroundImageBorderProperty);
365 SetValue(BackgroundImageBorderProperty, value);
366 selectorData?.BackgroundImageBorder?.Reset(this);
367 NotifyPropertyChanged();
372 /// The background of view.
374 /// <since_tizen> 3 </since_tizen>
375 public Tizen.NUI.PropertyMap Background
379 return (PropertyMap)GetValue(BackgroundProperty);
383 SetValue(BackgroundProperty, value);
384 NotifyPropertyChanged();
389 /// Describes a shadow as an image for a View.
390 /// It is null by default.
393 /// Getter returns copied instance of current shadow.
396 /// The mutually exclusive with "BoxShadow".
400 /// Animatable - This property can be animated using <c>Animation</c> class.
401 /// To animate this property, specify a sub-property with separator ".", for example, "ImageShadow.Offset".
403 /// animation.AnimateTo(view, "ImageShadow.Offset", new Vector2(10, 10));
405 /// Animatable sub-property : Offset.
408 [EditorBrowsable(EditorBrowsableState.Never)]
409 public ImageShadow ImageShadow
413 return (ImageShadow)GetValue(ImageShadowProperty);
417 SetValue(ImageShadowProperty, value);
418 if (selectorData != null)
420 selectorData.BoxShadow?.Reset(this);
421 selectorData.ImageShadow?.Reset(this);
423 NotifyPropertyChanged();
428 /// Describes a box shaped shadow drawing for a View.
429 /// It is null by default.
432 /// Getter returns copied instance of current shadow.
435 /// The mutually exclusive with "ImageShadow".
439 /// Animatable - This property can be animated using <c>Animation</c> class.
440 /// To animate this property, specify a sub-property with separator ".", for example, "BoxShadow.BlurRadius".
442 /// animation.AnimateTo(view, "BoxShadow.BlurRadius", 10.0f);
444 /// Animatable sub-property : Offset, Color, BlurRadius.
447 [EditorBrowsable(EditorBrowsableState.Never)]
448 public Shadow BoxShadow
452 return (Shadow)GetValue(BoxShadowProperty);
456 SetValue(BoxShadowProperty, value);
457 if (selectorData != null)
459 selectorData.ImageShadow?.Reset(this);
460 selectorData.BoxShadow?.Reset(this);
462 NotifyPropertyChanged();
467 /// The radius for the rounded corners of the View.
468 /// This will rounds background and shadow edges.
469 /// 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).
470 /// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
474 /// Animatable - This property can be animated using <c>Animation</c> class.
477 [EditorBrowsable(EditorBrowsableState.Never)]
478 public Vector4 CornerRadius
482 return (Vector4)GetValue(CornerRadiusProperty);
486 SetValue(CornerRadiusProperty, value);
487 NotifyPropertyChanged();
495 [EditorBrowsable(EditorBrowsableState.Never)]
496 protected bool IsHighlighted
500 return Accessibility.AccessibilityManager.Instance.GetCurrentFocusView() == this;
504 [EditorBrowsable(EditorBrowsableState.Never)]
505 protected static readonly string AccessibilityActivateAction = "activate";
506 [EditorBrowsable(EditorBrowsableState.Never)]
507 protected static readonly string AccessibilityReadingSkippedAction = "ReadingSkipped";
508 [EditorBrowsable(EditorBrowsableState.Never)]
509 protected static readonly string AccessibilityReadingCancelledAction = "ReadingCancelled";
510 [EditorBrowsable(EditorBrowsableState.Never)]
511 protected static readonly string AccessibilityReadingStoppedAction = "ReadingStopped";
512 [EditorBrowsable(EditorBrowsableState.Never)]
513 protected static readonly string AccessibilityReadingPausedAction = "ReadingPaused";
514 [EditorBrowsable(EditorBrowsableState.Never)]
515 protected static readonly string AccessibilityReadingResumedAction = "ReadingResumed";
517 [EditorBrowsable(EditorBrowsableState.Never)]
518 private static readonly string[] AccessibilityActions = {
519 AccessibilityActivateAction,
520 AccessibilityReadingSkippedAction,
521 AccessibilityReadingCancelledAction,
522 AccessibilityReadingStoppedAction,
523 AccessibilityReadingPausedAction,
524 AccessibilityReadingResumedAction,
527 [EditorBrowsable(EditorBrowsableState.Never)]
528 protected virtual string AccessibilityGetName()
533 [EditorBrowsable(EditorBrowsableState.Never)]
534 protected virtual string AccessibilityGetDescription()
539 [EditorBrowsable(EditorBrowsableState.Never)]
540 protected virtual bool AccessibilityDoAction(string name)
545 [EditorBrowsable(EditorBrowsableState.Never)]
546 protected virtual AccessibilityStates AccessibilityCalculateStates()
548 var states = new AccessibilityStates();
549 states.Set(AccessibilityState.Highlightable, this.AccessibilityHighlightable);
550 states.Set(AccessibilityState.Focusable, this.Focusable);
551 states.Set(AccessibilityState.Focused, this.State == States.Focused);
552 states.Set(AccessibilityState.Highlighted, this.IsHighlighted);
553 states.Set(AccessibilityState.Enabled, this.State != States.Disabled);
554 states.Set(AccessibilityState.Sensitive, this.Sensitive);
555 states.Set(AccessibilityState.Animated, this.AccessibilityAnimated);
556 states.Set(AccessibilityState.Visible, true);
557 states.Set(AccessibilityState.Showing, this.Visibility);
558 states.Set(AccessibilityState.Defunct, !this.IsOnWindow);
562 [EditorBrowsable(EditorBrowsableState.Never)]
563 protected virtual int AccessibilityGetActionCount()
565 return AccessibilityActions.Length;
568 [EditorBrowsable(EditorBrowsableState.Never)]
569 protected virtual string AccessibilityGetActionName(int index)
571 if (index >= 0 && index < AccessibilityActions.Length)
572 return AccessibilityActions[index];
577 [EditorBrowsable(EditorBrowsableState.Never)]
578 protected virtual bool AccessibilityShouldReportZeroChildren()
583 [EditorBrowsable(EditorBrowsableState.Never)]
584 protected virtual double AccessibilityGetMinimum()
589 [EditorBrowsable(EditorBrowsableState.Never)]
590 protected virtual double AccessibilityGetCurrent()
595 [EditorBrowsable(EditorBrowsableState.Never)]
596 protected virtual double AccessibilityGetMaximum()
601 [EditorBrowsable(EditorBrowsableState.Never)]
602 protected virtual bool AccessibilitySetCurrent(double value)
607 [EditorBrowsable(EditorBrowsableState.Never)]
608 protected virtual double AccessibilityGetMinimumIncrement()
613 [EditorBrowsable(EditorBrowsableState.Never)]
614 protected virtual bool AccessibilityIsScrollable()
619 [EditorBrowsable(EditorBrowsableState.Never)]
620 protected virtual string AccessibilityGetText(int startOffset, int endOffset)
625 [EditorBrowsable(EditorBrowsableState.Never)]
626 protected virtual int AccessibilityGetCharacterCount()
631 [EditorBrowsable(EditorBrowsableState.Never)]
632 protected virtual int AccessibilityGetCaretOffset()
637 [EditorBrowsable(EditorBrowsableState.Never)]
638 protected virtual bool AccessibilitySetCaretOffset(int offset)
643 [EditorBrowsable(EditorBrowsableState.Never)]
644 protected virtual AccessibilityRange AccessibilityGetTextAtOffset(int offset, TextBoundary boundary)
646 return new AccessibilityRange();
649 [EditorBrowsable(EditorBrowsableState.Never)]
650 protected virtual AccessibilityRange AccessibilityGetSelection(int selectionNum)
652 return new AccessibilityRange();
655 [EditorBrowsable(EditorBrowsableState.Never)]
656 protected virtual bool AccessibilityRemoveSelection(int selectionNum)
661 [EditorBrowsable(EditorBrowsableState.Never)]
662 protected virtual bool AccessibilitySetSelection(int selectionNum, int startOffset, int endOffset)
667 [EditorBrowsable(EditorBrowsableState.Never)]
668 protected virtual bool AccessibilityCopyText(int startPosition, int endPosition)
673 [EditorBrowsable(EditorBrowsableState.Never)]
674 protected virtual bool AccessibilityCutText(int startPosition, int endPosition)
680 /// Whether the CornerRadius property value is relative (percentage [0.0f to 1.0f] of the view size) or absolute (in world units).
681 /// It is absolute by default.
682 /// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
684 [EditorBrowsable(EditorBrowsableState.Never)]
685 public VisualTransformPolicyType CornerRadiusPolicy
687 get => (VisualTransformPolicyType)GetValue(CornerRadiusPolicyProperty);
688 set => SetValue(CornerRadiusPolicyProperty, value);
692 /// The current state of the view.
694 /// <since_tizen> 3 </since_tizen>
699 return (States)GetValue(StateProperty);
703 SetValue(StateProperty, value);
704 NotifyPropertyChanged();
709 /// The current sub state of the view.
711 /// <since_tizen> 3 </since_tizen>
712 public States SubState
716 return (States)GetValue(SubStateProperty);
720 SetValue(SubStateProperty, value);
721 NotifyPropertyChanged();
726 /// Displays a tooltip
728 /// <since_tizen> 3 </since_tizen>
729 public Tizen.NUI.PropertyMap Tooltip
733 return (PropertyMap)GetValue(TooltipProperty);
737 SetValue(TooltipProperty, value);
738 NotifyPropertyChanged();
743 /// Displays a tooltip as a text.
745 /// <since_tizen> 3 </since_tizen>
746 public string TooltipText
750 using (var propertyValue = GetProperty(Property.TOOLTIP))
752 if (propertyValue != null && propertyValue.Get(out string retrivedValue))
754 return retrivedValue;
756 NUILog.Error($"[ERROR] Fail to get TooltipText! Return error MSG (error to get TooltipText)!");
757 return "error to get TooltipText";
762 var temp = new Tizen.NUI.PropertyValue(value);
763 SetProperty(View.Property.TOOLTIP, temp);
765 NotifyPropertyChanged();
770 /// The Child property of FlexContainer.<br />
771 /// The proportion of the free space in the container, the flex item will receive.<br />
772 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
774 /// <since_tizen> 3 </since_tizen>
775 [Obsolete("Deprecated in API8, will be removed in API10.")]
780 return (float)GetValue(FlexProperty);
784 SetValue(FlexProperty, value);
785 NotifyPropertyChanged();
790 /// The Child property of FlexContainer.<br />
791 /// The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container.<br />
793 /// <since_tizen> 3 </since_tizen>
794 [Obsolete("Deprecated in API8, will be removed in API10.")]
799 return (int)GetValue(AlignSelfProperty);
803 SetValue(AlignSelfProperty, value);
804 NotifyPropertyChanged();
809 /// The Child property of FlexContainer.<br />
810 /// The space around the flex item.<br />
813 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
815 /// <since_tizen> 3 </since_tizen>
816 [Obsolete("Deprecated in API8, will be removed in API10.")]
817 public Vector4 FlexMargin
821 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
822 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
826 SetValue(FlexMarginProperty, value);
827 NotifyPropertyChanged();
832 /// The top-left cell this child occupies, if not set, the first available cell is used.
835 /// The property cascade chaining set is possible. For example, this (view.CellIndex.X = 0.1f;) is possible.
837 /// <since_tizen> 3 </since_tizen>
838 public Vector2 CellIndex
842 Vector2 temp = (Vector2)GetValue(CellIndexProperty);
843 return new Vector2(OnCellIndexChanged, temp.X, temp.Y);
847 SetValue(CellIndexProperty, value);
848 NotifyPropertyChanged();
853 /// The number of rows this child occupies, if not set, the default value is 1.
855 /// <since_tizen> 3 </since_tizen>
860 return (float)GetValue(RowSpanProperty);
864 SetValue(RowSpanProperty, value);
865 NotifyPropertyChanged();
870 /// The number of columns this child occupies, if not set, the default value is 1.
872 /// <since_tizen> 3 </since_tizen>
873 public float ColumnSpan
877 return (float)GetValue(ColumnSpanProperty);
881 SetValue(ColumnSpanProperty, value);
882 NotifyPropertyChanged();
887 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
889 /// <since_tizen> 3 </since_tizen>
890 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
894 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
898 SetValue(CellHorizontalAlignmentProperty, value);
899 NotifyPropertyChanged();
904 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
906 /// <since_tizen> 3 </since_tizen>
907 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
911 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
915 SetValue(CellVerticalAlignmentProperty, value);
916 NotifyPropertyChanged();
921 /// The left focusable view.<br />
922 /// This will return null if not set.<br />
923 /// This will also return null if the specified left focusable view is not on a window.<br />
925 /// <since_tizen> 3 </since_tizen>
926 public View LeftFocusableView
928 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
931 return (View)GetValue(LeftFocusableViewProperty);
935 SetValue(LeftFocusableViewProperty, value);
936 NotifyPropertyChanged();
941 /// The right focusable view.<br />
942 /// This will return null if not set.<br />
943 /// This will also return null if the specified right focusable view is not on a window.<br />
945 /// <since_tizen> 3 </since_tizen>
946 public View RightFocusableView
948 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
951 return (View)GetValue(RightFocusableViewProperty);
955 SetValue(RightFocusableViewProperty, value);
956 NotifyPropertyChanged();
961 /// The up focusable view.<br />
962 /// This will return null if not set.<br />
963 /// This will also return null if the specified up focusable view is not on a window.<br />
965 /// <since_tizen> 3 </since_tizen>
966 public View UpFocusableView
968 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
971 return (View)GetValue(UpFocusableViewProperty);
975 SetValue(UpFocusableViewProperty, value);
976 NotifyPropertyChanged();
981 /// The down focusable view.<br />
982 /// This will return null if not set.<br />
983 /// This will also return null if the specified down focusable view is not on a window.<br />
985 /// <since_tizen> 3 </since_tizen>
986 public View DownFocusableView
988 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
991 return (View)GetValue(DownFocusableViewProperty);
995 SetValue(DownFocusableViewProperty, value);
996 NotifyPropertyChanged();
1001 /// Whether the view should be focusable by keyboard navigation.
1003 /// <since_tizen> 3 </since_tizen>
1004 public bool Focusable
1008 SetValue(FocusableProperty, value);
1009 NotifyPropertyChanged();
1013 return (bool)GetValue(FocusableProperty);
1018 /// Retrieves the position of the view.<br />
1019 /// The coordinates are relative to the view's parent.<br />
1021 /// <since_tizen> 3 </since_tizen>
1022 public Position CurrentPosition
1026 return GetCurrentPosition();
1031 /// Sets the size of a view for the width and the height.<br />
1032 /// Geometry can be scaled to fit within this area.<br />
1033 /// This does not interfere with the view's scale factor.<br />
1034 /// The views default depth is the minimum of width and height.<br />
1037 /// This NUI object (Size2D) typed property can be configured by multiple cascade setting. <br />
1038 /// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ). <br />
1040 /// <since_tizen> 3 </since_tizen>
1041 public Size2D Size2D
1045 Size2D temp = (Size2D)GetValue(Size2DProperty);
1046 int width = temp.Width;
1047 int height = temp.Height;
1049 if (this.Layout == null)
1051 if (width < 0) { width = 0; }
1052 if (height < 0) { height = 0; }
1055 return new Size2D(OnSize2DChanged, width, height);
1059 SetValue(Size2DProperty, value);
1061 NotifyPropertyChanged();
1066 /// Retrieves the size of the view.<br />
1067 /// The coordinates are relative to the view's parent.<br />
1069 /// <since_tizen> 3 </since_tizen>
1070 public Size2D CurrentSize
1074 return GetCurrentSize();
1079 /// Retrieves and sets the view's opacity.<br />
1081 /// <since_tizen> 3 </since_tizen>
1082 public float Opacity
1086 return (float)GetValue(OpacityProperty);
1090 SetValue(OpacityProperty, value);
1091 selectorData?.Opacity?.Reset(this);
1092 NotifyPropertyChanged();
1097 /// Sets the position of the view for X and Y.<br />
1098 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
1099 /// If the position inheritance is disabled, sets the world position.<br />
1102 /// This NUI object (Position2D) typed property can be configured by multiple cascade setting. <br />
1103 /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ). <br />
1105 /// <since_tizen> 3 </since_tizen>
1106 public Position2D Position2D
1110 Position2D temp = (Position2D)GetValue(Position2DProperty);
1111 return new Position2D(OnPosition2DChanged, temp.X, temp.Y);
1115 SetValue(Position2DProperty, value);
1116 NotifyPropertyChanged();
1121 /// Retrieves the screen position of the view.<br />
1123 /// <since_tizen> 3 </since_tizen>
1124 public Vector2 ScreenPosition
1128 Vector2 temp = new Vector2(0.0f, 0.0f);
1129 var pValue = GetProperty(View.Property.ScreenPosition);
1137 /// Determines whether the pivot point should be used to determine the position of the view.
1138 /// This is false by default.
1140 /// <remarks>If false, then the top-left of the view is used for the position.
1141 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
1143 /// <since_tizen> 3 </since_tizen>
1144 public bool PositionUsesPivotPoint
1148 return (bool)GetValue(PositionUsesPivotPointProperty);
1152 SetValue(PositionUsesPivotPointProperty, value);
1153 NotifyPropertyChanged();
1158 /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead!
1160 /// <since_tizen> 3 </since_tizen>
1161 [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " +
1163 "View view = new View(); " +
1164 "view.PivotPoint = PivotPoint.Center; " +
1165 "view.PositionUsesPivotPoint = true;" +
1166 " Deprecated in API5: Will be removed in API8")]
1167 [EditorBrowsable(EditorBrowsableState.Never)]
1168 public bool PositionUsesAnchorPoint
1173 var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
1174 pValue.Get(out temp);
1180 var temp = new Tizen.NUI.PropertyValue(value);
1181 SetProperty(View.Property.PositionUsesAnchorPoint, temp);
1183 NotifyPropertyChanged();
1188 /// Queries whether the view is connected to the stage.<br />
1189 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
1191 /// <since_tizen> 3 </since_tizen>
1192 public bool IsOnWindow
1201 /// Gets the depth in the hierarchy for the view.
1203 /// <since_tizen> 3 </since_tizen>
1204 public int HierarchyDepth
1208 return GetHierarchyDepth();
1213 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
1216 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
1217 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
1218 /// The values set by this property will likely change.
1220 /// <since_tizen> 3 </since_tizen>
1221 public int SiblingOrder
1225 return (int)GetValue(SiblingOrderProperty);
1229 SetValue(SiblingOrderProperty, value);
1231 LayoutGroup layout = Layout as LayoutGroup;
1232 layout?.ChangeLayoutSiblingOrder(value);
1234 NotifyPropertyChanged();
1239 /// Returns the natural size of the view.
1242 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1244 /// <since_tizen> 5 </since_tizen>
1245 public Vector3 NaturalSize
1249 Vector3 ret = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
1250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1256 /// Returns the natural size (Size2D) of the view.
1259 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
1261 /// <since_tizen> 4 </since_tizen>
1262 public Size2D NaturalSize2D
1266 Vector3 temp = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
1267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
1269 Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
1276 /// Gets or sets the origin of a view within its parent's area.<br />
1277 /// 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 />
1278 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
1279 /// A view's position is the distance between this origin and the view's anchor-point.<br />
1281 /// <pre>The view has been initialized.</pre>
1282 /// <since_tizen> 3 </since_tizen>
1283 public Position ParentOrigin
1287 Position tmp = (Position)GetValue(ParentOriginProperty);
1288 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
1292 SetValue(ParentOriginProperty, value);
1293 NotifyPropertyChanged();
1298 /// Gets or sets the anchor-point of a view.<br />
1299 /// 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 />
1300 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
1301 /// A view position is the distance between its parent-origin and this anchor-point.<br />
1302 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
1303 /// <pre>The view has been initialized.</pre>
1306 /// The property cascade chaining set is possible. For example, this (view.PivotPoint.X = 0.1f;) is possible.
1308 /// <since_tizen> 3 </since_tizen>
1309 public Position PivotPoint
1313 Position tmp = (Position)GetValue(PivotPointProperty);
1314 return new Position(OnPivotPointChanged, tmp.X, tmp.Y, tmp.Z);
1318 SetValue(PivotPointProperty, value);
1319 NotifyPropertyChanged();
1324 /// Gets or sets the size width of the view.
1328 /// Animatable - This property can be animated using <c>Animation</c> class.
1331 /// <since_tizen> 3 </since_tizen>
1332 public float SizeWidth
1336 return (float)GetValue(SizeWidthProperty);
1340 SetValue(SizeWidthProperty, value);
1341 NotifyPropertyChanged();
1346 /// Gets or sets the size height of the view.
1350 /// Animatable - This property can be animated using <c>Animation</c> class.
1353 /// <since_tizen> 3 </since_tizen>
1354 public float SizeHeight
1358 return (float)GetValue(SizeHeightProperty);
1362 SetValue(SizeHeightProperty, value);
1363 NotifyPropertyChanged();
1368 /// Gets or sets the position of the view.<br />
1369 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1370 /// If the position inheritance is disabled, sets the world position.<br />
1374 /// Animatable - This property can be animated using <c>Animation</c> class.
1376 /// The property cascade chaining set is possible. For example, this (view.Position.X = 1.0f;) is possible.
1378 /// <since_tizen> 3 </since_tizen>
1379 public Position Position
1383 Position tmp = (Position)GetValue(PositionProperty);
1384 return new Position(OnPositionChanged, tmp.X, tmp.Y, tmp.Z);
1388 SetValue(PositionProperty, value);
1389 NotifyPropertyChanged();
1394 /// Gets or sets the position X of the view.
1398 /// Animatable - This property can be animated using <c>Animation</c> class.
1401 /// <since_tizen> 3 </since_tizen>
1402 public float PositionX
1406 return (float)GetValue(PositionXProperty);
1410 SetValue(PositionXProperty, value);
1411 NotifyPropertyChanged();
1416 /// Gets or sets the position Y of the view.
1420 /// Animatable - This property can be animated using <c>Animation</c> class.
1423 /// <since_tizen> 3 </since_tizen>
1424 public float PositionY
1428 return (float)GetValue(PositionYProperty);
1432 SetValue(PositionYProperty, value);
1433 NotifyPropertyChanged();
1438 /// Gets or sets the position Z of the view.
1442 /// Animatable - This property can be animated using <c>Animation</c> class.
1445 /// <since_tizen> 3 </since_tizen>
1446 public float PositionZ
1450 return (float)GetValue(PositionZProperty);
1454 SetValue(PositionZProperty, value);
1455 NotifyPropertyChanged();
1460 /// Gets or sets the world position of the view.
1462 /// <since_tizen> 3 </since_tizen>
1463 public Vector3 WorldPosition
1467 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1468 var pValue = GetProperty(View.Property.WorldPosition);
1476 /// Gets or sets the orientation of the view.<br />
1477 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1481 /// This is an asynchronous method.
1484 /// Animatable - This property can be animated using <c>Animation</c> class.
1487 /// <since_tizen> 3 </since_tizen>
1488 public Rotation Orientation
1492 return (Rotation)GetValue(OrientationProperty);
1496 SetValue(OrientationProperty, value);
1497 NotifyPropertyChanged();
1502 /// Gets or sets the world orientation of the view.<br />
1504 /// <since_tizen> 3 </since_tizen>
1505 public Rotation WorldOrientation
1509 Rotation temp = new Rotation();
1510 var pValue = GetProperty(View.Property.WorldOrientation);
1518 /// Gets or sets the scale factor applied to the view.<br />
1522 /// Animatable - This property can be animated using <c>Animation</c> class.
1524 /// The property cascade chaining set is possible. For example, this (view.Scale.X = 0.1f;) is possible.
1526 /// <since_tizen> 3 </since_tizen>
1527 public Vector3 Scale
1531 Vector3 temp = (Vector3)GetValue(ScaleProperty);
1532 return new Vector3(OnScaleChanged, temp.X, temp.Y, temp.Z);
1536 SetValue(ScaleProperty, value);
1537 NotifyPropertyChanged();
1542 /// Gets or sets the scale X factor applied to the view.
1546 /// Animatable - This property can be animated using <c>Animation</c> class.
1549 /// <since_tizen> 3 </since_tizen>
1554 return (float)GetValue(ScaleXProperty);
1558 SetValue(ScaleXProperty, value);
1559 NotifyPropertyChanged();
1564 /// Gets or sets the scale Y factor applied to the view.
1568 /// Animatable - This property can be animated using <c>Animation</c> class.
1571 /// <since_tizen> 3 </since_tizen>
1576 return (float)GetValue(ScaleYProperty);
1580 SetValue(ScaleYProperty, value);
1581 NotifyPropertyChanged();
1586 /// Gets or sets the scale Z factor applied to the view.
1590 /// Animatable - This property can be animated using <c>Animation</c> class.
1593 /// <since_tizen> 3 </since_tizen>
1598 return (float)GetValue(ScaleZProperty);
1602 SetValue(ScaleZProperty, value);
1603 NotifyPropertyChanged();
1608 /// Gets the world scale of the view.
1610 /// <since_tizen> 3 </since_tizen>
1611 public Vector3 WorldScale
1615 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1616 var pValue = GetProperty(View.Property.WorldScale);
1624 /// Retrieves the visibility flag of the view.
1628 /// If the view is not visible, then the view and its children will not be rendered.
1629 /// 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.
1632 /// Animatable - This property can be animated using <c>Animation</c> class.
1635 /// <since_tizen> 3 </since_tizen>
1636 public bool Visibility
1641 var pValue = GetProperty(View.Property.VISIBLE);
1642 pValue.Get(out temp);
1649 /// Gets the view's world color.
1651 /// <since_tizen> 3 </since_tizen>
1652 public Vector4 WorldColor
1656 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1657 var pValue = GetProperty(View.Property.WorldColor);
1665 /// Gets or sets the view's name.
1667 /// <since_tizen> 3 </since_tizen>
1672 return (string)GetValue(NameProperty);
1676 SetValue(NameProperty, value);
1677 NotifyPropertyChanged();
1682 /// Get the number of children held by the view.
1684 /// <since_tizen> 3 </since_tizen>
1685 public new uint ChildCount
1689 return Convert.ToUInt32(Children.Count);
1694 /// Gets the view's ID.
1697 /// <since_tizen> 3 </since_tizen>
1707 /// Gets or sets the status of whether the view should emit touch or hover signals.
1709 /// <since_tizen> 3 </since_tizen>
1710 public bool Sensitive
1714 return (bool)GetValue(SensitiveProperty);
1718 SetValue(SensitiveProperty, value);
1719 NotifyPropertyChanged();
1724 /// 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.
1726 /// <since_tizen> 3 </since_tizen>
1727 public bool LeaveRequired
1731 return (bool)GetValue(LeaveRequiredProperty);
1735 SetValue(LeaveRequiredProperty, value);
1736 NotifyPropertyChanged();
1741 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
1743 /// <since_tizen> 3 </since_tizen>
1744 public bool InheritOrientation
1748 return (bool)GetValue(InheritOrientationProperty);
1752 SetValue(InheritOrientationProperty, value);
1753 NotifyPropertyChanged();
1758 /// Gets or sets the status of whether a child view inherits it's parent's scale.
1760 /// <since_tizen> 3 </since_tizen>
1761 public bool InheritScale
1765 return (bool)GetValue(InheritScaleProperty);
1769 SetValue(InheritScaleProperty, value);
1770 NotifyPropertyChanged();
1775 /// Gets or sets the status of how the view and its children should be drawn.<br />
1776 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
1777 /// 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 />
1778 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
1779 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
1780 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
1782 /// <since_tizen> 3 </since_tizen>
1783 public DrawModeType DrawMode
1787 return (DrawModeType)GetValue(DrawModeProperty);
1791 SetValue(DrawModeProperty, value);
1792 NotifyPropertyChanged();
1797 /// Gets or sets the relative to parent size factor of the view.<br />
1798 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
1799 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
1802 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
1804 /// <since_tizen> 3 </since_tizen>
1805 public Vector3 SizeModeFactor
1809 Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty);
1810 return new Vector3(OnSizeModeFactorChanged, temp.X, temp.Y, temp.Z);
1814 SetValue(SizeModeFactorProperty, value);
1815 NotifyPropertyChanged();
1820 /// Gets or sets the width resize policy to be used.
1822 /// <since_tizen> 3 </since_tizen>
1823 public ResizePolicyType WidthResizePolicy
1827 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
1831 SetValue(WidthResizePolicyProperty, value);
1832 NotifyPropertyChanged();
1837 /// Gets or sets the height resize policy to be used.
1839 /// <since_tizen> 3 </since_tizen>
1840 public ResizePolicyType HeightResizePolicy
1844 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
1848 SetValue(HeightResizePolicyProperty, value);
1849 NotifyPropertyChanged();
1854 /// Gets or sets the policy to use when setting size with size negotiation.<br />
1855 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
1857 /// <since_tizen> 3 </since_tizen>
1858 public SizeScalePolicyType SizeScalePolicy
1862 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
1866 SetValue(SizeScalePolicyProperty, value);
1867 NotifyPropertyChanged();
1872 /// Gets or sets the status of whether the width size is dependent on the height size.
1874 /// <since_tizen> 3 </since_tizen>
1875 public bool WidthForHeight
1879 return (bool)GetValue(WidthForHeightProperty);
1883 SetValue(WidthForHeightProperty, value);
1884 NotifyPropertyChanged();
1889 /// Gets or sets the status of whether the height size is dependent on the width size.
1891 /// <since_tizen> 3 </since_tizen>
1892 public bool HeightForWidth
1896 return (bool)GetValue(HeightForWidthProperty);
1900 SetValue(HeightForWidthProperty, value);
1901 NotifyPropertyChanged();
1906 /// Gets or sets the padding for use in layout.
1909 /// The property cascade chaining set is possible. For example, this (view.Padding.X = 0.1f;) is possible.
1911 /// <since_tizen> 5 </since_tizen>
1912 public Extents Padding
1916 // If View has a Layout then padding in stored in the base Layout class
1919 return Layout.Padding;
1923 Extents temp = (Extents)GetValue(PaddingProperty);
1924 return new Extents(OnPaddingChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1926 // Two return points to prevent creating a zeroed Extent native object before assignment
1930 Extents padding = value;
1933 // Layout set so store Padding in LayoutItem instead of in View.
1934 // If View stores the Padding value then Legacy Size Negotiation will overwrite
1935 // the position and sizes measure in the Layouting.
1936 Layout.Padding = value;
1937 // If Layout is a LayoutItem then it could be a View that handles it's own padding.
1938 // Let the View keeps it's padding. Still store Padding in Layout to reduce code paths.
1939 if (typeof(LayoutGroup).IsAssignableFrom(Layout.GetType())) // If a Layout container of some kind.
1941 padding = new Extents(0, 0, 0, 0); // Reset value stored in View.
1945 SetValue(PaddingProperty, padding);
1946 NotifyPropertyChanged();
1951 /// Gets or sets the minimum size the view can be assigned in size negotiation.
1953 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
1955 /// The property cascade chaining set is possible. For example, this (view.MinimumSize.Width = 1;) is possible.
1957 /// <since_tizen> 3 </since_tizen>
1958 public Size2D MinimumSize
1962 Size2D tmp = (Size2D)GetValue(MinimumSizeProperty);
1963 return new Size2D(OnMinimumSizeChanged, tmp.Width, tmp.Height);
1969 throw new ArgumentNullException(nameof(value));
1973 // Note: it only works if minimum size is >= than natural size.
1974 // To force the size it should be done through the width&height spec or Size2D.
1975 layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
1976 layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
1977 layout.RequestLayout();
1979 SetValue(MinimumSizeProperty, value);
1980 NotifyPropertyChanged();
1985 /// Gets or sets the maximum size the view can be assigned in size negotiation.
1988 /// The property cascade chaining set is possible. For example, this (view.MaximumSize.Width = 1;) is possible.
1990 /// <since_tizen> 3 </since_tizen>
1991 public Size2D MaximumSize
1995 Size2D tmp = (Size2D)GetValue(MaximumSizeProperty);
1996 return new Size2D(OnMaximumSizeChanged, tmp.Width, tmp.Height);
2000 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
2001 // MATCH_PARENT spec + parent container size can be used to limit
2004 layout.RequestLayout();
2006 SetValue(MaximumSizeProperty, value);
2007 NotifyPropertyChanged();
2012 /// Gets or sets whether a child view inherits it's parent's position.<br />
2013 /// Default is to inherit.<br />
2014 /// 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 />
2016 /// <since_tizen> 3 </since_tizen>
2017 public bool InheritPosition
2021 return (bool)GetValue(InheritPositionProperty);
2025 SetValue(InheritPositionProperty, value);
2026 NotifyPropertyChanged();
2031 /// Gets or sets the clipping behavior (mode) of it's children.
2033 /// <since_tizen> 3 </since_tizen>
2034 public ClippingModeType ClippingMode
2038 return (ClippingModeType)GetValue(ClippingModeProperty);
2042 SetValue(ClippingModeProperty, value);
2043 NotifyPropertyChanged();
2048 /// Gets the number of renderers held by the view.
2050 /// <since_tizen> 3 </since_tizen>
2051 public uint RendererCount
2055 return GetRendererCount();
2060 /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
2063 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
2065 /// <since_tizen> 3 </since_tizen>
2066 [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
2068 "View view = new View(); " +
2069 "view.PivotPoint = PivotPoint.Center; " +
2070 "view.PositionUsesPivotPoint = true;")]
2071 [EditorBrowsable(EditorBrowsableState.Never)]
2072 public Position AnchorPoint
2076 Position temp = new Position(0.0f, 0.0f, 0.0f);
2077 var pValue = GetProperty(View.Property.AnchorPoint);
2080 Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
2086 var temp = new Tizen.NUI.PropertyValue(value);
2087 SetProperty(View.Property.AnchorPoint, temp);
2089 NotifyPropertyChanged();
2094 /// Sets the size of a view for the width, the height and the depth.<br />
2095 /// Geometry can be scaled to fit within this area.<br />
2096 /// This does not interfere with the view's scale factor.<br />
2097 /// The views default depth is the minimum of width and height.<br />
2101 /// Animatable - This property can be animated using <c>Animation</c> class.
2103 /// The property cascade chaining set is possible. For example, this (view.Size.Width = 1.0f;) is possible.
2105 /// <since_tizen> 5 </since_tizen>
2110 Size tmp = (Size)GetValue(SizeProperty);
2111 return new Size(OnSizeChanged, tmp.Width, tmp.Height, tmp.Depth);
2115 SetValue(SizeProperty, value);
2116 NotifyPropertyChanged();
2121 /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
2123 /// <since_tizen> 3 </since_tizen>
2124 [Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
2126 "Container parent = view.GetParent(); " +
2127 "View view = parent as View;")]
2128 [EditorBrowsable(EditorBrowsableState.Never)]
2129 public new View Parent
2134 IntPtr cPtr = Interop.Actor.GetParent(SwigCPtr);
2135 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
2136 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
2138 if (basehandle is Layer layer)
2140 ret = new View(Layer.getCPtr(layer).Handle, false);
2141 NUILog.Error("This Parent property is deprecated, should do not be used");
2145 ret = basehandle as View;
2148 Interop.BaseHandle.DeleteBaseHandle(CPtr);
2149 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
2151 if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
2157 /// Gets/Sets whether inherit parent's the layout Direction.
2159 /// <since_tizen> 4 </since_tizen>
2160 public bool InheritLayoutDirection
2164 return (bool)GetValue(InheritLayoutDirectionProperty);
2168 SetValue(InheritLayoutDirectionProperty, value);
2169 NotifyPropertyChanged();
2174 /// Gets/Sets the layout Direction.
2176 /// <since_tizen> 4 </since_tizen>
2177 public ViewLayoutDirectionType LayoutDirection
2181 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
2185 SetValue(LayoutDirectionProperty, value);
2186 NotifyPropertyChanged();
2187 layout?.RequestLayout();
2192 /// Gets or sets the Margin for use in layout.
2195 /// Margin property is supported by Layout algorithms and containers.
2196 /// Please Set Layout if you want to use Margin property.
2197 /// The property cascade chaining set is possible. For example, this (view.Margin.X = 0.1f;) is possible.
2199 /// <since_tizen> 4 </since_tizen>
2200 public Extents Margin
2204 // If View has a Layout then margin is stored in Layout.
2207 return Layout.Margin;
2211 // If Layout not set then return margin stored in View.
2212 Extents temp = (Extents)GetValue(MarginProperty);
2213 return new Extents(OnMarginChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2215 // Two return points to prevent creating a zeroed Extent native object before assignment
2221 // Layout set so store Margin in LayoutItem instead of View.
2222 // If View stores the Margin too then the Legacy Size Negotiation will
2223 // overwrite the position and size values measured in the Layouting.
2224 Layout.Margin = value;
2225 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2226 layout?.RequestLayout();
2230 SetValue(MarginProperty, value);
2232 NotifyPropertyChanged();
2233 layout?.RequestLayout();
2238 /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
2240 /// <since_tizen> 6 </since_tizen>
2241 public int WidthSpecification
2249 if (value == widthPolicy)
2252 widthPolicy = value;
2253 if (widthPolicy >= 0)
2255 if (heightPolicy >= 0) // Policy an exact value
2257 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2258 Size2D = new Size2D(widthPolicy, heightPolicy);
2261 layout?.RequestLayout();
2266 /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
2268 /// <since_tizen> 6 </since_tizen>
2269 public int HeightSpecification
2273 return heightPolicy;
2277 if (value == heightPolicy)
2280 heightPolicy = value;
2281 if (heightPolicy >= 0)
2283 if (widthPolicy >= 0) // Policy an exact value
2285 // Create Size2D only both _widthPolicy and _heightPolicy are set.
2286 Size2D = new Size2D(widthPolicy, heightPolicy);
2289 layout?.RequestLayout();
2294 /// Gets the List of transitions for this View.
2296 /// <since_tizen> 6 </since_tizen>
2297 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
2301 if (layoutTransitions == null)
2303 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2305 return layoutTransitions;
2310 /// Set a layout transitions for this View.
2312 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
2314 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
2316 /// <since_tizen> 6 </since_tizen>
2317 public LayoutTransition LayoutTransition
2321 return layoutTransition;
2327 throw new global::System.ArgumentNullException(nameof(value));
2329 if (layoutTransitions == null)
2331 layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2334 LayoutTransitionsHelper.AddTransitionForCondition(layoutTransitions, value.Condition, value, true);
2336 AttachTransitionsToChildren(value);
2338 layoutTransition = value;
2343 /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
2346 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2348 /// <since_tizen> 4 </since_tizen>
2349 [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
2350 [EditorBrowsable(EditorBrowsableState.Never)]
2351 public Extents PaddingEX
2355 Extents temp = new Extents(0, 0, 0, 0);
2356 var pValue = GetProperty(View.Property.PADDING);
2359 Extents ret = new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2365 var temp = new Tizen.NUI.PropertyValue(value);
2366 SetProperty(View.Property.PADDING, temp);
2368 NotifyPropertyChanged();
2369 layout?.RequestLayout();
2374 /// The Color of View. This is an RGBA value.
2378 /// Animatable - This property can be animated using <c>Animation</c> class.
2380 /// The property cascade chaining set is possible. For example, this (view.Color.X = 0.1f;) is possible.
2382 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2383 [EditorBrowsable(EditorBrowsableState.Never)]
2388 Color temp = (Color)GetValue(ColorProperty);
2389 return new Color(OnColorChanged, temp.R, temp.G, temp.B, temp.A);
2393 SetValue(ColorProperty, value);
2394 selectorData?.Color?.Reset(this);
2395 NotifyPropertyChanged();
2400 /// Set the layout on this View. Replaces any existing Layout.
2403 /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
2405 /// <since_tizen> 6 </since_tizen>
2406 public LayoutItem Layout
2414 // Do nothing if layout provided is already set on this View.
2415 if (value == layout)
2420 LayoutingDisabled = false;
2423 // If new layout being set already has a owner then that owner receives a replacement default layout.
2424 // First check if the layout to be set already has a owner.
2425 if (value?.Owner != null)
2427 // Previous owner of the layout gets a default layout as a replacement.
2428 value.Owner.Layout = new AbsoluteLayout();
2430 // Copy Margin and Padding to replacement LayoutGroup.
2431 if (value.Owner.Layout != null)
2433 value.Owner.Layout.Margin = value.Margin;
2434 value.Owner.Layout.Padding = value.Padding;
2438 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2439 // View if no replacement. Previously margin and padding values would have been moved from
2440 // the View to the layout.
2441 if (layout != null) // Existing layout
2445 // Existing layout being replaced so copy over margin and padding values.
2446 value.Margin = layout.Margin;
2447 value.Padding = layout.Padding;
2451 // Layout not being replaced so restore margin and padding to View.
2452 SetValue(MarginProperty, layout.Margin);
2453 SetValue(PaddingProperty, layout.Padding);
2454 NotifyPropertyChanged();
2459 // First Layout to be added to the View hence copy
2461 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2464 Extents margin = Margin;
2465 Extents padding = Padding;
2466 if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
2468 // If View already has a margin set then store it in Layout instead.
2469 value.Margin = margin;
2470 SetValue(MarginProperty, new Extents(0, 0, 0, 0));
2471 NotifyPropertyChanged();
2474 if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
2476 // If View already has a padding set then store it in Layout instead.
2477 value.Padding = padding;
2479 // If Layout is a LayoutItem then it could be a View that handles it's own padding.
2480 // Let the View keeps it's padding. Still store Padding in Layout to reduce code paths.
2481 if (typeof(LayoutGroup).IsAssignableFrom(value.GetType()))
2483 SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
2484 NotifyPropertyChanged();
2490 // Remove existing layout from it's parent layout group.
2493 value.SetPositionByLayout = !excludeLayouting;
2495 // Set layout to this view
2501 /// The weight of the View, used to share available space in a layout with siblings.
2503 /// <since_tizen> 6 </since_tizen>
2513 layout?.RequestLayout();
2518 /// Whether to load the BackgroundImage synchronously.
2519 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2520 /// Note: For Normal Quad images only.
2522 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2523 [EditorBrowsable(EditorBrowsableState.Never)]
2524 public bool BackgroundImageSynchronosLoading
2528 return backgroundImageSynchronosLoading;
2532 backgroundImageSynchronosLoading = value;
2534 string bgUrl = null;
2535 var pValue = Background.Find(ImageVisualProperty.URL);
2536 pValue?.Get(out bgUrl);
2539 if (!string.IsNullOrEmpty(bgUrl))
2541 PropertyMap bgMap = this.Background;
2542 var temp = new PropertyValue(backgroundImageSynchronosLoading);
2543 bgMap.Add("synchronousLoading", temp);
2550 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2551 [EditorBrowsable(EditorBrowsableState.Never)]
2552 public Vector2 UpdateSizeHint
2556 return (Vector2)GetValue(UpdateSizeHintProperty);
2560 SetValue(UpdateSizeHintProperty, value);
2561 NotifyPropertyChanged();
2566 /// Enable/Disable ControlState propagation for children.
2567 /// It is false by default.
2568 /// If the View needs to share ControlState with descendants, please set it true.
2569 /// Please note that, changing the value will also changes children's EnableControlStatePropagation value recursively.
2571 [EditorBrowsable(EditorBrowsableState.Never)]
2572 public bool EnableControlStatePropagation
2574 get => controlStatePropagation;
2577 controlStatePropagation = value;
2579 foreach (View child in Children)
2581 child.EnableControlStatePropagation = value;
2587 /// By default, it is false in View, true in Control.
2588 /// Note that if the value is true, the View will be a touch receptor.
2590 [EditorBrowsable(EditorBrowsableState.Never)]
2591 public bool EnableControlState
2595 return (bool)GetValue(EnableControlStateProperty);
2599 SetValue(EnableControlStateProperty, value);
2604 /// Whether the actor grab all touches even if touch leaves its boundary.
2606 /// <returns>true, if it grab all touch after start</returns>
2607 [EditorBrowsable(EditorBrowsableState.Never)]
2608 public bool GrabTouchAfterLeave
2613 var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
2614 pValue.Get(out temp);
2620 var temp = new Tizen.NUI.PropertyValue(value);
2621 SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
2623 NotifyPropertyChanged();
2628 /// Determines which blend equation will be used to render renderers of this actor.
2630 /// <returns>blend equation enum currently assigned</returns>
2631 /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
2632 [EditorBrowsable(EditorBrowsableState.Never)]
2633 public BlendEquationType BlendEquation
2638 var pValue = GetProperty(View.Property.BlendEquation);
2639 pValue.Get(out temp);
2641 return (BlendEquationType)temp;
2645 var temp = new Tizen.NUI.PropertyValue((int)value);
2646 SetProperty(View.Property.BlendEquation, temp);
2648 NotifyPropertyChanged();
2653 /// If the value is true, the View will change its style as the theme changes.
2654 /// It is false by default, but turned to true when setting StyleName (by setting property or using specified constructor).
2656 [EditorBrowsable(EditorBrowsableState.Never)]
2657 public bool ThemeChangeSensitive
2659 get => (bool)GetValue(ThemeChangeSensitiveProperty);
2660 set => SetValue(ThemeChangeSensitiveProperty, value);
2664 /// Create Style, it is abstract function and must be override.
2666 [EditorBrowsable(EditorBrowsableState.Never)]
2667 protected virtual ViewStyle CreateViewStyle()
2669 return new ViewStyle();
2673 /// Called after the View's ControlStates changed.
2675 /// <param name="controlStateChangedInfo">The information including state changed variables.</param>
2676 [EditorBrowsable(EditorBrowsableState.Never)]
2677 protected virtual void OnControlStateChanged(ControlStateChangedEventArgs controlStateChangedInfo)
2683 [EditorBrowsable(EditorBrowsableState.Never)]
2684 protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
2689 private bool IsViewPropertyDirty(BindableProperty styleProperty)
2691 if (dirtyPropertySet.Count == 0)
2696 if (styleProperty.ReturnType.IsGenericType && styleProperty.ReturnType.GetGenericTypeDefinition() == typeof(Selector<>))
2698 return dirtyPropertySet.Contains(styleProperty.PropertyName.Substring(0, styleProperty.PropertyName.Length - 8));
2701 return dirtyPropertySet.Contains(styleProperty.PropertyName);
2705 /// Apply style instance to the view.
2706 /// Basically it sets the bindable property to the value of the bindable property with same name in the style.
2708 [EditorBrowsable(EditorBrowsableState.Never)]
2709 public virtual void ApplyStyle(ViewStyle viewStyle)
2711 if (viewStyle == null || this.viewStyle == viewStyle) return;
2713 this.viewStyle = viewStyle;
2715 if (viewStyle.DirtyProperties == null || viewStyle.DirtyProperties.Count == 0)
2721 if (dirtyPropertySet == null)
2723 dirtyPropertySet = new HashSet<string>();
2726 BindableProperty.GetBindablePropertysOfType(GetType(), out var bindablePropertyOfView);
2728 if (bindablePropertyOfView == null)
2733 var dirtyStyleProperties = new BindableProperty[viewStyle.DirtyProperties.Count];
2734 viewStyle.DirtyProperties.CopyTo(dirtyStyleProperties);
2736 foreach (var sourceProperty in dirtyStyleProperties)
2738 if (blockSetDirty && IsViewPropertyDirty(sourceProperty))
2740 // Skip applying theme style for a property set by user.
2744 var sourceValue = viewStyle.GetValue(sourceProperty);
2746 if (sourceValue == null)
2751 bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
2753 if (destinationProperty != null)
2755 SetValue(destinationProperty, sourceValue);
2761 /// Get whether the View is culled or not.
2762 /// True means that the View is out of the view frustum.
2765 /// Hidden-API (Inhouse-API).
2767 [EditorBrowsable(EditorBrowsableState.Never)]
2773 var pValue = GetProperty(View.Property.Culled);
2774 pValue.Get(out temp);
2781 /// Set or Get TransitionOptions for the page transition.
2784 /// Hidden-API (Inhouse-API).
2786 [EditorBrowsable(EditorBrowsableState.Never)]
2787 public TransitionOptions TransitionOptions
2791 transitionOptions = value;
2795 return transitionOptions;