/*
- * Copyright(c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// <since_tizen> 3 </since_tizen>
public partial class View : Container, IResourcesProvider
{
+ private static HashSet<BindableProperty> positionPropertyGroup = new HashSet<BindableProperty>();
+ private static HashSet<BindableProperty> sizePropertyGroup = new HashSet<BindableProperty>();
+ private static HashSet<BindableProperty> scalePropertyGroup = new HashSet<BindableProperty>();
+ private static bool defaultGrabTouchAfterLeave = false;
+ private static bool defaultAllowOnlyOwnTouch = false;
+
internal BackgroundExtraData backgroundExtraData;
private bool layoutSet = false;
private int widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy
private int heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy
private float weight = 0.0f; // Weighting of child View in a Layout
- private bool backgroundImageSynchronosLoading = false;
+ private bool backgroundImageSynchronousLoading = false;
private bool excludeLayouting = false;
private LayoutTransition layoutTransition;
private TransitionOptions transitionOptions = null;
private ThemeData themeData;
-
- internal class ThemeData
+ private bool isThemeChanged = false;
+
+ // List of constraints
+ private Constraint widthConstraint = null;
+ private Constraint heightConstraint = null;
+
+ private Size2D internalMaximumSize = null;
+ private Size2D internalMinimumSize = null;
+ private Extents internalMargin = null;
+ private Extents internalPadding = null;
+ private Vector3 internalSizeModeFactor = null;
+ private Vector2 internalCellIndex = null;
+ private Color internalBackgroundColor = null;
+ private Color internalColor = null;
+ private Position internalPivotPoint = null;
+ private Position internalPosition = null;
+ private Position2D internalPosition2D = null;
+ private Vector3 internalScale = null;
+ private Size internalSize = null;
+ private Size2D internalSize2D = null;
+ private int layoutCount = 0;
+ private ControlState propagatableControlStates = ControlState.All;
+
+ // List of dispatch Event
+ private PanGestureDetector panGestureDetector = null;
+ private LongPressGestureDetector longGestureDetector = null;
+ private PinchGestureDetector pinchGestureDetector = null;
+ private TapGestureDetector tapGestureDetector = null;
+ private RotationGestureDetector rotationGestureDetector = null;
+ private int configGestureCount = 0;
+ private bool dispatchTouchEvents = true;
+ private bool dispatchGestureEvents = true;
+ private bool dispatchParentGestureEvents = true;
+ private string internalName = string.Empty;
+ private Position internalCurrentParentOrigin = null;
+ private Position internalCurrentAnchorPoint = null;
+ private Vector3 internalTargetSize = null;
+ private Size2D internalCurrentSize = null;
+ private Position internalCurrentPosition = null;
+ private Vector3 internalCurrentWorldPosition = null;
+ private Vector3 internalCurrentScale = null;
+ private Vector3 internalCurrentWorldScale = null;
+ private Vector4 internalCurrentColor = null;
+ private Vector4 internalCurrentWorldColor = null;
+ private Vector2 internalCurrentScreenPosition = null;
+
+ static View()
+ {
+ RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
+ RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
+ RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
+ RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
+
+ RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
+ RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
+ RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
+ RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
+
+ RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
+ RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
+ RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
+ RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
+
+ RegisterAccessibilityDelegate();
+ }
+
+ /// <summary>
+ /// Accessibility mode for controlling View's Accessible implementation.
+ /// It is only relevant when deriving custom controls from View directly,
+ /// as classes derived from CustomView (or any of its subclasses) get the
+ /// Custom mode by default.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public enum ViewAccessibilityMode
{
- public bool controlStatePropagation = false;
- public ViewStyle viewStyle;
- public bool themeChangeSensitive = false;
- public ControlState controlStates = ControlState.Normal;
- public ViewSelectorData selectorData;
+ /// <summary>
+ /// Default accessibility implementation. Overriding View.Accessibility...()
+ /// virtual methods will have no effect.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Default,
+ /// <summary>
+ /// Custom accessibility implementation. Overriding View.Accessibility...()
+ /// will be necessary to provide accessibility support for the View.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ Custom,
}
- static View() { }
+ private static IntPtr NewWithAccessibilityMode(ViewAccessibilityMode accessibilityMode)
+ {
+ switch (accessibilityMode)
+ {
+ case ViewAccessibilityMode.Custom:
+ {
+ return Interop.View.NewCustom();
+ }
+ case ViewAccessibilityMode.Default:
+ default:
+ {
+ return Interop.View.New();
+ }
+ }
+ }
/// <summary>
/// Creates a new instance of a view.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public View() : this(Interop.View.New(), true)
+ public View() : this(ViewAccessibilityMode.Default)
+ {
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public View(ViewAccessibilityMode accessibilityMode) : this(NewWithAccessibilityMode(accessibilityMode), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
onWindowSendEventCallback = SendViewAddedEventToWindow;
- this.OnWindowSignal().Connect(onWindowSendEventCallback);
+ using ViewSignal signal = new ViewSignal(Interop.ActorSignal.ActorOnSceneSignal(SwigCPtr), false);
+ signal?.Connect(onWindowSendEventCallback);
+
+ hitTestResultDataCallback = OnHitTestResult;
+ using TouchDataSignal touchDataSignal = new TouchDataSignal(Interop.ActorSignal.ActorHitTestResultSignal(SwigCPtr), false);
+ touchDataSignal?.Connect(hitTestResultDataCallback);
if (!shown)
{
SetVisible(false);
}
+
+ GrabTouchAfterLeave = defaultGrabTouchAfterLeave;
+ AllowOnlyOwnTouch = defaultAllowOnlyOwnTouch;
}
internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.NewViewInternal(ViewImpl.getCPtr(implementation)), true)
public static bool LayoutingDisabled { get; set; } = true;
/// <summary>
+ /// If set to true, the <see cref="GrabTouchAfterLeave"/> property value is set to true when all Views are created.
+ /// </summary>
+ /// <param name="enable">Sets value of GrabTouchAfterLeave property</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void SetDefaultGrabTouchAfterLeave(bool enable)
+ {
+ defaultGrabTouchAfterLeave = enable;
+ }
+
+ /// <summary>
+ /// If set to true, the <see cref="AllowOnlyOwnTouch"/> property value is set to true when all Views are created.
+ /// </summary>
+ /// <param name="enable">Sets value of AllowOnlyOwnTouch property</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void SetDefaultAllowOnlyOwnTouch(bool enable)
+ {
+ defaultAllowOnlyOwnTouch = enable;
+ }
+
+ /// <summary>
+ /// Deprecate. Do not use this.
/// The style instance applied to this view.
- /// Note that please do not modify the ViewStyle.
+ /// Note that do not modify the ViewStyle.
/// Modifying ViewStyle will affect other views with same ViewStyle.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
ControlStateChangeEventInternal?.Invoke(this, changeInfo);
- if (themeData.controlStatePropagation)
+ if (themeData.ControlStatePropagation)
{
foreach (View child in Children)
{
- child.ControlState = value;
+ ControlState allowed = child.PropagatableControlStates;
+ if (allowed.Contains(ControlState.All))
+ {
+ child.ControlState = value;
+ }
+ else
+ {
+ ControlState newControlState = child.ControlState;
+
+ if (allowed.Contains(ControlState.Normal))
+ {
+ if (value.Contains(ControlState.Normal))
+ {
+ newControlState += ControlState.Normal;
+ }
+ else
+ {
+ newControlState -= ControlState.Normal;
+ }
+ }
+
+ if (allowed.Contains(ControlState.Disabled))
+ {
+ if (value.Contains(ControlState.Disabled))
+ {
+ newControlState += ControlState.Disabled;
+ }
+ else
+ {
+ newControlState -= ControlState.Disabled;
+ }
+ }
+
+ if (allowed.Contains(ControlState.Selected))
+ {
+ if (value.Contains(ControlState.Selected))
+ {
+ newControlState += ControlState.Selected;
+ }
+ else
+ {
+ newControlState -= ControlState.Selected;
+ }
+ }
+
+ if (allowed.Contains(ControlState.Pressed))
+ {
+ if (value.Contains(ControlState.Pressed))
+ {
+ newControlState += ControlState.Pressed;
+ }
+ else
+ {
+ newControlState -= ControlState.Pressed;
+ }
+ }
+
+ if (allowed.Contains(ControlState.Focused))
+ {
+ if (value.Contains(ControlState.Focused))
+ {
+ newControlState += ControlState.Focused;
+ }
+ else
+ {
+ newControlState -= ControlState.Focused;
+ }
+ }
+
+ if (allowed.Contains(ControlState.Other))
+ {
+ if (value.Contains(ControlState.Other))
+ {
+ newControlState += ControlState.Other;
+ }
+ else
+ {
+ newControlState -= ControlState.Other;
+ }
+ }
+
+ if (child.ControlState != newControlState)
+ child.ControlState = newControlState;
+ }
}
}
{
get
{
- return excludeLayouting;
+ return (bool)GetValue(ExcludeLayoutingProperty);
}
set
{
- excludeLayouting = value;
- if (Layout != null && Layout.SetPositionByLayout == value)
- {
- Layout.SetPositionByLayout = !value;
- Layout.RequestLayout();
- }
- }
- }
-
- /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool IsResourcesCreated
- {
- get
- {
- return Application.Current.IsResourcesCreated;
+ SetValue(ExcludeLayoutingProperty, value);
+ NotifyPropertyChanged();
}
}
- /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ResourceDictionary XamlResources
+ private bool InternalExcludeLayouting
{
get
{
- return Application.Current.XamlResources;
+ return excludeLayouting;
}
set
{
- Application.Current.XamlResources = value;
+ excludeLayouting = value;
+ if (Layout != null && Layout.SetPositionByLayout == value)
+ {
+ Layout.SetPositionByLayout = !value;
+ Layout.RequestLayout();
+ }
}
}
/// </summary>
/// <remarks>
/// <para>
- /// The property cascade chaining set is possible. For example, this (view.BackgroundColor.X = 0.1f;) is possible.
+ /// The property cascade chaining set is not recommended.
/// </para>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
/// </code>
/// </para>
/// </remarks>
+ /// <example>
+ /// This way is recommended for setting the property
+ /// <code>
+ /// var view = new View();
+ /// view.BackgroundColor = new Color(0.5f, 0.1f, 0, 1);
+ /// </code>
+ /// This way to set the property is prohibited
+ /// <code>
+ /// view.BackgroundColor.R = 0.5f; //This does not guarantee a proper operation
+ /// </code>
+ /// </example>
/// <since_tizen> 3 </since_tizen>
public Color BackgroundColor
{
get
{
- Color temp = (Color)GetValue(BackgroundColorProperty);
- return new Color(OnBackgroundColorChanged, temp.R, temp.G, temp.B, temp.A);
+ return (Color)GetValue(BackgroundColorProperty);
}
set
{
/// The radius for the rounded corners of the View.
/// This will rounds background and shadow edges.
/// 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).
+ /// Each radius will clamp internally to the half of smaller of the view's width or height.
/// Note that, an image background (or shadow) may not have rounded corners if it uses a Border property.
/// </summary>
/// <remarks>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "CornerRadius", new Vector4(10, 10, 10, 10));
+ /// </code>
/// </para>
/// </remarks>
/// <since_tizen> 9 </since_tizen>
}
}
-
/// <summary>
- /// Whether the CornerRadius property value is relative (percentage [0.0f to 1.0f] of the view size) or absolute (in world units).
+ /// Whether the CornerRadius property value is relative (percentage [0.0f to 0.5f] of the view size) or absolute (in world units).
/// It is absolute by default.
/// When the policy is relative, the corner radius is relative to the smaller of the view's width and height.
/// </summary>
}
/// <summary>
+ /// The width for the borderline of the View.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "BorderlineWidth", 100.0f);
+ /// </code>
+ /// </para>
+ /// Note that, an image background may not have borderline if it uses the Border property.
+ /// </remarks>
+ /// <since_tizen> 9 </since_tizen>
+ public float BorderlineWidth
+ {
+ get
+ {
+ return (float)GetValue(BorderlineWidthProperty);
+ }
+ set
+ {
+ SetValue(BorderlineWidthProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// The color for the borderline of the View.
+ /// It is Color.Black by default.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "BorderlineColor", new Color(r, g, b, a));
+ /// </code>
+ /// </para>
+ /// </remarks>
+ /// <since_tizen> 9 </since_tizen>
+ public Color BorderlineColor
+ {
+ get
+ {
+ return (Color)GetValue(BorderlineColorProperty);
+ }
+ set
+ {
+ SetValue(BorderlineColorProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// The color selector for the borderline of the View.
+ /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
+ /// So this API is internally used only.
+ /// </summary>
+ internal Selector<Color> BorderlineColorSelector
+ {
+ get
+ {
+ return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
+ }
+ set
+ {
+ SetValue(BorderlineColorSelectorProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// The Relative offset for the borderline of the View.
+ /// Recommended range : [-1.0f to 1.0f].
+ /// If -1.0f, draw borderline inside of the View.
+ /// If 1.0f, draw borderline outside of the View.
+ /// If 0.0f, draw borderline half inside and half outside.
+ /// It is 0.0f by default.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "BorderlineOffset", -1.0f);
+ /// </code>
+ /// </para>
+ /// </remarks>
+ /// <since_tizen> 9 </since_tizen>
+ public float BorderlineOffset
+ {
+ get
+ {
+ return (float)GetValue(BorderlineOffsetProperty);
+ }
+ set
+ {
+ SetValue(BorderlineOffsetProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
/// The current state of the view.
/// </summary>
/// <since_tizen> 3 </since_tizen>
{
get
{
+ return GetValue(TooltipTextProperty) as string;
+ }
+ set
+ {
+ SetValue(TooltipTextProperty, value);
+ }
+ }
+
+ private string InternalTooltipText
+ {
+ get
+ {
using (var propertyValue = GetProperty(Property.TOOLTIP))
{
if (propertyValue != null && propertyValue.Get(out string retrivedValue))
/// The top-left cell this child occupies, if not set, the first available cell is used.
/// </summary>
/// <remarks>
- /// The property cascade chaining set is possible. For example, this (view.CellIndex.X = 0.1f;) is possible.
+ /// The property cascade chaining set is not recommended.
/// Also, this property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
/// </remarks>
+ /// <example>
+ /// This way is recommended for setting the property
+ /// <code>
+ /// var view = new View();
+ /// view.CellIndex = new Vector2(1, 3);
+ /// </code>
+ /// This way to set the property is prohibited
+ /// <code>
+ /// view.CellIndex.X = 1; //This does not guarantee a proper operation
+ /// </code>
+ /// </example>
/// <since_tizen> 3 </since_tizen>
public Vector2 CellIndex
{
get
{
- Vector2 temp = (Vector2)GetValue(CellIndexProperty);
- return new Vector2(OnCellIndexChanged, temp.X, temp.Y);
+ return (Vector2)GetValue(CellIndexProperty);
}
set
{
/// The number of rows this child occupies, if not set, the default value is 1.
/// </summary>
/// <remarks>
- /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
+ /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
/// </remarks>
/// <since_tizen> 3 </since_tizen>
public float RowSpan
/// The number of columns this child occupies, if not set, the default value is 1.
/// </summary>
/// <remarks>
- /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
+ /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
/// </remarks>
/// <since_tizen> 3 </since_tizen>
public float ColumnSpan
/// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'.
/// </summary>
/// <remarks>
- /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
+ /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
/// </remarks>
/// <since_tizen> 3 </since_tizen>
public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment
/// The vertical alignment of this child inside the cells, if not set, the default value is 'top'.
/// </summary>
/// <remarks>
- /// This property is for <see cref="TableView"/> class. Please use the property for the child position of <see cref="TableView"/>.
+ /// This property is for <see cref="TableView"/> class. Use the property for the child position of <see cref="TableView"/>.
/// </remarks>
/// <since_tizen> 3 </since_tizen>
public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment
}
/// <summary>
+ /// The clockwise focusable view by rotary wheel.<br />
+ /// This will return null if not set.<br />
+ /// This will also return null if the specified clockwise focusable view is not on a window.<br />
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public View ClockwiseFocusableView
+ {
+ // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
+ get
+ {
+ return (View)GetValue(ClockwiseFocusableViewProperty);
+ }
+ set
+ {
+ SetValue(ClockwiseFocusableViewProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// The counter clockwise focusable view by rotary wheel.<br />
+ /// This will return null if not set.<br />
+ /// This will also return null if the specified counter clockwise focusable view is not on a window.<br />
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public View CounterClockwiseFocusableView
+ {
+ // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
+ get
+ {
+ return (View)GetValue(CounterClockwiseFocusableViewProperty);
+ }
+ set
+ {
+ SetValue(CounterClockwiseFocusableViewProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
/// Whether the view should be focusable by keyboard navigation.
/// </summary>
/// <since_tizen> 3 </since_tizen>
}
/// <summary>
- /// Retrieves the position of the view.<br />
- /// The coordinates are relative to the view's parent.<br />
+ /// Whether the children of this view can be focusable by keyboard navigation. If user sets this to false, the children of this actor view will not be focused.
+ /// Note : Default value is true.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool FocusableChildren
+ {
+ set
+ {
+ SetValue(FocusableChildrenProperty, value);
+ NotifyPropertyChanged();
+ }
+ get
+ {
+ return (bool)GetValue(FocusableChildrenProperty);
+ }
+ }
+
+ /// <summary>
+ /// Whether this view can focus by touch.
+ /// If Focusable is false, FocusableInTouch is disabled.
+ /// If you want to have focus on touch, you need to set both Focusable and FocusableInTouch settings to true.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool FocusableInTouch
+ {
+ set
+ {
+ SetValue(FocusableInTouchProperty, value);
+ NotifyPropertyChanged();
+ }
+ get
+ {
+ return (bool)GetValue(FocusableInTouchProperty);
+ }
+ }
+
+ /// <summary>
+ /// Retrieves the position of the view.
+ /// The coordinates are relative to the view's parent.
/// </summary>
+ /// <remarks>
+ /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
+ /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
+ /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+ /// and users can get the current actual values through them.
+ /// </remarks>
/// <since_tizen> 3 </since_tizen>
public Position CurrentPosition
{
/// The views default depth is the minimum of width and height.<br />
/// </summary>
/// <remarks>
- /// This NUI object (Size2D) typed property can be configured by multiple cascade setting. <br />
- /// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ). <br />
+ /// The property cascade chaining set is not recommended.
/// </remarks>
+ /// <example>
+ /// This way is recommended for setting the property
+ /// <code>
+ /// var view = new View();
+ /// view.Size2D = new Size2D(100, 200);
+ /// </code>
+ /// This way to set the property is prohibited
+ /// <code>
+ /// view.Size2D.Width = 100; //This does not guarantee a proper operation
+ /// </code>
+ /// </example>
/// <since_tizen> 3 </since_tizen>
public Size2D Size2D
{
get
{
- Size2D temp = (Size2D)GetValue(Size2DProperty);
- int width = temp.Width;
- int height = temp.Height;
+ var temp = (Size2D)GetValue(Size2DProperty);
if (this.Layout == null)
{
- if (width < 0) { width = 0; }
- if (height < 0) { height = 0; }
+ if (temp.Width < 0) { temp.Width = 0; }
+ if (temp.Height < 0) { temp.Height = 0; }
}
- return new Size2D(OnSize2DChanged, width, height);
+ return temp;
}
set
{
}
/// <summary>
- /// Retrieves the size of the view.<br />
- /// The coordinates are relative to the view's parent.<br />
+ /// Retrieves the size of the view.
+ /// The coordinates are relative to the view's parent.
/// </summary>
+ /// <remarks>
+ /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
+ /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
+ /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+ /// and users can get the current actual values through them.
+ /// </remarks>
/// <since_tizen> 3 </since_tizen>
public Size2D CurrentSize
{
/// <summary>
/// Retrieves and sets the view's opacity.<br />
/// </summary>
+ /// <remarks>
+ /// <para>
+ /// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "Opacity", 0.5f);
+ /// </code>
+ /// </para>
+ /// </remarks>
/// <since_tizen> 3 </since_tizen>
public float Opacity
{
/// If the position inheritance is disabled, sets the world position.<br />
/// </summary>
/// <remarks>
- /// This NUI object (Position2D) typed property can be configured by multiple cascade setting. <br />
- /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ). <br />
- /// </remarks>
+ /// The property cascade chaining set is not recommended.
+ ///</remarks>
+ /// <example>
+ /// This way is recommended for setting the property
+ /// <code>
+ /// var view = new View();
+ /// view.Position2D = new Position2D(100, 200);
+ /// </code>
+ /// This way to set the property is prohibited
+ /// <code>
+ /// view.Position2D.X = 100; //This does not guarantee a proper operation
+ /// </code>
+ /// </example>
/// <since_tizen> 3 </since_tizen>
public Position2D Position2D
{
get
{
- Position2D temp = (Position2D)GetValue(Position2DProperty);
- return new Position2D(OnPosition2DChanged, temp.X, temp.Y);
+ return (Position2D)GetValue(Position2DProperty);
}
set
{
{
get
{
- Vector2 temp = new Vector2(0.0f, 0.0f);
- var pValue = GetProperty(View.Property.ScreenPosition);
- pValue.Get(temp);
- pValue.Dispose();
- return temp;
+ return GetCurrentScreenPosition();
+ }
+ }
+
+ /// <summary>
+ /// Retrieves the screen position and size of the view.<br />
+ /// </summary>
+ /// <remarks>
+ /// The float type Rectangle class is not ready yet.
+ /// Therefore, it transmits data in Vector4 class.
+ /// This type should later be changed to the appropriate data type.
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Vector4 ScreenPositionSize
+ {
+ get
+ {
+ return GetCurrentScreenPositionSize();
}
}
}
/// <summary>
- /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead!
+ /// This has been deprecated in API5 and Will be removed in API8. Use PositionUsesPivotPoint instead.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " +
+ [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PositionUsesPivotPoint instead. " +
"Like: " +
"View view = new View(); " +
"view.PivotPoint = PivotPoint.Center; " +
"view.PositionUsesPivotPoint = true;" +
- " Deprecated in API5: Will be removed in API8")]
+ " This has been deprecated in API5 and will be removed in API8")]
[EditorBrowsable(EditorBrowsableState.Never)]
public bool PositionUsesAnchorPoint
{
get
{
- bool temp = false;
- var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
- pValue.Get(out temp);
- pValue.Dispose();
- return temp;
+ return (bool)GetValue(PositionUsesAnchorPointProperty);
}
set
{
- var temp = new Tizen.NUI.PropertyValue(value);
- SetProperty(View.Property.PositionUsesAnchorPoint, temp);
- temp.Dispose();
+ SetValue(PositionUsesAnchorPointProperty, value);
+ }
+ }
+
+ private bool InternalPositionUsesAnchorPoint
+ {
+ get
+ {
+ return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
+ }
+ set
+ {
+ Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
NotifyPropertyChanged();
}
}
{
SetValue(SiblingOrderProperty, value);
- LayoutGroup layout = Layout as LayoutGroup;
- layout?.ChangeLayoutSiblingOrder(value);
+ Layout?.ChangeLayoutSiblingOrder(value);
NotifyPropertyChanged();
}
{
get
{
- Vector3 ret = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
+ Vector3 ret = GetNaturalSize();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
return ret;
}
{
get
{
- Vector3 temp = new Vector3(Interop.Actor.GetNaturalSize(SwigCPtr), true);
+ Vector3 temp = GetNaturalSize();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
-
- Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
- temp.Dispose();
+ Size2D sz = null;
+ if (temp != null)
+ {
+ sz = new Size2D((int)temp.Width, (int)temp.Height);
+ temp.Dispose();
+ }
return sz;
}
}
/// <pre>The view has been initialized.</pre>
/// </summary>
/// <remarks>
- /// The property cascade chaining set is possible. For example, this (view.PivotPoint.X = 0.1f;) is possible.
- /// </remarks>
+ /// The property cascade chaining set is not recommended.
+ ///</remarks>
+ /// <example>
+ /// This way is recommended for setting the property
+ /// <code>
+ /// var view = new View();
+ /// view.PivotPoint = PivotPoint.Center;
+ /// </code>
+ /// This way to set the property is prohibited
+ /// <code>
+ /// view.PivotPoint.X = 0.5f; //This does not guarantee a proper operation
+ /// </code>
+ /// </example>
/// <since_tizen> 3 </since_tizen>
public Position PivotPoint
{
get
{
- Position tmp = (Position)GetValue(PivotPointProperty);
- return new Position(OnPivotPointChanged, tmp.X, tmp.Y, tmp.Z);
+ return (Position)GetValue(PivotPointProperty);
}
set
{
/// <remarks>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "SizeWidth", 500.0f);
+ /// </code>
/// </para>
/// </remarks>
/// <since_tizen> 3 </since_tizen>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
/// </para>
+ /// <code>
+ /// animation.AnimateTo(view, "SizeHeight", 500.0f);
+ /// </code>
/// </remarks>
/// <since_tizen> 3 </since_tizen>
public float SizeHeight
/// <remarks>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "Position", new Position(50, 0));
+ /// </code>
/// </para>
- /// The property cascade chaining set is possible. For example, this (view.Position.X = 1.0f;) is possible.
+ /// The property cascade chaining set is not recommended.
/// </remarks>
+ /// <example>
+ /// This way is recommended for setting the property
+ /// <code>
+ /// var view = new View();
+ /// view.Position = new Position(100, 200.5f, 0);
+ /// </code>
+ /// This way to set the property is prohibited
+ /// <code>
+ /// view.Position.Y = 200.5f; //This does not guarantee a proper operation
+ /// </code>
+ /// </example>
/// <since_tizen> 3 </since_tizen>
public Position Position
{
get
{
- Position tmp = (Position)GetValue(PositionProperty);
- return new Position(OnPositionChanged, tmp.X, tmp.Y, tmp.Z);
+ return (Position)GetValue(PositionProperty);
}
set
{
/// <remarks>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "PositionX", 50.0f);
+ /// </code>
/// </para>
/// </remarks>
/// <since_tizen> 3 </since_tizen>
/// <remarks>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "PositionY", 50.0f);
+ /// </code>
/// </para>
/// </remarks>
/// <since_tizen> 3 </since_tizen>
/// <remarks>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "PositionZ", 50.0f);
+ /// </code>
/// </para>
/// </remarks>
/// <since_tizen> 3 </since_tizen>
{
get
{
- Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
- var pValue = GetProperty(View.Property.WorldPosition);
- pValue.Get(temp);
- pValue.Dispose();
- return temp;
+ return GetCurrentWorldPosition();
}
}
/// </para>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "Orientation", new Rotation(new Radian((float)Math.PI), Vector3.XAxis));
+ /// </code>
/// </para>
/// </remarks>
/// <since_tizen> 3 </since_tizen>
/// <remarks>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "Scale", new Vector3(1.5f, 1.5f, 1.0f));
+ /// </code>
/// </para>
- /// The property cascade chaining set is possible. For example, this (view.Scale.X = 0.1f;) is possible.
+ /// The property cascade chaining set is not recommended.
/// </remarks>
+ /// <example>
+ /// This way is recommended for setting the property
+ /// <code>
+ /// var view = new View();
+ /// view.Scale = new Vector3(1.5f, 2.0f, 1.0f);
+ /// </code>
+ /// This way to set the property is prohibited
+ /// <code>
+ /// view.Scale.Width = 1.5f; //This does not guarantee a proper operation
+ /// </code>
+ /// </example>
/// <since_tizen> 3 </since_tizen>
public Vector3 Scale
{
get
{
- Vector3 temp = (Vector3)GetValue(ScaleProperty);
- return new Vector3(OnScaleChanged, temp.X, temp.Y, temp.Z);
+ return (Vector3)GetValue(ScaleProperty);
}
set
{
/// <remarks>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "ScaleX", 1.5f);
+ /// </code>
/// </para>
/// </remarks>
/// <since_tizen> 3 </since_tizen>
/// <remarks>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "ScaleY", 1.5f);
+ /// </code>
/// </para>
/// </remarks>
/// <since_tizen> 3 </since_tizen>
/// <remarks>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "ScaleZ", 1.5f);
+ /// </code>
/// </para>
/// </remarks>
/// <since_tizen> 3 </since_tizen>
{
get
{
- Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
- var pValue = GetProperty(View.Property.WorldScale);
- pValue.Get(temp);
- pValue.Dispose();
- return temp;
+ return GetCurrentWorldScale();
}
}
/// </para>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "Visibility", false);
+ /// </code>
/// </para>
/// </remarks>
/// <since_tizen> 3 </since_tizen>
{
get
{
- bool temp = false;
- var pValue = GetProperty(View.Property.VISIBLE);
- pValue.Get(out temp);
- pValue.Dispose();
- return temp;
+ return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
}
}
{
get
{
- Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
- var pValue = GetProperty(View.Property.WorldColor);
- pValue.Get(temp);
- pValue.Dispose();
- return temp;
+ return GetCurrentWorldColor();
}
}
/// <summary>
/// Gets or sets the status of whether the view should emit touch or hover signals.
+ /// If a View is made insensitive, then the View and its children are not hittable.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public bool Sensitive
}
/// <summary>
+ /// Gets or sets the status of whether the view should be enabled user interactions.
+ /// If a View is made disabled, then user interactions including touch, focus, and actiavation is disabled.
+ /// </summary>
+ /// <since_tizen> tizen_next </since_tizen>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool IsEnabled
+ {
+ get
+ {
+ return (bool)GetValue(IsEnabledProperty);
+ }
+ set
+ {
+ SetValue(IsEnabledProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
/// 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.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.<br />
/// </summary>
/// <remarks>
- /// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
+ /// The property cascade chaining set is not recommended.
/// </remarks>
+ /// <example>
+ /// This way is recommended for setting the property
+ /// <code>
+ /// var text = new TextField();
+ /// text.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f);
+ /// </code>
+ /// This way to set the property is prohibited
+ /// <code>
+ /// text.SizeModeFactor.Width = 1.0f; //This does not guarantee a proper operation
+ /// </code>
+ /// </example>
/// <since_tizen> 3 </since_tizen>
public Vector3 SizeModeFactor
{
get
{
- Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty);
- return new Vector3(OnSizeModeFactorChanged, temp.X, temp.Y, temp.Z);
+ return (Vector3)GetValue(SizeModeFactorProperty);
}
set
{
/// Gets or sets the padding for use in layout.
/// </summary>
/// <remarks>
- /// The property cascade chaining set is possible. For example, this (view.Padding.X = 0.1f;) is possible.
+ /// The property cascade chaining set is not recommended.
/// </remarks>
+ /// <example>
+ /// This way is recommended for setting the property
+ /// <code>
+ /// var view = new View();
+ /// view.Padding = new Extents(5, 5, 5, 5);
+ /// </code>
+ /// This way to set the property is prohibited
+ /// <code>
+ /// view.Padding.Start = 5; //This does not guarantee a proper operation
+ /// </code>
+ /// </example>
/// <since_tizen> 5 </since_tizen>
public Extents Padding
{
get
{
- // If View has a Layout then padding in stored in the base Layout class
- if (Layout != null)
- {
- return Layout.Padding;
- }
- else
- {
- Extents temp = (Extents)GetValue(PaddingProperty);
- return new Extents(OnPaddingChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
- }
- // Two return points to prevent creating a zeroed Extent native object before assignment
+ return (Extents)GetValue(PaddingProperty);
}
set
{
- Extents padding = value;
- if (Layout != null)
- {
- // Layout set so store Padding in LayoutItem instead of in View.
- // If View stores the Padding value then Legacy Size Negotiation will overwrite
- // the position and sizes measure in the Layouting.
- Layout.Padding = value;
- // If Layout is a LayoutItem then it could be a View that handles it's own padding.
- // Let the View keeps it's padding. Still store Padding in Layout to reduce code paths.
- if (typeof(LayoutGroup).IsAssignableFrom(Layout.GetType())) // If a Layout container of some kind.
- {
- padding = new Extents(0, 0, 0, 0); // Reset value stored in View.
- }
- }
-
- SetValue(PaddingProperty, padding);
+ SetValue(PaddingProperty, value);
NotifyPropertyChanged();
}
}
/// </summary>
/// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
/// <remarks>
- /// The property cascade chaining set is possible. For example, this (view.MinimumSize.Width = 1;) is possible.
+ /// The property cascade chaining set is not recommended.
/// </remarks>
+ /// <example>
+ /// This way is recommended for setting the property
+ /// <code>
+ /// var view = new View();
+ /// view.MinimumSize = new Size2D(100, 200);
+ /// </code>
+ /// This way to set the property is prohibited
+ /// <code>
+ /// view.MinimumSize.Width = 100; //This does not guarantee a proper operation
+ /// </code>
+ /// </example>
/// <since_tizen> 3 </since_tizen>
public Size2D MinimumSize
{
get
{
- Size2D tmp = (Size2D)GetValue(MinimumSizeProperty);
- return new Size2D(OnMinimumSizeChanged, tmp.Width, tmp.Height);
+ return (Size2D)GetValue(MinimumSizeProperty);
}
set
{
/// <summary>
/// Gets or sets the maximum size the view can be assigned in size negotiation.
/// </summary>
- /// <remarks>
- /// The property cascade chaining set is possible. For example, this (view.MaximumSize.Width = 1;) is possible.
- /// </remarks>
+ /// <example>
+ /// This way is recommended for setting the property
+ /// <code>
+ /// var view = new View();
+ /// view.MaximumSize = new Size2D(100, 200);
+ /// </code>
+ /// This way to set the property is prohibited
+ /// <code>
+ /// view.MaximumSize.Height = 200; //This does not guarantee a proper operation
+ /// </code>
+ /// </example>
/// <since_tizen> 3 </since_tizen>
public Size2D MaximumSize
{
get
{
- Size2D tmp = (Size2D)GetValue(MaximumSizeProperty);
- return new Size2D(OnMaximumSizeChanged, tmp.Width, tmp.Height);
+ return (Size2D)GetValue(MaximumSizeProperty);
}
set
{
}
/// <summary>
- /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead!
+ /// This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead.
/// </summary>
/// <remarks>
/// The property cascade chaining set is possible. For example, this (view.AnchorPoint.X = 0.1f;) is possible.
/// </remarks>
/// <since_tizen> 3 </since_tizen>
- [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " +
+ [Obsolete("This has been deprecated in API5 and will be removed in API8. Use PivotPoint instead. " +
"Like: " +
"View view = new View(); " +
"view.PivotPoint = PivotPoint.Center; " +
{
get
{
- Position temp = new Position(0.0f, 0.0f, 0.0f);
- var pValue = GetProperty(View.Property.AnchorPoint);
- pValue.Get(temp);
- pValue.Dispose();
- Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
- temp.Dispose();
- return ret;
+ return GetValue(AnchorPointProperty) as Position;
}
set
{
- var temp = new Tizen.NUI.PropertyValue(value);
- SetProperty(View.Property.AnchorPoint, temp);
- temp.Dispose();
+ SetValue(AnchorPointProperty, value);
+ }
+ }
+
+ private Position InternalAnchorPoint
+ {
+ get
+ {
+ return GetCurrentAnchorPoint();
+ }
+ set
+ {
+ SetAnchorPoint(value);
NotifyPropertyChanged();
}
}
/// <remarks>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
+ /// <code>
+ /// animation.AnimateTo(view, "Size", new Size(100, 100));
+ /// </code>
/// </para>
- /// The property cascade chaining set is possible. For example, this (view.Size.Width = 1.0f;) is possible.
+ /// The property cascade chaining set is not recommended.
/// </remarks>
+ /// <example>
+ /// This way is recommended for setting the property
+ /// <code>
+ /// var view = new View();
+ /// view.Size = new Size(100.5f, 200, 0);
+ /// </code>
+ /// This way to set the property is prohibited
+ /// <code>
+ /// view.Size.Width = 100.5f; //This does not guarantee a proper operation
+ /// </code>
+ /// </example>
/// <since_tizen> 5 </since_tizen>
public Size Size
{
get
{
- Size tmp = (Size)GetValue(SizeProperty);
- return new Size(OnSizeChanged, tmp.Width, tmp.Height, tmp.Depth);
+ return (Size)GetValue(SizeProperty);
}
set
{
}
/// <summary>
- /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead!
+ /// This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- [Obsolete("Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! " +
+ [Obsolete("This has been deprecated in API5 and will be removed in API8. Use 'Container GetParent() for derived class' instead. " +
"Like: " +
"Container parent = view.GetParent(); " +
"View view = parent as View;")]
/// <remarks>
/// Margin property is supported by Layout algorithms and containers.
/// Please Set Layout if you want to use Margin property.
- /// The property cascade chaining set is possible. For example, this (view.Margin.X = 0.1f;) is possible.
+ /// The property cascade chaining set is not recommended.
/// </remarks>
+ /// <example>
+ /// This way is recommended for setting the property
+ /// <code>
+ /// var view = new View();
+ /// view.Margin = new Extents(10, 5, 15, 20);
+ /// </code>
+ /// This way to set the property is prohibited
+ /// <code>
+ /// view.Margin.Top = 15; //This does not guarantee a proper operation
+ /// </code>
+ /// </example>
/// <since_tizen> 4 </since_tizen>
public Extents Margin
{
get
{
- // If View has a Layout then margin is stored in Layout.
- if (Layout != null)
- {
- return Layout.Margin;
- }
- else
- {
- // If Layout not set then return margin stored in View.
- Extents temp = (Extents)GetValue(MarginProperty);
- return new Extents(OnMarginChanged, temp.Start, temp.End, temp.Top, temp.Bottom);
- }
- // Two return points to prevent creating a zeroed Extent native object before assignment
+ return (Extents)GetValue(MarginProperty);
}
set
{
- if (Layout != null)
- {
- // Layout set so store Margin in LayoutItem instead of View.
- // If View stores the Margin too then the Legacy Size Negotiation will
- // overwrite the position and size values measured in the Layouting.
- Layout.Margin = value;
- SetValue(MarginProperty, new Extents(0, 0, 0, 0));
- layout?.RequestLayout();
- }
- else
- {
- SetValue(MarginProperty, value);
- }
+ SetValue(MarginProperty, value);
NotifyPropertyChanged();
- layout?.RequestLayout();
}
}
/// </code>
/// </example>
/// <since_tizen> 6 </since_tizen>
+ [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
public int WidthSpecification
{
get
{
+ return (int)GetValue(WidthSpecificationProperty);
+ }
+ set
+ {
+ SetValue(WidthSpecificationProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ private int InternalWidthSpecification
+ {
+ get
+ {
return widthPolicy;
}
set
widthPolicy = value;
if (widthPolicy >= 0)
{
- if (heightPolicy >= 0) // Policy an exact value
- {
- // Create Size2D only both _widthPolicy and _heightPolicy are set.
- Size2D = new Size2D(widthPolicy, heightPolicy);
- }
+ SizeWidth = widthPolicy;
}
layout?.RequestLayout();
}
/// </code>
/// </example>
/// <since_tizen> 6 </since_tizen>
+ [Binding.TypeConverter(typeof(IntGraphicsTypeConverter))]
public int HeightSpecification
{
get
{
+ return (int)GetValue(HeightSpecificationProperty);
+ }
+ set
+ {
+ SetValue(HeightSpecificationProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ private int InternalHeightSpecification
+ {
+ get
+ {
return heightPolicy;
}
set
heightPolicy = value;
if (heightPolicy >= 0)
{
- if (widthPolicy >= 0) // Policy an exact value
- {
- // Create Size2D only both _widthPolicy and _heightPolicy are set.
- Size2D = new Size2D(widthPolicy, heightPolicy);
- }
+ SizeHeight = heightPolicy;
}
layout?.RequestLayout();
}
{
get
{
+ return GetValue(LayoutTransitionProperty) as LayoutTransition;
+ }
+ set
+ {
+ SetValue(LayoutTransitionProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ private LayoutTransition InternalLayoutTransition
+ {
+ get
+ {
return layoutTransition;
}
set
}
/// <summary>
- /// Deprecated in API5; Will be removed in API8. Please use Padding instead.
+ /// This has been deprecated in API5 and will be removed in API8. Use Padding instead.
/// </summary>
/// <remarks>
/// The property cascade chaining set is possible. For example, this (view.DecorationBoundingBox.X = 0.1f;) is possible.
/// </remarks>
/// <since_tizen> 4 </since_tizen>
- [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")]
+ [Obsolete("This has been deprecated in API5 and will be removed in API8. Use Padding instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
public Extents PaddingEX
{
get
{
+ return GetValue(PaddingEXProperty) as Extents;
+ }
+ set
+ {
+ SetValue(PaddingEXProperty, value);
+ }
+ }
+
+ private Extents InternalPaddingEX
+ {
+ get
+ {
Extents temp = new Extents(0, 0, 0, 0);
var pValue = GetProperty(View.Property.PADDING);
pValue.Get(temp);
/// <summary>
/// The Color of View. This is an RGBA value.
+ /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
+ /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
+ /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
+ /// Inherient of color value depend on <see cref="ColorMode"/>.
/// </summary>
/// <remarks>
/// <para>
/// Animatable - This property can be animated using <c>Animation</c> class.
/// </para>
- /// The property cascade chaining set is possible. For example, this (view.Color.X = 0.1f;) is possible.
+ /// The property cascade chaining set is not recommended.
/// </remarks>
- /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
+ /// <example>
+ /// This way is recommended for setting the property
+ /// <code>
+ /// var view = new View();
+ /// view.Color = new Color(0.5f, 0.2f, 0.1f, 0.5f);
+ /// </code>
+ /// This way to set the property is prohibited
+ /// <code>
+ /// view.Color.A = 0.5f; //This does not guarantee a proper operation
+ /// </code>
+ /// </example>
[EditorBrowsable(EditorBrowsableState.Never)]
public Color Color
{
get
{
- Color temp = (Color)GetValue(ColorProperty);
- return new Color(OnColorChanged, temp.R, temp.G, temp.B, temp.A);
+ return (Color)GetValue(ColorProperty);
}
set
{
}
/// <summary>
- /// Set the layout on this View. Replaces any existing Layout.
+ /// The Red component of View.Color.
/// </summary>
/// <remarks>
- /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
+ /// <para>
+ /// Animatable - This property can be animated using <c>Animation</c> class.
+ /// </para>
/// </remarks>
- /// <since_tizen> 6 </since_tizen>
- public LayoutItem Layout
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float ColorRed
{
get
{
- return layout;
+ return (float)GetValue(ColorRedProperty);
}
set
{
- // Do nothing if layout provided is already set on this View.
- if (value == layout)
- {
- return;
- }
-
- LayoutingDisabled = false;
- layoutSet = true;
-
- // If new layout being set already has a owner then that owner receives a replacement default layout.
- // First check if the layout to be set already has a owner.
- if (value?.Owner != null)
- {
- // Previous owner of the layout gets a default layout as a replacement.
- value.Owner.Layout = new AbsoluteLayout();
-
- // Copy Margin and Padding to replacement LayoutGroup.
- if (value.Owner.Layout != null)
- {
- value.Owner.Layout.Margin = value.Margin;
- value.Owner.Layout.Padding = value.Padding;
- }
- }
+ SetValue(ColorRedProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
- // Copy Margin and Padding to new layout being set or restore padding and margin back to
- // View if no replacement. Previously margin and padding values would have been moved from
- // the View to the layout.
+ /// <summary>
+ /// The Green component of View.Color.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Animatable - This property can be animated using <c>Animation</c> class.
+ /// </para>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float ColorGreen
+ {
+ get
+ {
+ return (float)GetValue(ColorGreenProperty);
+ }
+ set
+ {
+ SetValue(ColorGreenProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// The Blue component of View.Color.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Animatable - This property can be animated using <c>Animation</c> class.
+ /// </para>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float ColorBlue
+ {
+ get
+ {
+ return (float)GetValue(ColorBlueProperty);
+ }
+ set
+ {
+ SetValue(ColorBlueProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// Set the layout on this View. Replaces any existing Layout.
+ /// </summary>
+ /// <remarks>
+ /// If this Layout is set as null explicitly, it means this View itself and it's child Views will not use Layout anymore.
+ /// </remarks>
+ /// <since_tizen> 6 </since_tizen>
+ public LayoutItem Layout
+ {
+ get
+ {
+ return GetValue(LayoutProperty) as LayoutItem;
+ }
+ set
+ {
+ SetValue(LayoutProperty, value);
+ }
+ }
+
+ private LayoutItem InternalLayout
+ {
+ get
+ {
+ return layout;
+ }
+ set
+ {
+ // Do nothing if layout provided is already set on this View.
+ if (value == layout)
+ {
+ return;
+ }
+
+ LayoutingDisabled = false;
+ layoutSet = true;
+
+ // If new layout being set already has a owner then that owner receives a replacement default layout.
+ // First check if the layout to be set already has a owner.
+ if (value?.Owner != null)
+ {
+ // Previous owner of the layout gets a default layout as a replacement.
+ value.Owner.Layout = new AbsoluteLayout()
+ {
+ // Copy Margin and Padding to replacement LayoutGroup.
+ Margin = value.Margin,
+ Padding = value.Padding,
+ };
+ }
+
+ // Copy Margin and Padding to new layout being set or restore padding and margin back to
+ // View if no replacement. Previously margin and padding values would have been moved from
+ // the View to the layout.
if (layout != null) // Existing layout
{
if (value != null)
// Existing layout being replaced so copy over margin and padding values.
value.Margin = layout.Margin;
value.Padding = layout.Padding;
+ value.SetPositionByLayout = !excludeLayouting;
}
else
{
{
Extents margin = Margin;
Extents padding = Padding;
+ bool setMargin = false;
+ bool setPadding = false;
+
if (margin.Top != 0 || margin.Bottom != 0 || margin.Start != 0 || margin.End != 0)
{
// If View already has a margin set then store it in Layout instead.
value.Margin = margin;
SetValue(MarginProperty, new Extents(0, 0, 0, 0));
- NotifyPropertyChanged();
+ setMargin = true;
}
- if (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0)
+ // The calculation of the native size of the text component requires padding.
+ // Don't overwrite the zero padding.
+ bool isTextLayout = (value is Tizen.NUI.BaseComponents.TextLabel.TextLabelLayout) ||
+ (value is Tizen.NUI.BaseComponents.TextField.TextFieldLayout) ||
+ (value is Tizen.NUI.BaseComponents.TextEditor.TextEditorLayout);
+
+ if (!isTextLayout && (padding.Top != 0 || padding.Bottom != 0 || padding.Start != 0 || padding.End != 0))
{
// If View already has a padding set then store it in Layout instead.
value.Padding = padding;
+ SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
+ setPadding = true;
+ }
- // If Layout is a LayoutItem then it could be a View that handles it's own padding.
- // Let the View keeps it's padding. Still store Padding in Layout to reduce code paths.
- if (typeof(LayoutGroup).IsAssignableFrom(value.GetType()))
- {
- SetValue(PaddingProperty, new Extents(0, 0, 0, 0));
- NotifyPropertyChanged();
- }
+ if (setMargin || setPadding)
+ {
+ NotifyPropertyChanged();
}
+
+ value.SetPositionByLayout = !excludeLayouting;
}
}
// Remove existing layout from it's parent layout group.
layout?.Unparent();
- value.SetPositionByLayout = !excludeLayouting;
-
// Set layout to this view
SetLayout(value);
}
{
get
{
- return backgroundImageSynchronosLoading;
+ return (bool)GetValue(BackgroundImageSynchronosLoadingProperty);
}
set
{
- backgroundImageSynchronosLoading = value;
+ SetValue(BackgroundImageSynchronosLoadingProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
- string bgUrl = null;
- var pValue = Background.Find(ImageVisualProperty.URL);
- pValue?.Get(out bgUrl);
- pValue?.Dispose();
+ private bool InternalBackgroundImageSynchronosLoading
+ {
+ get
+ {
+ return BackgroundImageSynchronousLoading;
+ }
+ set
+ {
+ BackgroundImageSynchronousLoading = value;
+ }
+ }
+
+ /// <summary>
+ /// Whether to load the BackgroundImage synchronously.
+ /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously.
+ /// Note: For Normal Quad images only.
+ /// </summary>
+ /// This will be public opened in tizen_7.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool BackgroundImageSynchronousLoading
+ {
+ get
+ {
+ return (bool)GetValue(BackgroundImageSynchronousLoadingProperty);
+ }
+ set
+ {
+ SetValue(BackgroundImageSynchronousLoadingProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
- if (!string.IsNullOrEmpty(bgUrl))
+ private bool InternalBackgroundImageSynchronousLoading
+ {
+ get
+ {
+ return backgroundImageSynchronousLoading;
+ }
+ set
+ {
+ backgroundImageSynchronousLoading = value;
+
+ if (!string.IsNullOrEmpty(BackgroundImage))
{
PropertyMap bgMap = this.Background;
- var temp = new PropertyValue(backgroundImageSynchronosLoading);
- bgMap.Add("synchronousLoading", temp);
+ var temp = new PropertyValue(backgroundImageSynchronousLoading);
+ bgMap[ImageVisualProperty.SynchronousLoading] = temp;
temp.Dispose();
Background = bgMap;
}
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
- public Vector2 UpdateSizeHint
+ public Vector4 UpdateAreaHint
{
get
{
- return (Vector2)GetValue(UpdateSizeHintProperty);
+ return (Vector4)GetValue(UpdateAreaHintProperty);
}
set
{
- SetValue(UpdateSizeHintProperty, value);
+ SetValue(UpdateAreaHintProperty, value);
NotifyPropertyChanged();
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
public bool EnableControlStatePropagation
{
- get => themeData?.controlStatePropagation ?? false;
+ get
+ {
+ return (bool)GetValue(EnableControlStatePropagationProperty);
+ }
set
{
- if (EnableControlStatePropagation == value) return;
+ SetValue(EnableControlStatePropagationProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ private bool InternalEnableControlStatePropagation
+ {
+ get => themeData?.ControlStatePropagation ?? false;
+ set
+ {
+ if (InternalEnableControlStatePropagation == value) return;
if (themeData == null) themeData = new ThemeData();
- themeData.controlStatePropagation = value;
+ themeData.ControlStatePropagation = value;
foreach (View child in Children)
{
}
/// <summary>
+ /// The ControlStates can propagate from the parent.
+ /// Listed ControlStates will be accepted propagation of the parent ControlState changes
+ /// if parent view EnableControlState is true.
+ /// <see cref="EnableControlState"/>.
+ /// Default is ControlState.All, so every ControlStates will be propagated from the parent.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public ControlState PropagatableControlStates
+ {
+ get
+ {
+ return (ControlState)GetValue(PropagatableControlStatesProperty);
+ }
+ set
+ {
+ SetValue(PropagatableControlStatesProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ private ControlState InternalPropagatableControlStates
+ {
+ get => propagatableControlStates;
+ set => propagatableControlStates = value;
+ }
+
+ /// <summary>
/// By default, it is false in View, true in Control.
/// Note that if the value is true, the View will be a touch receptor.
/// </summary>
{
get
{
- bool temp = false;
- var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
- pValue.Get(out temp);
- pValue.Dispose();
- return temp;
+ return (bool)GetValue(GrabTouchAfterLeaveProperty);
}
set
{
- var temp = new Tizen.NUI.PropertyValue(value);
- SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
- temp.Dispose();
+ SetValue(GrabTouchAfterLeaveProperty, value);
+ }
+ }
+
+ private bool InternalGrabTouchAfterLeave
+ {
+ get
+ {
+ return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
+ }
+ set
+ {
+ Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// Whether the view will only receive own touch.
+ /// </summary>
+ /// <returns>true, if it only receives touches that started from itself.</returns>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool AllowOnlyOwnTouch
+ {
+ get
+ {
+ return (bool)GetValue(AllowOnlyOwnTouchProperty);
+ }
+ set
+ {
+ SetValue(AllowOnlyOwnTouchProperty, value);
+ }
+ }
+
+ private bool InternalAllowOnlyOwnTouch
+ {
+ get
+ {
+ return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
+ }
+ set
+ {
+ Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
NotifyPropertyChanged();
}
}
{
get
{
- int temp = 0;
- var pValue = GetProperty(View.Property.BlendEquation);
- pValue.Get(out temp);
- pValue.Dispose();
- return (BlendEquationType)temp;
+ return (BlendEquationType)GetValue(BlendEquationProperty);
}
set
{
- var temp = new Tizen.NUI.PropertyValue((int)value);
- SetProperty(View.Property.BlendEquation, temp);
- temp.Dispose();
+ SetValue(BlendEquationProperty, value);
+ }
+ }
+
+ private BlendEquationType InternalBlendEquation
+ {
+ get
+ {
+ return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
+ }
+ set
+ {
+ Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
NotifyPropertyChanged();
}
}
/// <summary>
/// If the value is true, the View will change its style as the theme changes.
- /// It is false by default, but turned to true when setting StyleName (by setting property or using specified constructor).
+ /// The default value is false in normal case but it can be true when the NUIApplication is created with <see cref="NUIApplication.ThemeOptions.ThemeChangeSensitive"/>.
/// </summary>
/// <since_tizen> 9 </since_tizen>
public bool ThemeChangeSensitive
[EditorBrowsable(EditorBrowsableState.Never)]
protected virtual void OnThemeChanged(object sender, ThemeChangedEventArgs e)
{
- UpdateStyle();
+ isThemeChanged = true;
+ if (string.IsNullOrEmpty(styleName)) ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(GetType()));
+ else ApplyStyle(ThemeManager.GetUpdateStyleWithoutClone(styleName));
+ isThemeChanged = false;
}
/// <summary>
bindablePropertyOfView.TryGetValue(sourceProperty.PropertyName, out var destinationProperty);
+ // Do not set value again when theme is changed and the value has been set already.
+ if (isThemeChanged && ChangedPropertiesSetExcludingStyle.Contains(destinationProperty))
+ {
+ continue;
+ }
+
if (destinationProperty != null)
{
- SetValue(destinationProperty, sourceValue);
+ InternalSetValue(destinationProperty, sourceValue);
}
}
}
{
get
{
- bool temp = false;
- var pValue = GetProperty(View.Property.Culled);
- pValue.Get(out temp);
- pValue.Dispose();
- return temp;
+ return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
}
}
/// <since_tizen> 9 </since_tizen>
public TransitionOptions TransitionOptions
{
+ get
+ {
+ return GetValue(TransitionOptionsProperty) as TransitionOptions;
+ }
+ set
+ {
+ SetValue(TransitionOptionsProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ private TransitionOptions InternalTransitionOptions
+ {
set
{
transitionOptions = value;
return transitionOptions;
}
}
+
+ /// <summary>
+ /// Gets or sets the status of whether the view should emit key event signals.
+ /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool DispatchKeyEvents
+ {
+ get
+ {
+ return (bool)GetValue(DispatchKeyEventsProperty);
+ }
+ set
+ {
+ SetValue(DispatchKeyEventsProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the status of whether touch events can be dispatched.
+ /// If a View's DispatchTouchEvents is set to false, then it's can not will receive touch and parents will not receive a touch event signal either.
+ /// This works without adding a TouchEvent callback in the View.
+ /// <note>
+ /// If the <see cref="Tizen.NUI.BaseComponents.View.Sensitive"/> is a property that determines whether or not to be hittable, then this property prevents the propagation of the hit touch event.
+ /// </note>
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool DispatchTouchEvents
+ {
+ get
+ {
+ return dispatchTouchEvents;
+ }
+ set
+ {
+ if (dispatchTouchEvents != value)
+ {
+ dispatchTouchEvents = value;
+ if (dispatchTouchEvents == false)
+ {
+ TouchEvent += OnDispatchTouchEvent;
+ }
+ else
+ {
+ TouchEvent -= OnDispatchTouchEvent;
+ }
+ }
+ }
+ }
+
+ private bool OnDispatchTouchEvent(object source, View.TouchEventArgs e)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Gets or sets the status of whether the view should emit Gesture event signals.
+ /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
+ /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool DispatchGestureEvents
+ {
+ get
+ {
+ return dispatchGestureEvents;
+ }
+ set
+ {
+ if (dispatchGestureEvents != value)
+ {
+ dispatchGestureEvents = value;
+ ConfigGestureDetector(dispatchGestureEvents);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the status of whether the view should emit Gesture event signals.
+ /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
+ /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool DispatchParentGestureEvents
+ {
+ get
+ {
+ return dispatchParentGestureEvents;
+ }
+ set
+ {
+ if (dispatchParentGestureEvents != value)
+ {
+ dispatchParentGestureEvents = value;
+ ConfigGestureDetector(dispatchParentGestureEvents);
+ }
+ }
+ }
+
+ private void ConfigGestureDetector(bool dispatch)
+ {
+ if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
+ if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
+ if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
+ if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
+ if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
+
+ if (dispatch == true)
+ {
+ configGestureCount = configGestureCount > 0 ? configGestureCount - 1 : 0;
+ if (configGestureCount == 0)
+ {
+ panGestureDetector.Detach(this);
+ longGestureDetector.Detach(this);
+ pinchGestureDetector.Detach(this);
+ tapGestureDetector.Detach(this);
+ rotationGestureDetector.Detach(this);
+
+ panGestureDetector.Detected -= OnGestureDetected;
+ longGestureDetector.Detected -= OnGestureDetected;
+ pinchGestureDetector.Detected -= OnGestureDetected;
+ tapGestureDetector.Detected -= OnGestureDetected;
+ rotationGestureDetector.Detected -= OnGestureDetected;
+ }
+ }
+ else
+ {
+ if (configGestureCount == 0)
+ {
+ panGestureDetector.Attach(this);
+ longGestureDetector.Attach(this);
+ pinchGestureDetector.Attach(this);
+ tapGestureDetector.Attach(this);
+ rotationGestureDetector.Attach(this);
+
+ panGestureDetector.Detected += OnGestureDetected;
+ longGestureDetector.Detected += OnGestureDetected;
+ pinchGestureDetector.Detected += OnGestureDetected;
+ tapGestureDetector.Detected += OnGestureDetected;
+ rotationGestureDetector.Detected += OnGestureDetected;
+ }
+ configGestureCount++;
+ }
+ }
+
+ private void OnGestureDetected(object source, EventArgs e)
+ {
+ // Does notting. This is to consume the gesture.
+ }
+
+ /// <summary>
+ /// Called when the view is hit through TouchEvent or GestureEvent.
+ /// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
+ /// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
+ /// User can override whether hit or not in HitTest.
+ /// You can get the coordinates relative to tthe top-left of the hit view by touch.GetLocalPosition(0).
+ /// or you can get the coordinates relative to the top-left of the screen by touch.GetScreenPosition(0).
+ /// </summary>
+ // <param name="touch"><see cref="Tizen.NUI.Touch"/>The touch data</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ protected virtual bool HitTest(Touch touch)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// Retrieve the View's current Color.
+ /// </summary>
+ /// <remarks>
+ /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
+ /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
+ /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+ /// and users can get the current actual values through them.
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Color CurrentColor => GetCurrentColor();
+
+ /// <summary>
+ /// Retrieve the current scale factor applied to the View.
+ /// </summary>
+ /// <remarks>
+ /// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
+ /// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
+ /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+ /// and users can get the current actual values through them.
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Vector3 CurrentScale => GetCurrentScale();
+
}
}