2 * Copyright(c) 2019 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
33 /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout.
35 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
36 [EditorBrowsable(EditorBrowsableState.Never)]
37 public bool layoutSet = false;
40 /// Flag to allow Layouting to be disabled for Views.
41 /// Once a View has a Layout set then any children added to Views from then on will receive
42 /// automatic Layouts.
44 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
45 [EditorBrowsable(EditorBrowsableState.Never)]
46 public static bool layoutingDisabled{get; set;} = true;
48 private LayoutItem _layout; // Exclusive layout assigned to this View.
50 // List of transitions paired with the condition that uses the transition.
51 private Dictionary<TransitionCondition, TransitionList> _layoutTransitions;
52 private int _widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
53 private int _heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
54 private int _oldWidthPolicy = LayoutParamPolicies.MatchParent; // // Store Layout width to compare against later
55 private int _oldHeightPolicy = LayoutParamPolicies.MatchParent; // Store Layout height to compare against later
56 private float _weight = 0.0f; // Weighting of child View in a Layout
57 private MeasureSpecification _measureSpecificationWidth; // Layout width and internal Mode
58 private MeasureSpecification _measureSpecificationHeight; // Layout height and internal Mode
59 private bool _backgroundImageSynchronosLoading = false;
60 private Dictionary<string, Transition> transDictionary = new Dictionary<string, Transition>();
61 private string[] transitionNames;
62 private Rectangle backgroundImageBorder;
64 private ViewSelector<ImageShadow> imageShadow;
66 private ViewSelector<Shadow> boxShadow;
68 internal Size2D sizeSetExplicitly = new Size2D(); // Store size set by API, will be used in place of NaturalSize if not set.
72 private ViewStyle viewStyle;
73 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
74 [EditorBrowsable(EditorBrowsableState.Never)]
75 public ViewStyle ViewStyle
79 if (null == viewStyle)
81 ApplyStyle(GetViewStyle());
89 /// Creates a new instance of a view.
91 /// <since_tizen> 3 </since_tizen>
92 public View() : this(Interop.View.View_New(), true)
94 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
97 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
98 [EditorBrowsable(EditorBrowsableState.Never)]
99 public View(ViewStyle viewStyle) : this(Interop.View.View_New(), true)
101 this.ViewStyle.CopyFrom(viewStyle);
105 /// Create a new instance of a View with setting the status of shown or hidden.
107 /// <param name="shown">false : Not displayed (hidden), true : displayed (shown)</param>
108 /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI).
109 [EditorBrowsable(EditorBrowsableState.Never)]
110 public View(bool shown) : this(Interop.View.View_New(), true)
112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
116 internal View(View uiControl, bool shown = true) : this(Interop.View.new_View__SWIG_1(View.getCPtr(uiControl)), true)
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, ViewStyle viewStyle, bool shown = true) : this(cPtr, cMemoryOwn, shown)
127 this.ViewStyle.CopyFrom(viewStyle);
130 internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.View.View_SWIGUpcast(cPtr), cMemoryOwn)
134 PositionUsesPivotPoint = false;
137 _onWindowSendEventCallback = SendViewAddedEventToWindow;
138 this.OnWindowSignal().Connect(_onWindowSendEventCallback);
146 internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true)
148 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156 internal delegate void ControlStateChangesDelegate(View obj, ControlStates state);
157 internal event ControlStateChangesDelegate ControlStateChangeEvent;
159 private ControlStates controlStates;
161 /// Get/Set the control state.
163 /// <since_tizen> 6 </since_tizen>
164 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
165 [EditorBrowsable(EditorBrowsableState.Never)]
166 public ControlStates ControlState
170 return controlStates;
174 if (controlStates != value)
176 controlStates = value;
178 ControlStateChangeEvent?.Invoke(this, value);
180 if (true == OnControlStateChanged(value))
182 foreach (View child in Children)
184 child.ControlState = value;
191 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
192 [EditorBrowsable(EditorBrowsableState.Never)]
193 public bool IsResourcesCreated
197 return Application.Current.IsResourcesCreated;
201 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
202 [EditorBrowsable(EditorBrowsableState.Never)]
203 public ResourceDictionary XamlResources
207 return Application.Current.XamlResources;
211 Application.Current.XamlResources = value;
216 /// The StyleName, type string.
218 /// <since_tizen> 3 </since_tizen>
219 public string StyleName
223 return (string)GetValue(StyleNameProperty);
227 SetValue(StyleNameProperty, value);
228 NotifyPropertyChanged();
233 /// The mutually exclusive with "backgroundImage" and "background" type Vector4.
236 /// The property cascade chaining set is possible. For example, this (view.BackgroundColor.X = 0.1f;) is possible.
238 /// <since_tizen> 3 </since_tizen>
239 public Color BackgroundColor
243 Color temp = (Color)GetValue(BackgroundColorProperty);
244 return new Color(OnBackgroundColorChanged, temp.R, temp.G, temp.B, temp.A);
248 SetValue(BackgroundColorProperty, value);
249 NotifyPropertyChanged();
254 /// The mutually exclusive with "backgroundColor" and "background" type Map.
256 /// <since_tizen> 3 </since_tizen>
257 public string BackgroundImage
261 return (string)GetValue(BackgroundImageProperty);
265 SetValue(BackgroundImageProperty, value);
266 NotifyPropertyChanged();
271 /// Get or set the border of background image.
273 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
274 [EditorBrowsable(EditorBrowsableState.Never)]
275 public Rectangle BackgroundImageBorder
279 return (Rectangle)GetValue(BackgroundImageBorderProperty);
283 SetValue(BackgroundImageBorderProperty, value);
284 NotifyPropertyChanged();
289 /// The background of view.
291 /// <since_tizen> 3 </since_tizen>
292 public Tizen.NUI.PropertyMap Background
296 return (PropertyMap)GetValue(BackgroundProperty);
300 SetValue(BackgroundProperty, value);
301 NotifyPropertyChanged();
306 /// Describes a shadow as an image for a View.
307 /// It is null by default.
310 /// The mutually exclusive with "BoxShadow".
312 [EditorBrowsable(EditorBrowsableState.Never)]
313 public ImageShadow ImageShadow
317 var value = (ImageShadow)GetValue(ImageShadowProperty);
318 return value == null ? null : new ImageShadow(value, OnImageShadowChanged);
322 SetValue(ImageShadowProperty, value);
323 NotifyPropertyChanged();
328 /// Describes a box shaped shadow drawing for a View.
329 /// It is null by default.
332 /// The mutually exclusive with "ImageShadow".
334 [EditorBrowsable(EditorBrowsableState.Never)]
335 public Shadow BoxShadow
339 var value = (Shadow)GetValue(BoxShadowProperty);
340 return value == null ? null : new Shadow(value, OnBoxShadowChanged);
344 SetValue(BoxShadowProperty, value);
345 NotifyPropertyChanged();
350 /// The current state of the view.
352 /// <since_tizen> 3 </since_tizen>
357 return (States)GetValue(StateProperty);
361 SetValue(StateProperty, value);
362 NotifyPropertyChanged();
367 /// The current sub state of the view.
369 /// <since_tizen> 3 </since_tizen>
370 public States SubState
374 return (States)GetValue(SubStateProperty);
378 SetValue(SubStateProperty, value);
379 NotifyPropertyChanged();
384 /// Displays a tooltip
386 /// <since_tizen> 3 </since_tizen>
387 public Tizen.NUI.PropertyMap Tooltip
391 return (PropertyMap)GetValue(TooltipProperty);
395 SetValue(TooltipProperty, value);
396 NotifyPropertyChanged();
401 /// Displays a tooltip as a text.
403 /// <since_tizen> 3 </since_tizen>
404 public string TooltipText
408 SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value));
409 NotifyPropertyChanged();
414 /// The Child property of FlexContainer.<br />
415 /// The proportion of the free space in the container, the flex item will receive.<br />
416 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.<br />
418 /// <since_tizen> 3 </since_tizen>
423 return (float)GetValue(FlexProperty);
427 SetValue(FlexProperty, value);
428 NotifyPropertyChanged();
433 /// The Child property of FlexContainer.<br />
434 /// The alignment of the flex item along the cross axis, which, if set, overides the default alignment for all items in the container.<br />
436 /// <since_tizen> 3 </since_tizen>
441 return (int)GetValue(AlignSelfProperty);
445 SetValue(AlignSelfProperty, value);
446 NotifyPropertyChanged();
451 /// The Child property of FlexContainer.<br />
452 /// The space around the flex item.<br />
455 /// The property cascade chaining set is possible. For example, this (view.FlexMargin.X = 0.1f;) is possible.
457 /// <since_tizen> 3 </since_tizen>
458 public Vector4 FlexMargin
462 Vector4 temp = (Vector4)GetValue(FlexMarginProperty);
463 return new Vector4(OnFlexMarginChanged, temp.X, temp.Y, temp.Z, temp.W);
467 SetValue(FlexMarginProperty, value);
468 NotifyPropertyChanged();
473 /// The top-left cell this child occupies, if not set, the first available cell is used.
476 /// The property cascade chaining set is possible. For example, this (view.CellIndex.X = 0.1f;) is possible.
478 /// <since_tizen> 3 </since_tizen>
479 public Vector2 CellIndex
483 Vector2 temp = (Vector2)GetValue(CellIndexProperty);
484 return new Vector2(OnCellIndexChanged, temp.X, temp.Y);
488 SetValue(CellIndexProperty, value);
489 NotifyPropertyChanged();
494 /// The number of rows this child occupies, if not set, the default value is 1.
496 /// <since_tizen> 3 </since_tizen>
501 return (float)GetValue(RowSpanProperty);
505 SetValue(RowSpanProperty, value);
506 NotifyPropertyChanged();
511 /// The number of columns this child occupies, if not set, the default value is 1.
513 /// <since_tizen> 3 </since_tizen>
514 public float ColumnSpan
518 return (float)GetValue(ColumnSpanProperty);
522 SetValue(ColumnSpanProperty, value);
523 NotifyPropertyChanged();
528 /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
530 /// <since_tizen> 3 </since_tizen>
531 public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
535 return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty);
539 SetValue(CellHorizontalAlignmentProperty, value);
540 NotifyPropertyChanged();
545 /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
547 /// <since_tizen> 3 </since_tizen>
548 public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
552 return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty);
556 SetValue(CellVerticalAlignmentProperty, value);
557 NotifyPropertyChanged();
562 /// The left focusable view.<br />
563 /// This will return null if not set.<br />
564 /// This will also return null if the specified left focusable view is not on a window.<br />
566 /// <since_tizen> 3 </since_tizen>
567 public View LeftFocusableView
569 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
572 return (View)GetValue(LeftFocusableViewProperty);
576 SetValue(LeftFocusableViewProperty, value);
577 NotifyPropertyChanged();
582 /// The right focusable view.<br />
583 /// This will return null if not set.<br />
584 /// This will also return null if the specified right focusable view is not on a window.<br />
586 /// <since_tizen> 3 </since_tizen>
587 public View RightFocusableView
589 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
592 return (View)GetValue(RightFocusableViewProperty);
596 SetValue(RightFocusableViewProperty, value);
597 NotifyPropertyChanged();
602 /// The up focusable view.<br />
603 /// This will return null if not set.<br />
604 /// This will also return null if the specified up focusable view is not on a window.<br />
606 /// <since_tizen> 3 </since_tizen>
607 public View UpFocusableView
609 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
612 return (View)GetValue(UpFocusableViewProperty);
616 SetValue(UpFocusableViewProperty, value);
617 NotifyPropertyChanged();
622 /// The down focusable view.<br />
623 /// This will return null if not set.<br />
624 /// This will also return null if the specified down focusable view is not on a window.<br />
626 /// <since_tizen> 3 </since_tizen>
627 public View DownFocusableView
629 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
632 return (View)GetValue(DownFocusableViewProperty);
636 SetValue(DownFocusableViewProperty, value);
637 NotifyPropertyChanged();
642 /// Whether the view should be focusable by keyboard navigation.
644 /// <since_tizen> 3 </since_tizen>
645 public bool Focusable
649 SetValue(FocusableProperty, value);
650 NotifyPropertyChanged();
654 return (bool)GetValue(FocusableProperty);
659 /// Retrieves the position of the view.<br />
660 /// The coordinates are relative to the view's parent.<br />
662 /// <since_tizen> 3 </since_tizen>
663 public Position CurrentPosition
667 return GetCurrentPosition();
672 /// Sets the size of a view for the width and the height.<br />
673 /// Geometry can be scaled to fit within this area.<br />
674 /// This does not interfere with the view's scale factor.<br />
675 /// The views default depth is the minimum of width and height.<br />
678 /// This NUI object (Size2D) typed property can be configured by multiple cascade setting. <br />
679 /// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ). <br />
681 /// <since_tizen> 3 </since_tizen>
686 Size2D temp = (Size2D)GetValue(Size2DProperty);
687 return new Size2D(OnSize2DChanged, temp.Width, temp.Height);
691 sizeSetExplicitly = value; // Store size set by API, will be used in place of NaturalSize if not set.
692 SetValue(Size2DProperty, value);
693 // Set Specification so when layouts measure this View it matches the value set here.
694 // All Views are currently Layouts.
695 MeasureSpecificationWidth = new MeasureSpecification(new LayoutLength(value.Width), MeasureSpecification.ModeType.Exactly);
696 MeasureSpecificationHeight = new MeasureSpecification(new LayoutLength(value.Height), MeasureSpecification.ModeType.Exactly);
697 _widthPolicy = value.Width;
698 _heightPolicy = value.Height;
699 _layout?.RequestLayout();
700 NotifyPropertyChanged();
705 /// Retrieves the size of the view.<br />
706 /// The coordinates are relative to the view's parent.<br />
708 /// <since_tizen> 3 </since_tizen>
709 public Size2D CurrentSize
713 return GetCurrentSize();
718 /// Retrieves and sets the view's opacity.<br />
720 /// <since_tizen> 3 </since_tizen>
725 return (float)GetValue(OpacityProperty);
729 SetValue(OpacityProperty, value);
730 NotifyPropertyChanged();
735 /// Sets the position of the view for X and Y.<br />
736 /// By default, sets the position vector between the parent origin and the pivot point (default).<br />
737 /// If the position inheritance is disabled, sets the world position.<br />
740 /// This NUI object (Position2D) typed property can be configured by multiple cascade setting. <br />
741 /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ). <br />
743 /// <since_tizen> 3 </since_tizen>
744 public Position2D Position2D
748 Position2D temp = (Position2D)GetValue(Position2DProperty);
749 return new Position2D(OnPosition2DChanged, temp.X, temp.Y);
753 SetValue(Position2DProperty, value);
754 NotifyPropertyChanged();
759 /// Retrieves the screen postion of the view.<br />
761 /// <since_tizen> 3 </since_tizen>
762 public Vector2 ScreenPosition
766 Vector2 temp = new Vector2(0.0f, 0.0f);
767 GetProperty(View.Property.SCREEN_POSITION).Get(temp);
773 /// Determines whether the pivot point should be used to determine the position of the view.
774 /// This is true by default.
776 /// <remarks>If false, then the top-left of the view is used for the position.
777 /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position.
779 /// <since_tizen> 3 </since_tizen>
780 public bool PositionUsesPivotPoint
784 return (bool)GetValue(PositionUsesPivotPointProperty);
788 SetValue(PositionUsesPivotPointProperty, value);
789 NotifyPropertyChanged();
794 /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead!
796 /// <since_tizen> 3 </since_tizen>
797 [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " +
799 "View view = new View(); " +
800 "view.PivotPoint = PivotPoint.Center; " +
801 "view.PositionUsesPivotPoint = true;" +
802 " Deprecated in API5: Will be removed in API8")]
803 [EditorBrowsable(EditorBrowsableState.Never)]
804 public bool PositionUsesAnchorPoint
809 GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp);
814 SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
815 NotifyPropertyChanged();
820 /// Queries whether the view is connected to the stage.<br />
821 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
823 /// <since_tizen> 3 </since_tizen>
824 public bool IsOnWindow
833 /// Gets the depth in the hierarchy for the view.
835 /// <since_tizen> 3 </since_tizen>
836 public int HierarchyDepth
840 return GetHierarchyDepth();
845 /// Sets the sibling order of the view so the depth position can be defined within the same parent.
848 /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0.
849 /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order.
850 /// The values set by this property will likely change.
852 /// <since_tizen> 3 </since_tizen>
853 public int SiblingOrder
857 return (int)GetValue(SiblingOrderProperty);
861 SetValue(SiblingOrderProperty, value);
862 NotifyPropertyChanged();
867 /// Returns the natural size of the view.
870 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
872 /// <since_tizen> 5 </since_tizen>
873 public Vector3 NaturalSize
877 Vector3 ret = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true);
878 if (NDalicPINVOKE.SWIGPendingException.Pending)
879 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
885 /// Returns the natural size (Size2D) of the view.
888 /// Deriving classes stipulate the natural size and by default a view has a zero natural size.
890 /// <since_tizen> 4 </since_tizen>
891 public Size2D NaturalSize2D
895 Vector3 temp = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true);
896 if (NDalicPINVOKE.SWIGPendingException.Pending)
897 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
899 return new Size2D((int)temp.Width, (int)temp.Height);
904 /// Gets or sets the origin of a view within its parent's area.<br />
905 /// 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 />
906 /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).<br />
907 /// A view's position is the distance between this origin and the view's anchor-point.<br />
909 /// <pre>The view has been initialized.</pre>
910 /// <since_tizen> 3 </since_tizen>
911 public Position ParentOrigin
915 Position tmp = (Position)GetValue(ParentOriginProperty);
916 return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z);
920 SetValue(ParentOriginProperty, value);
921 NotifyPropertyChanged();
926 /// Gets or sets the anchor-point of a view.<br />
927 /// 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 />
928 /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).<br />
929 /// A view position is the distance between its parent-origin and this anchor-point.<br />
930 /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.<br />
931 /// <pre>The view has been initialized.</pre>
934 /// The property cascade chaining set is possible. For example, this (view.PivotPoint.X = 0.1f;) is possible.
936 /// <since_tizen> 3 </since_tizen>
937 public Position PivotPoint
941 Position tmp = (Position)GetValue(PivotPointProperty);
942 return new Position(OnPivotPointChanged, tmp.X, tmp.Y, tmp.Z);
946 SetValue(PivotPointProperty, value);
947 NotifyPropertyChanged();
952 /// Gets or sets the size width of the view.
956 /// Animatable - This property can be animated using <c>Animation</c> class.
959 /// <since_tizen> 3 </since_tizen>
960 public float SizeWidth
964 return (float)GetValue(SizeWidthProperty);
968 SetValue(SizeWidthProperty, value);
969 WidthSpecification = (int)Math.Ceiling(value);
970 NotifyPropertyChanged();
975 /// Gets or sets the size height of the view.
979 /// Animatable - This property can be animated using <c>Animation</c> class.
982 /// <since_tizen> 3 </since_tizen>
983 public float SizeHeight
987 return (float)GetValue(SizeHeightProperty);
991 SetValue(SizeHeightProperty, value);
992 HeightSpecification = (int)Math.Ceiling(value);
993 NotifyPropertyChanged();
998 /// Gets or sets the position of the view.<br />
999 /// By default, sets the position vector between the parent origin and pivot point (default).<br />
1000 /// If the position inheritance is disabled, sets the world position.<br />
1004 /// Animatable - This property can be animated using <c>Animation</c> class.
1006 /// The property cascade chaining set is possible. For example, this (view.Position.X = 1.0f;) is possible.
1008 /// <since_tizen> 3 </since_tizen>
1009 public Position Position
1013 Position tmp = (Position)GetValue(PositionProperty);
1014 return new Position(OnPositionChanged, tmp.X, tmp.Y, tmp.Z);
1018 SetValue(PositionProperty, value);
1019 NotifyPropertyChanged();
1024 /// Gets or sets the position X of the view.
1028 /// Animatable - This property can be animated using <c>Animation</c> class.
1031 /// <since_tizen> 3 </since_tizen>
1032 public float PositionX
1036 return (float)GetValue(PositionXProperty);
1040 SetValue(PositionXProperty, value);
1041 NotifyPropertyChanged();
1046 /// Gets or sets the position Y of the view.
1050 /// Animatable - This property can be animated using <c>Animation</c> class.
1053 /// <since_tizen> 3 </since_tizen>
1054 public float PositionY
1058 return (float)GetValue(PositionYProperty);
1062 SetValue(PositionYProperty, value);
1063 NotifyPropertyChanged();
1068 /// Gets or sets the position Z of the view.
1072 /// Animatable - This property can be animated using <c>Animation</c> class.
1075 /// <since_tizen> 3 </since_tizen>
1076 public float PositionZ
1080 return (float)GetValue(PositionZProperty);
1084 SetValue(PositionZProperty, value);
1085 NotifyPropertyChanged();
1090 /// Gets or sets the world position of the view.
1092 /// <since_tizen> 3 </since_tizen>
1093 public Vector3 WorldPosition
1097 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1098 GetProperty(View.Property.WORLD_POSITION).Get(temp);
1104 /// Gets or sets the orientation of the view.<br />
1105 /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.<br />
1109 /// This is an asynchronous method.
1112 /// Animatable - This property can be animated using <c>Animation</c> class.
1115 /// <since_tizen> 3 </since_tizen>
1116 public Rotation Orientation
1120 return (Rotation)GetValue(OrientationProperty);
1124 SetValue(OrientationProperty, value);
1125 NotifyPropertyChanged();
1130 /// Gets or sets the world orientation of the view.<br />
1132 /// <since_tizen> 3 </since_tizen>
1133 public Rotation WorldOrientation
1137 Rotation temp = new Rotation();
1138 GetProperty(View.Property.WORLD_ORIENTATION).Get(temp);
1144 /// Gets or sets the scale factor applied to the view.<br />
1148 /// Animatable - This property can be animated using <c>Animation</c> class.
1150 /// The property cascade chaining set is possible. For example, this (view.Scale.X = 0.1f;) is possible.
1152 /// <since_tizen> 3 </since_tizen>
1153 public Vector3 Scale
1157 Vector3 temp = (Vector3)GetValue(ScaleProperty);
1158 return new Vector3(OnScaleChanged, temp.X, temp.Y, temp.Z);
1162 SetValue(ScaleProperty, value);
1163 NotifyPropertyChanged();
1168 /// Gets or sets the scale X factor applied to the view.
1172 /// Animatable - This property can be animated using <c>Animation</c> class.
1175 /// <since_tizen> 3 </since_tizen>
1180 return (float)GetValue(ScaleXProperty);
1184 SetValue(ScaleXProperty, value);
1185 NotifyPropertyChanged();
1190 /// Gets or sets the scale Y factor applied to the view.
1194 /// Animatable - This property can be animated using <c>Animation</c> class.
1197 /// <since_tizen> 3 </since_tizen>
1202 return (float)GetValue(ScaleYProperty);
1206 SetValue(ScaleYProperty, value);
1207 NotifyPropertyChanged();
1212 /// Gets or sets the scale Z factor applied to the view.
1216 /// Animatable - This property can be animated using <c>Animation</c> class.
1219 /// <since_tizen> 3 </since_tizen>
1224 return (float)GetValue(ScaleZProperty);
1228 SetValue(ScaleZProperty, value);
1229 NotifyPropertyChanged();
1234 /// Gets the world scale of the view.
1236 /// <since_tizen> 3 </since_tizen>
1237 public Vector3 WorldScale
1241 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
1242 GetProperty(View.Property.WORLD_SCALE).Get(temp);
1248 /// Retrieves the visibility flag of the view.
1252 /// If the view is not visible, then the view and its children will not be rendered.
1253 /// 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.
1256 /// Animatable - This property can be animated using <c>Animation</c> class.
1259 /// <since_tizen> 3 </since_tizen>
1260 public bool Visibility
1265 GetProperty(View.Property.VISIBLE).Get(out temp);
1271 /// Gets the view's world color.
1273 /// <since_tizen> 3 </since_tizen>
1274 public Vector4 WorldColor
1278 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1279 GetProperty(View.Property.WORLD_COLOR).Get(temp);
1285 /// Gets or sets the view's name.
1287 /// <since_tizen> 3 </since_tizen>
1292 return (string)GetValue(NameProperty);
1296 SetValue(NameProperty, value);
1297 NotifyPropertyChanged();
1302 /// Get the number of children held by the view.
1304 /// <since_tizen> 3 </since_tizen>
1305 public new uint ChildCount
1309 return GetChildCount();
1314 /// Gets the view's ID.
1317 /// <since_tizen> 3 </since_tizen>
1327 /// Gets or sets the status of whether the view should emit touch or hover signals.
1329 /// <since_tizen> 3 </since_tizen>
1330 public bool Sensitive
1334 return (bool)GetValue(SensitiveProperty);
1338 SetValue(SensitiveProperty, value);
1339 NotifyPropertyChanged();
1344 /// 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.
1346 /// <since_tizen> 3 </since_tizen>
1347 public bool LeaveRequired
1351 return (bool)GetValue(LeaveRequiredProperty);
1355 SetValue(LeaveRequiredProperty, value);
1356 NotifyPropertyChanged();
1361 /// Gets or sets the status of whether a child view inherits it's parent's orientation.
1363 /// <since_tizen> 3 </since_tizen>
1364 public bool InheritOrientation
1368 return (bool)GetValue(InheritOrientationProperty);
1372 SetValue(InheritOrientationProperty, value);
1373 NotifyPropertyChanged();
1378 /// Gets or sets the status of whether a child view inherits it's parent's scale.
1380 /// <since_tizen> 3 </since_tizen>
1381 public bool InheritScale
1385 return (bool)GetValue(InheritScaleProperty);
1389 SetValue(InheritScaleProperty, value);
1390 NotifyPropertyChanged();
1395 /// Gets or sets the status of how the view and its children should be drawn.<br />
1396 /// Not all views are renderable, but DrawMode can be inherited from any view.<br />
1397 /// 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 />
1398 /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.<br />
1399 /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.<br />
1400 /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.<br />
1402 /// <since_tizen> 3 </since_tizen>
1403 public DrawModeType DrawMode
1407 return (DrawModeType)GetValue(DrawModeProperty);
1411 SetValue(DrawModeProperty, value);
1412 NotifyPropertyChanged();
1417 /// Gets or sets the relative to parent size factor of the view.<br />
1418 /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.<br />
1419 /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
1422 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
1424 /// <since_tizen> 3 </since_tizen>
1425 public Vector3 SizeModeFactor
1429 Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty);
1430 return new Vector3(OnSizeModeFactorChanged, temp.X, temp.Y, temp.Z);
1434 SetValue(SizeModeFactorProperty, value);
1435 NotifyPropertyChanged();
1440 /// Gets or sets the width resize policy to be used.
1442 /// <since_tizen> 3 </since_tizen>
1443 public ResizePolicyType WidthResizePolicy
1447 return (ResizePolicyType)GetValue(WidthResizePolicyProperty);
1451 SetValue(WidthResizePolicyProperty, value);
1452 // Match ResizePolicy to new Layouting.
1453 // Parent relative policies can not be mapped at this point as parent size unknown.
1456 case ResizePolicyType.UseNaturalSize:
1458 WidthSpecification = LayoutParamPolicies.WrapContent;
1461 case ResizePolicyType.FillToParent:
1463 WidthSpecification = LayoutParamPolicies.MatchParent;
1466 case ResizePolicyType.FitToChildren:
1468 WidthSpecification = LayoutParamPolicies.WrapContent;
1474 NotifyPropertyChanged();
1479 /// Gets or sets the height resize policy to be used.
1481 /// <since_tizen> 3 </since_tizen>
1482 public ResizePolicyType HeightResizePolicy
1486 return (ResizePolicyType)GetValue(HeightResizePolicyProperty);
1490 SetValue(HeightResizePolicyProperty, value);
1491 // Match ResizePolicy to new Layouting.
1492 // Parent relative policies can not be mapped at this point as parent size unknown.
1495 case ResizePolicyType.UseNaturalSize:
1497 HeightSpecification = LayoutParamPolicies.WrapContent;
1500 case ResizePolicyType.FillToParent:
1502 HeightSpecification = LayoutParamPolicies.MatchParent;
1505 case ResizePolicyType.FitToChildren:
1507 HeightSpecification = LayoutParamPolicies.WrapContent;
1513 NotifyPropertyChanged();
1518 /// Gets or sets the policy to use when setting size with size negotiation.<br />
1519 /// Defaults to SizeScalePolicyType.UseSizeSet.<br />
1521 /// <since_tizen> 3 </since_tizen>
1522 public SizeScalePolicyType SizeScalePolicy
1526 return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty);
1530 SetValue(SizeScalePolicyProperty, value);
1531 NotifyPropertyChanged();
1536 /// Gets or sets the status of whether the width size is dependent on the height size.
1538 /// <since_tizen> 3 </since_tizen>
1539 public bool WidthForHeight
1543 return (bool)GetValue(WidthForHeightProperty);
1547 SetValue(WidthForHeightProperty, value);
1548 NotifyPropertyChanged();
1553 /// Gets or sets the status of whether the height size is dependent on the width size.
1555 /// <since_tizen> 3 </since_tizen>
1556 public bool HeightForWidth
1560 return (bool)GetValue(HeightForWidthProperty);
1564 SetValue(HeightForWidthProperty, value);
1565 NotifyPropertyChanged();
1570 /// Gets or sets the padding for use in layout.
1573 /// The property cascade chaining set is possible. For example, this (view.Padding.X = 0.1f;) is possible.
1575 /// <since_tizen> 5 </since_tizen>
1576 public Extents Padding
1580 // If View has a Layout then padding in stored in the base Layout class
1583 return Layout.Padding;
1587 Extents temp = (Extents)GetValue(PaddingProperty);
1588 return new Extents(OnPaddingChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1590 // Two return points to prevent creating a zeroed Extent native object before assignment
1594 Extents padding = value;
1597 // Layout set so store Padding in LayoutItem instead of in View.
1598 // If View stores the Padding value then Legacy Size Negotiation will overwrite
1599 // the position and sizes measure in the Layouting.
1600 Layout.Padding = value;
1601 // If Layout is a LayoutItem then it could be a View that handles it's own padding.
1602 // Let the View keeps it's padding. Still store Padding in Layout to reduce code paths.
1603 if( Layout.GetType() != typeof(LayoutItem)) // If a Layout container of some kind.
1605 padding = new Extents(0,0,0,0); // Reset value stored in View.
1607 _layout?.RequestLayout();
1609 SetValue(PaddingProperty, padding);
1610 NotifyPropertyChanged();
1611 _layout?.RequestLayout();
1616 /// Gets or sets the minimum size the view can be assigned in size negotiation.
1619 /// The property cascade chaining set is possible. For example, this (view.MinimumSize.Width = 1;) is possible.
1621 /// <since_tizen> 3 </since_tizen>
1622 public Size2D MinimumSize
1626 Size2D tmp = (Size2D)GetValue(MinimumSizeProperty);
1627 return new Size2D(OnMinimumSizeChanged, tmp.Width, tmp.Height);
1631 if (_layout != null)
1633 // Note: it only works if minimum size is >= than natural size.
1634 // To force the size it should be done through the width&height spec or Size2D.
1635 _layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width);
1636 _layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height);
1637 _layout.RequestLayout();
1639 SetValue(MinimumSizeProperty, value);
1640 NotifyPropertyChanged();
1645 /// Gets or sets the maximum size the view can be assigned in size negotiation.
1648 /// The property cascade chaining set is possible. For example, this (view.MaximumSize.Width = 1;) is possible.
1650 /// <since_tizen> 3 </since_tizen>
1651 public Size2D MaximumSize
1655 Size2D tmp = (Size2D)GetValue(MaximumSizeProperty);
1656 return new Size2D(OnMaximumSizeChanged, tmp.Width, tmp.Height);
1660 // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout.
1661 // MATCH_PARENT spec + parent container size can be used to limit
1662 if (_layout != null)
1664 // Note: it only works if minimum size is >= than natural size.
1665 // To force the size it should be done through the width&height spec or Size2D.
1666 _layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Width);
1667 _layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Height);
1668 _layout.RequestLayout();
1670 SetValue(MaximumSizeProperty, value);
1671 NotifyPropertyChanged();
1676 /// Gets or sets whether a child view inherits it's parent's position.<br />
1677 /// Default is to inherit.<br />
1678 /// 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 />
1680 /// <since_tizen> 3 </since_tizen>
1681 public bool InheritPosition
1685 return (bool)GetValue(InheritPositionProperty);
1689 SetValue(InheritPositionProperty, value);
1690 NotifyPropertyChanged();
1695 /// Gets or sets the clipping behavior (mode) of it's children.
1697 /// <since_tizen> 3 </since_tizen>
1698 public ClippingModeType ClippingMode
1702 return (ClippingModeType)GetValue(ClippingModeProperty);
1706 SetValue(ClippingModeProperty, value);
1707 NotifyPropertyChanged();
1712 /// Gets the number of renderers held by the view.
1714 /// <since_tizen> 3 </since_tizen>
1715 public uint RendererCount
1719 return GetRendererCount();
1724 /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
1727 /// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
1729 /// <since_tizen> 3 </since_tizen>
1730 [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
1732 "View view = new View(); " +
1733 "view.PivotPoint = PivotPoint.Center; " +
1734 "view.PositionUsesPivotPoint = true;")]
1735 [EditorBrowsable(EditorBrowsableState.Never)]
1736 public Position AnchorPoint
1740 Position temp = new Position(0.0f, 0.0f, 0.0f);
1741 GetProperty(View.Property.ANCHOR_POINT).Get(temp);
1742 return new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
1746 SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value));
1747 NotifyPropertyChanged();
1752 /// Sets the size of a view for the width, the height and the depth.<br />
1753 /// Geometry can be scaled to fit within this area.<br />
1754 /// This does not interfere with the view's scale factor.<br />
1755 /// The views default depth is the minimum of width and height.<br />
1759 /// Animatable - This property can be animated using <c>Animation</c> class.
1761 /// The property cascade chaining set is possible. For example, this (view.Size.Width = 1.0f;) is possible.
1763 /// <since_tizen> 5 </since_tizen>
1768 Size tmp = (Size)GetValue(SizeProperty);
1769 return new Size(OnSizeChanged, tmp.Width, tmp.Height, tmp.Depth);
1773 SetValue(SizeProperty, value);
1774 // Set Specification so when layouts measure this View it matches the value set here.
1775 // All Views are currently Layouts.
1776 WidthSpecification = (int)Math.Ceiling(value.Width);
1777 HeightSpecification = (int)Math.Ceiling(value.Height);
1778 NotifyPropertyChanged();
1783 /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
1785 /// <since_tizen> 3 </since_tizen>
1786 [Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
1788 "Container parent = view.GetParent(); " +
1789 "View view = parent as View;")]
1790 [EditorBrowsable(EditorBrowsableState.Never)]
1791 public new View Parent
1796 IntPtr cPtr = Interop.Actor.Actor_GetParent(swigCPtr);
1797 HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
1798 BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle);
1800 if (basehandle is Layer layer)
1802 ret = new View(Layer.getCPtr(layer).Handle, false);
1803 NUILog.Error("This Parent property is deprecated, shoud do not be used");
1807 ret = basehandle as View;
1810 Interop.BaseHandle.delete_BaseHandle(CPtr);
1811 CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
1813 if (NDalicPINVOKE.SWIGPendingException.Pending)
1814 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
1820 /// Gets/Sets whether inherit parent's the layout Direction.
1822 /// <since_tizen> 4 </since_tizen>
1823 public bool InheritLayoutDirection
1827 return (bool)GetValue(InheritLayoutDirectionProperty);
1831 SetValue(InheritLayoutDirectionProperty, value);
1832 NotifyPropertyChanged();
1837 /// Gets/Sets the layout Direction.
1839 /// <since_tizen> 4 </since_tizen>
1840 public ViewLayoutDirectionType LayoutDirection
1844 return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty);
1848 SetValue(LayoutDirectionProperty, value);
1849 NotifyPropertyChanged();
1850 _layout?.RequestLayout();
1855 /// Gets or sets the Margin for use in layout.
1858 /// Margin property is supported by Layout algorithms and containers.
1859 /// Please Set Layout if you want to use Margin property.
1860 /// The property cascade chaining set is possible. For example, this (view.Margin.X = 0.1f;) is possible.
1862 /// <since_tizen> 4 </since_tizen>
1863 public Extents Margin
1867 // If View has a Layout then margin is stored in Layout.
1870 return Layout.Margin;
1874 // If Layout not set then return margin stored in View.
1875 Extents temp = (Extents)GetValue(MarginProperty);
1876 return new Extents(OnMarginChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
1878 // Two return points to prevent creating a zeroed Extent native object before assignment
1884 // Layout set so store Margin in LayoutItem instead of View.
1885 // If View stores the Margin too then the Legacy Size Negotiation will
1886 // overwrite the position and size values measured in the Layouting.
1887 Layout.Margin = value;
1888 SetValue(MarginProperty, new Extents(0,0,0,0));
1889 _layout?.RequestLayout();
1893 SetValue(MarginProperty, value);
1895 NotifyPropertyChanged();
1896 _layout?.RequestLayout();
1901 /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
1903 /// <since_tizen> 6 </since_tizen>
1904 public int WidthSpecification
1908 return _widthPolicy;
1912 _widthPolicy = value;
1913 if( _oldWidthPolicy != _widthPolicy )
1915 if (_widthPolicy >= 0)
1917 _measureSpecificationWidth = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
1919 if(_heightPolicy>=0) // Policy an exact value
1921 Size2D.Width = _widthPolicy;
1925 // Store _heightPolicy in the Size2D memember as will be reset to 0 by a Size2D callback.
1926 // Size2D height will store the specification value (negative number) this will then be applied to the
1927 // HeightSpecification when the Size2D callback is invoked.
1928 Size2D = new Size2D(_widthPolicy,_heightPolicy);
1931 _layout?.RequestLayout();
1932 _oldWidthPolicy = _widthPolicy;
1938 /// The required policy for this dimension, LayoutParamPolicies enum or exact value.
1940 /// <since_tizen> 6 </since_tizen>
1941 public int HeightSpecification
1945 return _heightPolicy;
1949 _heightPolicy = value;
1950 if( _oldHeightPolicy != _heightPolicy )
1952 if (_heightPolicy >= 0)
1954 _measureSpecificationHeight = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly );
1956 if(_widthPolicy>=0) // Policy an exact value
1958 Size2D.Height = _heightPolicy;
1962 // Store widthPolicy in the Size2D memember as will be reset to 0 by a Size2D callback.
1963 // Size2D height will store the specification value (negative number) this will then be applied to the
1964 // HeightSpecification when the Size2D callback is invoked.
1965 Size2D = new Size2D(_widthPolicy,_heightPolicy);
1969 _layout?.RequestLayout();
1970 _oldHeightPolicy = _heightPolicy;
1976 /// Gets the List of transitions for this View.
1978 /// <since_tizen> 6 </since_tizen>
1979 public Dictionary<TransitionCondition, TransitionList> LayoutTransitions
1983 if (_layoutTransitions == null)
1985 _layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
1987 return _layoutTransitions;
1992 /// Set a layout transitions for this View.
1995 /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View.
1997 /// <since_tizen> 6 </since_tizen>
1998 public LayoutTransition LayoutTransition
2002 if (_layoutTransitions == null)
2004 _layoutTransitions = new Dictionary<TransitionCondition, TransitionList>();
2006 LayoutTransitionsHelper.AddTransitionForCondition(_layoutTransitions,value.Condition,value, true);
2008 AttachTransitionsToChildren(value);
2013 /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
2016 /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
2018 /// <since_tizen> 4 </since_tizen>
2019 [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
2020 [EditorBrowsable(EditorBrowsableState.Never)]
2021 public Extents PaddingEX
2025 Extents temp = new Extents(0, 0, 0, 0);
2026 GetProperty(View.Property.PADDING).Get(temp);
2027 return new Extents(OnPaddingEXChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
2031 SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value));
2032 NotifyPropertyChanged();
2033 _layout?.RequestLayout();
2037 /// <since_tizen> 6 </since_tizen>
2038 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2039 [EditorBrowsable(EditorBrowsableState.Never)]
2040 public Style XamlStyle
2044 return (Style)GetValue(XamlStyleProperty);
2048 SetValue(XamlStyleProperty, value);
2053 /// The Color of View. This is an RGBA value.
2057 /// Animatable - This property can be animated using <c>Animation</c> class.
2059 /// The property cascade chaining set is possible. For example, this (view.Color.X = 0.1f;) is possible.
2061 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2062 [EditorBrowsable(EditorBrowsableState.Never)]
2067 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
2068 GetProperty(Interop.ActorProperty.Actor_Property_COLOR_get()).Get(temp);
2069 return new Color(OnColorChanged, temp.R, temp.G, temp.B, temp.A);
2078 /// Set the layout on this View. Replaces any existing Layout.
2080 /// <since_tizen> 6 </since_tizen>
2081 public LayoutItem Layout
2089 // Do nothing if layout provided is already set on this View.
2090 if (value == _layout)
2095 Log.Info("NUI", "Setting Layout on:" + Name + "\n");
2096 layoutingDisabled = false;
2099 // If new layout being set already has a owner then that owner receives a replacement default layout.
2100 // First check if the layout to be set already has a owner.
2101 if (value?.Owner != null)
2103 // Previous owner of the layout gets a default layout as a replacement.
2104 value.Owner.Layout = new LayoutGroup();
2106 // Copy Margin and Padding to replacement LayoutGroup.
2107 value.Owner.Layout.Margin = value.Margin;
2108 value.Owner.Layout.Padding = value.Padding;
2111 // Copy Margin and Padding to new layout being set or restore padding and margin back to
2112 // View if no replacement. Previously margin and padding values would have been moved from
2113 // the View to the layout.
2114 if (_layout != null ) // Existing layout
2118 // Existing layout being replaced so copy over margin and padding values.
2119 value.Margin = _layout.Margin;
2120 value.Padding = _layout.Padding;
2124 // Layout not being replaced so restore margin and padding to View.
2125 SetValue(MarginProperty, _layout.Margin);
2126 SetValue(PaddingProperty, _layout.Padding);
2127 NotifyPropertyChanged();
2132 // First Layout to be added to the View hence copy
2134 // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View)
2137 if (Margin.Top != 0 || Margin.Bottom !=0 || Margin.Start !=0 || Margin.End != 0)
2139 // If View already has a margin set then store it in Layout instead.
2140 value.Margin = Margin;
2141 SetValue(MarginProperty, new Extents(0,0,0,0));
2142 NotifyPropertyChanged();
2145 if (Padding.Top != 0 || Padding.Bottom !=0 || Padding.Start !=0 || Padding.End != 0)
2147 // If View already has a padding set then store it in Layout instead.
2148 value.Padding = Padding;
2149 SetValue(PaddingProperty, new Extents(0,0,0,0));
2150 NotifyPropertyChanged();
2155 // Remove existing layout from it's parent layout group.
2156 _layout?.Unparent();
2158 // Set layout to this view
2164 /// The weight of the View, used to share available space in a layout with siblings.
2166 /// <since_tizen> 6 </since_tizen>
2176 _layout?.RequestLayout();
2181 /// Whether to load the BackgroundImage synchronously.
2182 /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
2183 /// Note: For Normal Quad images only.
2185 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
2186 [EditorBrowsable(EditorBrowsableState.Never)]
2187 public bool BackgroundImageSynchronosLoading
2191 return _backgroundImageSynchronosLoading;
2195 _backgroundImageSynchronosLoading = value;
2198 Background.Find(Visual.Property.Type)?.Get(out visualType);
2199 if (visualType == (int)Visual.Type.Image)
2201 Background.Find(ImageVisualProperty.URL)?.Get(out bgUrl);
2204 if (bgUrl.Length != 0)
2206 PropertyMap bgMap = this.Background;
2207 bgMap.Add("synchronousLoading", new PropertyValue(_backgroundImageSynchronosLoading));
2213 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2214 [EditorBrowsable(EditorBrowsableState.Never)]
2215 public Vector2 UpdateSizeHint
2219 return (Vector2)GetValue(UpdateSizeHintProperty);
2223 SetValue(UpdateSizeHintProperty, value);
2224 NotifyPropertyChanged();
2228 /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
2229 [EditorBrowsable(EditorBrowsableState.Never)]
2230 public string[] TransitionNames
2234 return transitionNames;
2238 transitionNames = value;
2244 /// Get Style, it is abstract function and must be override.
2246 /// <since_tizen> 6 </since_tizen>
2247 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2248 [EditorBrowsable(EditorBrowsableState.Never)]
2249 protected virtual ViewStyle GetViewStyle()
2251 return new ViewStyle();
2254 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2255 [EditorBrowsable(EditorBrowsableState.Never)]
2256 protected virtual bool OnControlStateChanged(ControlStates currentState)
2258 //If need to apply the state to all child, return true;
2261 internal static readonly BindableProperty BackgroundImageSelectorProperty = BindableProperty.Create("BackgroundImageSelector", typeof(Selector<string>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2263 var view = (View)bindable;
2264 view.backgroundImageSelector.Clone((Selector<string>)newValue);
2266 defaultValueCreator: (bindable) =>
2268 var view = (View)bindable;
2269 return view.backgroundImageSelector;
2271 private TriggerableSelector<string> _backgroundImageSelector;
2272 private TriggerableSelector<string> backgroundImageSelector
2276 if (null == _backgroundImageSelector)
2278 _backgroundImageSelector = new TriggerableSelector<string>(this, BackgroundImageProperty);
2280 return _backgroundImageSelector;
2283 internal static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector<Color>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2285 var view = (View)bindable;
2286 view.backgroundColorSelector.Clone((Selector<Color>)newValue);
2288 defaultValueCreator: (bindable) =>
2290 var view = (View)bindable;
2291 return view.backgroundColorSelector;
2293 private TriggerableSelector<Color> _backgroundColorSelector;
2294 private TriggerableSelector<Color> backgroundColorSelector
2298 if (null == _backgroundColorSelector)
2300 _backgroundColorSelector = new TriggerableSelector<Color>(this, BackgroundColorProperty);
2302 return _backgroundColorSelector;
2305 internal static readonly BindableProperty BackgroundImageBorderSelectorProperty = BindableProperty.Create("BackgroundImageBorderSelector", typeof(Selector<Rectangle>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2307 var view = (View)bindable;
2308 view.backgroundImageBorderSelector.Clone((Selector<Rectangle>)newValue);
2310 defaultValueCreator: (bindable) =>
2312 var view = (View)bindable;
2313 return view.backgroundImageBorderSelector;
2315 private TriggerableSelector<Rectangle> _backgroundImageBorderSelector;
2316 private TriggerableSelector<Rectangle> backgroundImageBorderSelector
2320 if (null == _backgroundImageBorderSelector)
2322 _backgroundImageBorderSelector = new TriggerableSelector<Rectangle>(this, BackgroundImageBorderProperty);
2324 return _backgroundImageBorderSelector;
2327 internal static readonly BindableProperty OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector<float?>), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
2329 var view = (View)bindable;
2330 view.opacitySelector.Clone((Selector<float?>)newValue);
2332 defaultValueCreator: (bindable) =>
2334 var view = (View)bindable;
2335 return view.opacitySelector;
2337 private TriggerableSelector<float?> _opacitySelector;
2338 private TriggerableSelector<float?> opacitySelector
2342 if (null == _opacitySelector)
2344 _opacitySelector = new TriggerableSelector<float?>(this, OpacityProperty);
2346 return _opacitySelector;
2350 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2351 [EditorBrowsable(EditorBrowsableState.Never)]
2352 public virtual void ApplyStyle(ViewStyle viewStyle)
2354 if (null == viewStyle)
2359 if (this.viewStyle == viewStyle)
2364 if (null != this.viewStyle)
2366 simpleBinding.Clear();
2369 this.viewStyle = viewStyle;
2371 Dictionary<string, BindableProperty> bindablePropertyOfView;
2372 Type viewType = GetType();
2374 Dictionary<string, BindableProperty> bindablePropertyOfStyle;
2375 Type styleType = viewStyle.GetType();
2377 BindableProperty.GetBindablePropertysOfType(viewType, out bindablePropertyOfView);
2378 BindableProperty.GetBindablePropertysOfType(styleType, out bindablePropertyOfStyle);
2380 if (null != bindablePropertyOfView && null != bindablePropertyOfStyle)
2382 foreach (KeyValuePair<string, BindableProperty> keyValuePair in bindablePropertyOfStyle)
2384 BindableProperty viewProperty;
2385 bindablePropertyOfView.TryGetValue(keyValuePair.Key, out viewProperty);
2387 if (null != viewProperty)
2389 object value = viewStyle.GetValue(keyValuePair.Value);
2393 SetValue(viewProperty, value);
2396 simpleBinding.Bind(viewStyle, keyValuePair.Value, this, viewProperty, BindingDirection.TwoWay);
2402 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
2403 [EditorBrowsable(EditorBrowsableState.Never)]
2404 private BundledPipe simpleBinding = new BundledPipe();