From: Jiyun Yang Date: Wed, 3 Mar 2021 02:43:49 +0000 (+0900) Subject: [NUI] Improve performance : Remove rarely used properties from the Style. (#2695) X-Git-Tag: citest_t1~251 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=824aef1fcca819935129b6fadce4f6303a9fb497;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Improve performance : Remove rarely used properties from the Style. (#2695) This can leads application launching time improvement. Signed-off-by: Jiyun Yang Co-authored-by: dongsug-song <35130733+dongsug-song@users.noreply.github.com> --- diff --git a/src/Tizen.NUI.Components/Controls/Slider.cs b/src/Tizen.NUI.Components/Controls/Slider.cs index de51ed3..661a8ae 100755 --- a/src/Tizen.NUI.Components/Controls/Slider.cs +++ b/src/Tizen.NUI.Components/Controls/Slider.cs @@ -574,9 +574,9 @@ namespace Tizen.NUI.Components { if (null != thumbImage) { - thumbImage.Color = value; + thumbImage.BackgroundColor = value; thumbColor = value; - sliderStyle.Thumb.Color = value; + sliderStyle.Thumb.BackgroundColor = value; } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/ImageViewStyle.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/ImageViewStyle.cs index 39395d2..bacd141 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/ImageViewStyle.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/ImageViewStyle.cs @@ -40,30 +40,6 @@ namespace Tizen.NUI.BaseComponents }); /// 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 static readonly BindableProperty PreMultipliedAlphaProperty = BindableProperty.Create(nameof(PreMultipliedAlpha), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var imageViewStyle = (ImageViewStyle)bindable; - imageViewStyle.preMultipliedAlpha = (bool?)newValue; - }, - defaultValueCreator: (bindable) => - { - var imageViewStyle = (ImageViewStyle)bindable; - return imageViewStyle.preMultipliedAlpha; - }); - /// 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 static readonly BindableProperty PixelAreaProperty = BindableProperty.Create(nameof(PixelArea), typeof(RelativeVector4), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var imageViewStyle = (ImageViewStyle)bindable; - imageViewStyle.pixelArea = (RelativeVector4)newValue; - }, - defaultValueCreator: (bindable) => - { - var imageViewStyle = (ImageViewStyle)bindable; - return imageViewStyle.pixelArea; - }); - /// 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 static readonly BindableProperty BorderSelectorProperty = BindableProperty.Create("BorderSelector", typeof(Selector), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var imageViewStyle = (ImageViewStyle)bindable; @@ -111,8 +87,6 @@ namespace Tizen.NUI.BaseComponents return imageViewStyle.orientationCorrection; }); - private bool? preMultipliedAlpha; - private RelativeVector4 pixelArea; private bool? borderOnly; private bool? synchronosLoading; private bool? orientationCorrection; @@ -131,22 +105,6 @@ namespace Tizen.NUI.BaseComponents /// 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 bool? PreMultipliedAlpha - { - get => (bool?)GetValue(PreMultipliedAlphaProperty); - set => SetValue(PreMultipliedAlphaProperty, value); - } - - /// 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 RelativeVector4 PixelArea - { - get => (RelativeVector4)GetValue(PixelAreaProperty); - set => SetValue(PixelAreaProperty, value); - } - - /// 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 bool? BorderOnly { get => (bool?)GetValue(BorderOnlyProperty); diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldStyle.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldStyle.cs index 36934d5..16696e1 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldStyle.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/TextFieldStyle.cs @@ -29,18 +29,6 @@ namespace Tizen.NUI.BaseComponents { /// 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 static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create("TranslatableTextSelector", typeof(Selector), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.translatableTextSelector = ((Selector)newValue)?.Clone(); - }, - defaultValueCreator: (bindable) => - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.translatableTextSelector; - }); - /// 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 static readonly BindableProperty TranslatablePlaceholderTextSelectorProperty = BindableProperty.Create("TranslatablePlaceholderTextSelector", typeof(Selector), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textFieldStyle = (TextFieldStyle)bindable; @@ -53,18 +41,6 @@ namespace Tizen.NUI.BaseComponents }); /// 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 static readonly BindableProperty TextSelectorProperty = BindableProperty.Create("TextSelector", typeof(Selector), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textFieldStyle = (TextFieldStyle)bindable; - textFieldStyle.textSelector = ((Selector)newValue)?.Clone(); - }, - defaultValueCreator: (bindable) => - { - var textFieldStyle = (TextFieldStyle)bindable; - return textFieldStyle.textSelector; - }); - /// 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 static readonly BindableProperty FontFamilySelectorProperty = BindableProperty.Create("FontFamilySelector", typeof(Selector), typeof(TextFieldStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var textFieldStyle = (TextFieldStyle)bindable; @@ -515,9 +491,7 @@ namespace Tizen.NUI.BaseComponents private bool? enableSelection; private bool? ellipsis; private bool? matchSystemLanguageDirection; - private Selector translatableTextSelector; private Selector translatablePlaceholderTextSelector; - private Selector textSelector; private Selector fontFamilySelector; private Selector textColorSelector; private Selector pointSizeSelector; @@ -536,18 +510,6 @@ namespace Tizen.NUI.BaseComponents /// 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 Selector TranslatableText - { - get - { - Selector tmp = (Selector)GetValue(TranslatableTextSelectorProperty); - return (null != tmp) ? tmp : translatableTextSelector = new Selector(); - } - set => SetValue(TranslatableTextSelectorProperty, value); - } - - /// 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 Selector TranslatablePlaceholderText { get @@ -560,18 +522,6 @@ namespace Tizen.NUI.BaseComponents /// 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 Selector Text - { - get - { - Selector tmp = (Selector)GetValue(TextSelectorProperty); - return (null != tmp) ? tmp : textSelector = new Selector(); - } - set => SetValue(TextSelectorProperty, value); - } - - /// 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 string PlaceholderText { get => (string)GetValue(PlaceholderTextProperty); diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs index 99c0768..368d30d 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyle.cs @@ -28,58 +28,30 @@ namespace Tizen.NUI.BaseComponents public partial class ViewStyle : BindableObject, IDisposable { private bool disposed = false; - private string styleName; - private View.States? state; - private View.States? subState; - private float? flex; - private int? alignSelf; - private Vector4 flexMargin; - private Vector2 cellIndex; - private float? rowSpan; - private float? columnSpan; - private HorizontalAlignmentType? cellHorizontalAlignment; - private VerticalAlignmentType? cellVerticalAlignment; - private View leftFocusableView; - private View rightFocusableView; - private View upFocusableView; - private View downFocusableView; private bool? focusable; private bool? positionUsesPivotPoint; - private int? siblingOrder; private Position parentOrigin; private Position pivotPoint; private Position position; private Rotation orientation; - private Vector3 scale; - private string name; - private bool? sensitive; - private bool? leaveRequired; - private bool? inheritOrientation; - private bool? inheritScale; private DrawModeType? drawMode; private Vector3 sizeModeFactor; private ResizePolicyType? widthResizePolicy; private ResizePolicyType? heightResizePolicy; - private SizeScalePolicyType? sizeScalePolicy; private bool? widthForHeight; private bool? heightForWidth; private Extents padding; private Size2D minimumSize; private Size2D maximumSize; - private bool? inheritPosition; private ClippingModeType? clippingMode; private Size size; - private bool? inheritLayoutDirection; - private ViewLayoutDirectionType? layoutDirection; private Extents margin; - private float? weight; - private bool? enableControlState; private bool? themeChangeSensitive; + private float? cornerRadius; private Selector imageShadow; private Selector boxShadow; private Selector backgroundImageSelector; - private Selector cornerRadius; private Selector opacitySelector; private Selector backgroundColorSelector; private Selector backgroundImageBorderSelector; @@ -101,14 +73,6 @@ namespace Tizen.NUI.BaseComponents /// 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 string StyleName - { - get => (string)GetValue(StyleNameProperty); - set => SetValue(StyleNameProperty, value); - } - - /// 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 Selector BackgroundImage { get @@ -121,118 +85,6 @@ namespace Tizen.NUI.BaseComponents /// 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 View.States? State - { - get => (View.States?)GetValue(StateProperty); - set => SetValue(StateProperty, value); - } - - /// 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 View.States? SubState - { - get => (View.States?)GetValue(SubStateProperty); - set => SetValue(SubStateProperty, value); - } - - /// 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 float? Flex - { - get => (float?)GetValue(FlexProperty); - set => SetValue(FlexProperty, value); - } - - /// 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 int? AlignSelf - { - get => (int?)GetValue(AlignSelfProperty); - set => SetValue(AlignSelfProperty, value); - } - - /// 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 Vector4 FlexMargin - { - get => (Vector4)GetValue(FlexMarginProperty); - set => SetValue(FlexMarginProperty, value); - } - - /// 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 CellIndex - { - get => (Vector2)GetValue(CellIndexProperty); - set => SetValue(CellIndexProperty, value); - } - - /// 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 float? RowSpan - { - get => (float?)GetValue(RowSpanProperty); - set => SetValue(RowSpanProperty, value); - } - - /// 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 float? ColumnSpan - { - get => (float?)GetValue(ColumnSpanProperty); - set => SetValue(ColumnSpanProperty, value); - } - - /// 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 HorizontalAlignmentType? CellHorizontalAlignment - { - get => (HorizontalAlignmentType?)GetValue(CellHorizontalAlignmentProperty); - set => SetValue(CellHorizontalAlignmentProperty, value); - } - - /// 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 VerticalAlignmentType? CellVerticalAlignment - { - get => (VerticalAlignmentType?)GetValue(CellVerticalAlignmentProperty); - set => SetValue(CellVerticalAlignmentProperty, value); - } - - /// 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 View LeftFocusableView - { - get => (View)GetValue(LeftFocusableViewProperty); - set => SetValue(LeftFocusableViewProperty, value); - } - - /// 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 View RightFocusableView - { - get => (View)GetValue(RightFocusableViewProperty); - set => SetValue(RightFocusableViewProperty, value); - } - - /// 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 View UpFocusableView - { - get => (View)GetValue(UpFocusableViewProperty); - set => SetValue(UpFocusableViewProperty, value); - } - - /// 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 View DownFocusableView - { - get => (View)GetValue(DownFocusableViewProperty); - set => SetValue(DownFocusableViewProperty, value); - } - - /// 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 bool? Focusable { get => (bool?)GetValue(FocusableProperty); @@ -240,6 +92,7 @@ namespace Tizen.NUI.BaseComponents } /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [Obsolete("Deprecated. Please use Size instead.")] [EditorBrowsable(EditorBrowsableState.Never)] public Size2D Size2D { @@ -260,6 +113,7 @@ namespace Tizen.NUI.BaseComponents } /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [Obsolete("Deprecated. Please use Position instead.")] [EditorBrowsable(EditorBrowsableState.Never)] public Position2D Position2D { @@ -277,14 +131,6 @@ namespace Tizen.NUI.BaseComponents /// 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 int? SiblingOrder - { - get => (int?)GetValue(SiblingOrderProperty); - set => SetValue(SiblingOrderProperty, value); - } - - /// 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 Position ParentOrigin { get => (Position)GetValue(ParentOriginProperty); @@ -341,14 +187,6 @@ namespace Tizen.NUI.BaseComponents /// 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 float? PositionZ - { - get => (float?)GetValue(PositionZProperty); - set => SetValue(PositionZProperty, value); - } - - /// 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 Rotation Orientation { get => (Rotation)GetValue(OrientationProperty); @@ -357,78 +195,6 @@ namespace Tizen.NUI.BaseComponents /// 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 Vector3 Scale - { - get => (Vector3)GetValue(ScaleProperty); - set => SetValue(ScaleProperty, value); - } - - /// 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 float? ScaleX - { - get => (float?)GetValue(ScaleXProperty); - set => SetValue(ScaleXProperty, value); - } - - /// 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 float? ScaleY - { - get => (float?)GetValue(ScaleYProperty); - set => SetValue(ScaleYProperty, value); - } - - /// 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 float? ScaleZ - { - get => (float?)GetValue(ScaleZProperty); - set => SetValue(ScaleZProperty, value); - } - - /// 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 string Name - { - get => (string)GetValue(NameProperty); - set => SetValue(NameProperty, value); - } - - /// 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 bool? Sensitive - { - get => (bool?)GetValue(SensitiveProperty); - set => SetValue(SensitiveProperty, value); - } - - /// 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 bool? LeaveRequired - { - get => (bool?)GetValue(LeaveRequiredProperty); - set => SetValue(LeaveRequiredProperty, value); - } - - /// 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 bool? InheritOrientation - { - get => (bool?)GetValue(InheritOrientationProperty); - set => SetValue(InheritOrientationProperty, value); - } - - /// 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 bool? InheritScale - { - get => (bool?)GetValue(InheritScaleProperty); - set => SetValue(InheritScaleProperty, value); - } - - /// 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 DrawModeType? DrawMode { get => (DrawModeType?)GetValue(DrawModeProperty); @@ -461,14 +227,6 @@ namespace Tizen.NUI.BaseComponents /// 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 SizeScalePolicyType? SizeScalePolicy - { - get => (SizeScalePolicyType?)GetValue(SizeScalePolicyProperty); - set => SetValue(SizeScalePolicyProperty, value); - } - - /// 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 bool? WidthForHeight { get => (bool?)GetValue(WidthForHeightProperty); @@ -487,11 +245,7 @@ namespace Tizen.NUI.BaseComponents [EditorBrowsable(EditorBrowsableState.Never)] public Extents Padding { - get - { - Extents tmp = (Extents)GetValue(PaddingProperty); - return (null != tmp) ? tmp : padding = new Extents(OnPaddingChanged, 0, 0, 0, 0); - } + get => (Extents)GetValue(PaddingProperty) ?? (padding = new Extents()); set => SetValue(PaddingProperty, value); } @@ -513,14 +267,6 @@ namespace Tizen.NUI.BaseComponents /// 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 bool? InheritPosition - { - get => (bool?)GetValue(InheritPositionProperty); - set => SetValue(InheritPositionProperty, value); - } - - /// 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 ClippingModeType? ClippingMode { get => (ClippingModeType?)GetValue(ClippingModeProperty); @@ -531,67 +277,18 @@ namespace Tizen.NUI.BaseComponents [EditorBrowsable(EditorBrowsableState.Never)] public Size Size { - get - { - Size tmp = (Size)GetValue(SizeProperty); - return (null != tmp) ? tmp : size = new Size((float? width, float? height, float? depth) => - { - float targetWidth = 0; - float targetHeight = 0; - float targetDepth = 0; - - if (size != null) - { - targetWidth = size.Width; - targetHeight = size.Height; - targetDepth = size.Depth; - } - if (width != null) { targetWidth = (float)width; } - if (height != null) { targetHeight = (float)height; } - if (depth != null) { targetDepth = (float)depth; } - - Size = new Size(targetWidth, targetHeight, targetDepth); - }, 0, 0, 0); - } + get => (Size)GetValue(SizeProperty); set => SetValue(SizeProperty, value); } /// 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 bool? InheritLayoutDirection - { - get => (bool?)GetValue(InheritLayoutDirectionProperty); - set => SetValue(InheritLayoutDirectionProperty, value); - } - - /// 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 ViewLayoutDirectionType? LayoutDirection - { - get => (ViewLayoutDirectionType?)GetValue(LayoutDirectionProperty); - set => SetValue(LayoutDirectionProperty, value); - } - - /// 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 Extents Margin { - get - { - Extents tmp = (Extents)GetValue(MarginProperty); - return (null != tmp) ? tmp : margin = new Extents(OnMarginChanged, 0, 0, 0, 0); - } + get => (Extents)GetValue(MarginProperty) ?? (margin = new Extents()); set => SetValue(MarginProperty, value); } - /// 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 float? Weight - { - get => (float?)GetValue(WeightProperty); - set => SetValue(WeightProperty, value); - } - /// View BackgroundColor /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] @@ -611,11 +308,7 @@ namespace Tizen.NUI.BaseComponents [EditorBrowsable(EditorBrowsableState.Never)] public Selector Color { - get - { - Selector color = (Selector)GetValue(ColorSelectorProperty); - return (null != color) ? color : colorSelector = new Selector(); - } + get => (Selector)GetValue(ColorSelectorProperty) ?? (colorSelector = new Selector()); set => SetValue(ColorSelectorProperty, value); } @@ -661,9 +354,9 @@ namespace Tizen.NUI.BaseComponents /// The radius for the rounded corners of the View /// [EditorBrowsable(EditorBrowsableState.Never)] - public Selector CornerRadius + public float? CornerRadius { - get => (Selector)GetValue(CornerRadiusProperty); + get => (float?)GetValue(CornerRadiusProperty); set => SetValue(CornerRadiusProperty, value); } @@ -680,16 +373,6 @@ namespace Tizen.NUI.BaseComponents } /// - /// The EnableControlState value of the View. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public bool? EnableControlState - { - get => (bool?)GetValue(EnableControlStateProperty); - set => SetValue(EnableControlStateProperty, value); - } - - /// /// The ThemeChangeSensitive value of the View. /// [EditorBrowsable(EditorBrowsableState.Never)] @@ -754,21 +437,19 @@ namespace Tizen.NUI.BaseComponents AllowNullCopy = false; } - internal ViewStyle CreateInstance() - { - return (ViewStyle)Activator.CreateInstance(GetType()); - } - - private void OnPaddingChanged(ushort start, ushort end, ushort top, ushort bottom) - { - Padding = new Extents(start, end, top, bottom); - } - - private void OnMarginChanged(ushort start, ushort end, ushort top, ushort bottom) + /// + /// Release instance. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public void Dispose() { - Margin = new Extents(start, end, top, bottom); + Dispose(true); + global::System.GC.SuppressFinalize(this); } + /// + /// Release instance. + /// [EditorBrowsable(EditorBrowsableState.Never)] protected virtual void Dispose(bool disposing) { @@ -780,10 +461,6 @@ namespace Tizen.NUI.BaseComponents if (disposing) { // Dispose managed state (managed objects). - cellIndex?.Dispose(); - downFocusableView?.Dispose(); - flexMargin?.Dispose(); - leftFocusableView?.Dispose(); margin?.Dispose(); maximumSize?.Dispose(); minimumSize?.Dispose(); @@ -792,21 +469,16 @@ namespace Tizen.NUI.BaseComponents parentOrigin?.Dispose(); pivotPoint?.Dispose(); position?.Dispose(); - rightFocusableView?.Dispose(); - scale?.Dispose(); size?.Dispose(); sizeModeFactor?.Dispose(); - upFocusableView?.Dispose(); } disposed = true; } - [EditorBrowsable(EditorBrowsableState.Never)] - public void Dispose() + internal ViewStyle CreateInstance() { - Dispose(true); - global::System.GC.SuppressFinalize(this); + return (ViewStyle)Activator.CreateInstance(GetType()); } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyleBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyleBindableProperty.cs index 8f0a3ad..28699fd 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyleBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/ViewStyleBindableProperty.cs @@ -21,19 +21,7 @@ namespace Tizen.NUI.BaseComponents { public partial class ViewStyle { - /// 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 static readonly BindableProperty StyleNameProperty = BindableProperty.Create(nameof(StyleName), typeof(string), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.styleName = (string)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.styleName; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// Bindable property of BackgroundImage. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty BackgroundImageSelectorProperty = BindableProperty.Create("BackgroundImageSelector", typeof(Selector), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { @@ -51,190 +39,17 @@ namespace Tizen.NUI.BaseComponents }, defaultValueCreator: (bindable) => { - var viewStyle = (ViewStyle)bindable; - return viewStyle.backgroundImageSelector; - }); - /// 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 static readonly BindableProperty StateProperty = BindableProperty.Create(nameof(State), typeof(View.States?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.state = (View.States?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.state; - }); - /// 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 static readonly BindableProperty SubStateProperty = BindableProperty.Create(nameof(SubState), typeof(View.States?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.subState = (View.States?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.subState; - }); - /// 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 static readonly BindableProperty FlexProperty = BindableProperty.Create(nameof(Flex), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.flex = (float?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.flex; - }); - /// 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 static readonly BindableProperty AlignSelfProperty = BindableProperty.Create(nameof(AlignSelf), typeof(int?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.alignSelf = (int?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.alignSelf; - }); - /// 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 static readonly BindableProperty FlexMarginProperty = BindableProperty.Create(nameof(FlexMargin), typeof(Vector4), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.flexMargin = (Vector4)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.flexMargin; - }); - /// 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 static readonly BindableProperty CellIndexProperty = BindableProperty.Create(nameof(CellIndex), typeof(Vector2), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.cellIndex = (Vector2)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.cellIndex; - }); - /// 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 static readonly BindableProperty RowSpanProperty = BindableProperty.Create(nameof(RowSpan), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.rowSpan = (float?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.rowSpan; - }); - /// 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 static readonly BindableProperty ColumnSpanProperty = BindableProperty.Create(nameof(ColumnSpan), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.columnSpan = (float?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.columnSpan; - }); - /// 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 static readonly BindableProperty CellHorizontalAlignmentProperty = BindableProperty.Create(nameof(CellHorizontalAlignment), typeof(HorizontalAlignmentType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.cellHorizontalAlignment = (HorizontalAlignmentType?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.cellHorizontalAlignment; - }); - /// 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 static readonly BindableProperty CellVerticalAlignmentProperty = BindableProperty.Create(nameof(CellVerticalAlignment), typeof(VerticalAlignmentType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.cellVerticalAlignment = (VerticalAlignmentType?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.cellVerticalAlignment; + return ((ViewStyle)bindable).backgroundImageSelector; }); - /// 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 static readonly BindableProperty LeftFocusableViewProperty = BindableProperty.Create(nameof(LeftFocusableView), typeof(View), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.leftFocusableView = (View)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.leftFocusableView; - }); - /// 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 static readonly BindableProperty RightFocusableViewProperty = BindableProperty.Create(nameof(RightFocusableView), typeof(View), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.rightFocusableView = (View)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.rightFocusableView; - }); - /// 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 static readonly BindableProperty UpFocusableViewProperty = BindableProperty.Create(nameof(UpFocusableView), typeof(View), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.upFocusableView = (View)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.upFocusableView; - }); - /// 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 static readonly BindableProperty DownFocusableViewProperty = BindableProperty.Create(nameof(DownFocusableView), typeof(View), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.downFocusableView = (View)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.downFocusableView; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + + /// Bindable property of Focusable. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FocusableProperty = BindableProperty.Create(nameof(Focusable), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.focusable = (bool?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.focusable; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty FocusableProperty = BindableProperty.Create(nameof(Focusable), typeof(bool?), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).focusable = (bool?)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).focusable + ); + + /// Bindable property of Focusable. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty Size2DProperty = BindableProperty.Create(nameof(Size2D), typeof(Size2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { @@ -246,18 +61,15 @@ namespace Tizen.NUI.BaseComponents var viewStyle = (ViewStyle)bindable; return viewStyle.size == null ? null : (Size2D)viewStyle.size; }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + + /// Bindable property of Opacity. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - ((ViewStyle)bindable).opacitySelector = ((Selector)newValue)?.Clone(); - }, - defaultValueCreator: (bindable) => - { - var controlStyle = (ViewStyle)bindable; - return controlStyle.opacitySelector; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).opacitySelector = ((Selector)newValue)?.Clone(), + defaultValueCreator: (bindable) => ((ViewStyle)bindable).opacitySelector + ); + + /// Bindable property of Position2D. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty Position2DProperty = BindableProperty.Create(nameof(Position2D), typeof(Position2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { @@ -269,55 +81,29 @@ namespace Tizen.NUI.BaseComponents var viewStyle = (ViewStyle)bindable; return viewStyle.position == null ? null : new Position2D(viewStyle.position); }); - /// 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 static readonly BindableProperty PositionUsesPivotPointProperty = BindableProperty.Create(nameof(PositionUsesPivotPoint), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.positionUsesPivotPoint = (bool?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.positionUsesPivotPoint; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + + /// Bindable property of PositionUsesPivotPoint. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SiblingOrderProperty = BindableProperty.Create(nameof(SiblingOrder), typeof(int?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.siblingOrder = (int?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.siblingOrder; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty PositionUsesPivotPointProperty = BindableProperty.Create(nameof(PositionUsesPivotPoint), typeof(bool?), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).positionUsesPivotPoint = (bool?)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).positionUsesPivotPoint + ); + + /// Bindable property of ParentOrigin. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ParentOriginProperty = BindableProperty.Create(nameof(ParentOrigin), typeof(Position), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.parentOrigin = (Position)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.parentOrigin; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty ParentOriginProperty = BindableProperty.Create(nameof(ParentOrigin), typeof(Position), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).parentOrigin = (Position)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).parentOrigin + ); + + /// Bindable property of PivotPoint. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PivotPointProperty = BindableProperty.Create(nameof(PivotPoint), typeof(Position), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.pivotPoint = (Position)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.pivotPoint; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty PivotPointProperty = BindableProperty.Create(nameof(PivotPoint), typeof(Position), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).pivotPoint = (Position)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).pivotPoint + ); + + /// Bindable property of SizeWidth. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SizeWidthProperty = BindableProperty.Create(nameof(SizeWidth), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { @@ -335,7 +121,8 @@ namespace Tizen.NUI.BaseComponents { return ((ViewStyle)bindable).size?.Width; }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + + /// Bindable property of SizeHeight. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SizeHeightProperty = BindableProperty.Create(nameof(SizeHeight), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { @@ -353,7 +140,8 @@ namespace Tizen.NUI.BaseComponents { return ((ViewStyle)bindable).size?.Height; }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + + /// Bindable property of Position. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PositionProperty = BindableProperty.Create(nameof(Position), typeof(Position), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { @@ -369,7 +157,8 @@ namespace Tizen.NUI.BaseComponents var viewStyle = (ViewStyle)bindable; return viewStyle.position; }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + + /// Bindable property of PositionX. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PositionXProperty = BindableProperty.Create(nameof(PositionX), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { @@ -387,7 +176,8 @@ namespace Tizen.NUI.BaseComponents { return ((ViewStyle)bindable).position?.X; }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + + /// Bindable property of PositionY. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PositionYProperty = BindableProperty.Create(nameof(PositionY), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { @@ -405,309 +195,85 @@ namespace Tizen.NUI.BaseComponents { return ((ViewStyle)bindable).position?.Y; }); - /// 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 static readonly BindableProperty PositionZProperty = BindableProperty.Create(nameof(PositionZ), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - if (newValue != null) - { - if (viewStyle.position == null) - { - if ((float)newValue == 0) return; - } - viewStyle.position = new Position(viewStyle.Position?.X ?? 0, viewStyle.Position?.Y ?? 0, (float)newValue); - } - }, - defaultValueCreator: (bindable) => - { - return ((ViewStyle)bindable).position?.Z; - }); - /// 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 static readonly BindableProperty OrientationProperty = BindableProperty.Create(nameof(Orientation), typeof(Rotation), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.orientation = (Rotation)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.orientation; - }); - /// 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 static readonly BindableProperty ScaleProperty = BindableProperty.Create(nameof(Scale), typeof(Vector3), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.scale = (Vector3)newValue; - if (viewStyle.scale != null && viewStyle.scale.X == 1.0f && viewStyle.scale.Y == 1.0f && viewStyle.scale.Z == 1.0f) return; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.scale; - }); - /// 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 static readonly BindableProperty ScaleXProperty = BindableProperty.Create(nameof(ScaleX), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - if (newValue != null) - { - if (viewStyle.scale == null) - { - if ((float)newValue == 1.0f) return; - } - viewStyle.scale = new Vector3((float)newValue, viewStyle.scale?.Y ?? 0, viewStyle.scale?.Z ?? 0); - } - }, - defaultValueCreator: (bindable) => - { - return ((ViewStyle)bindable).scale?.X; - }); - /// 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 static readonly BindableProperty ScaleYProperty = BindableProperty.Create(nameof(ScaleY), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - if (newValue != null) - { - if (viewStyle.scale == null) - { - if ((float)newValue == 1.0f) return; - } - viewStyle.scale = new Vector3(viewStyle.scale?.X ?? 0, (float)newValue, viewStyle.scale?.Z ?? 0); - } - }, - defaultValueCreator: (bindable) => - { - return ((ViewStyle)bindable).scale?.Y; - }); - /// 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 static readonly BindableProperty ScaleZProperty = BindableProperty.Create(nameof(ScaleZ), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - if (newValue != null) - { - if (viewStyle.scale == null) - { - if ((float)newValue == 1.0f) return; - } - viewStyle.scale = new Vector3(viewStyle.scale?.X ?? 0, viewStyle.scale?.Y ?? 0, (float)newValue); - } - }, - defaultValueCreator: (bindable) => - { - return ((ViewStyle)bindable).scale?.Z; - }); - /// 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 static readonly BindableProperty NameProperty = BindableProperty.Create(nameof(Name), typeof(string), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.name = (string)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.name; - }); - /// 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 static readonly BindableProperty SensitiveProperty = BindableProperty.Create(nameof(Sensitive), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.sensitive = (bool?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.sensitive; - }); - /// 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 static readonly BindableProperty LeaveRequiredProperty = BindableProperty.Create(nameof(LeaveRequired), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.leaveRequired = (bool?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.leaveRequired; - }); - /// 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 static readonly BindableProperty InheritOrientationProperty = BindableProperty.Create(nameof(InheritOrientation), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.inheritOrientation = (bool?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.inheritOrientation; - }); - /// 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 static readonly BindableProperty InheritScaleProperty = BindableProperty.Create(nameof(InheritScale), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.inheritScale = (bool?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.inheritScale; - }); - /// 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 static readonly BindableProperty DrawModeProperty = BindableProperty.Create(nameof(DrawMode), typeof(DrawModeType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.drawMode = (DrawModeType?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.drawMode; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + + /// Bindable property of Orientation. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SizeModeFactorProperty = BindableProperty.Create(nameof(SizeModeFactor), typeof(Vector3), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.sizeModeFactor = (Vector3)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.sizeModeFactor; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty OrientationProperty = BindableProperty.Create(nameof(Orientation), typeof(Rotation), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).orientation = (Rotation)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).orientation + ); + + /// Bindable property of DrawMode. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty WidthResizePolicyProperty = BindableProperty.Create(nameof(WidthResizePolicy), typeof(ResizePolicyType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.widthResizePolicy = (ResizePolicyType?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.widthResizePolicy; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty DrawModeProperty = BindableProperty.Create(nameof(DrawMode), typeof(DrawModeType?), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).drawMode = (DrawModeType?)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).drawMode + ); + + /// Bindable property of SizeModeFactor. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty HeightResizePolicyProperty = BindableProperty.Create(nameof(HeightResizePolicy), typeof(ResizePolicyType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.heightResizePolicy = (ResizePolicyType?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.heightResizePolicy; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty SizeModeFactorProperty = BindableProperty.Create(nameof(SizeModeFactor), typeof(Vector3), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).sizeModeFactor = (Vector3)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).sizeModeFactor + ); + + /// Bindable property of WidthResizePolicy. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SizeScalePolicyProperty = BindableProperty.Create(nameof(SizeScalePolicy), typeof(SizeScalePolicyType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.sizeScalePolicy = (SizeScalePolicyType?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.sizeScalePolicy; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty WidthResizePolicyProperty = BindableProperty.Create(nameof(WidthResizePolicy), typeof(ResizePolicyType?), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).widthResizePolicy = (ResizePolicyType?)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).widthResizePolicy + ); + + /// Bindable property of HeightResizePolicy. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty WidthForHeightProperty = BindableProperty.Create(nameof(WidthForHeight), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.widthForHeight = (bool?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.widthForHeight; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty HeightResizePolicyProperty = BindableProperty.Create(nameof(HeightResizePolicy), typeof(ResizePolicyType?), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).heightResizePolicy = (ResizePolicyType?)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).heightResizePolicy + ); + + /// Bindable property of WidthForHeight. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty HeightForWidthProperty = BindableProperty.Create(nameof(HeightForWidth), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.heightForWidth = (bool?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.heightForWidth; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty WidthForHeightProperty = BindableProperty.Create(nameof(WidthForHeight), typeof(bool?), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).widthForHeight = (bool?)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).widthForHeight + ); + + /// Bindable property of HeightForWidth. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Extents), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - if (null == viewStyle.padding) viewStyle.padding = new Extents(viewStyle.OnPaddingChanged, 0, 0, 0, 0); - viewStyle.padding.CopyFrom(null == newValue ? new Extents() : (Extents)newValue); - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.padding; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty HeightForWidthProperty = BindableProperty.Create(nameof(HeightForWidth), typeof(bool?), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).heightForWidth = (bool?)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).heightForWidth + ); + + /// Bindable property of Padding. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty MinimumSizeProperty = BindableProperty.Create(nameof(MinimumSize), typeof(Size2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.minimumSize = (Size2D)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.minimumSize; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Extents), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).padding = (Extents)((Extents)newValue)?.Clone(), + defaultValueCreator: (bindable) => ((ViewStyle)bindable).padding + ); + + /// Bindable property of MinimumSize. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty MaximumSizeProperty = BindableProperty.Create(nameof(MaximumSize), typeof(Size2D), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.maximumSize = (Size2D)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.maximumSize; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty MinimumSizeProperty = BindableProperty.Create(nameof(MinimumSize), typeof(Size2D), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).minimumSize = (Size2D)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).minimumSize + ); + + /// Bindable property of MaximumSize. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InheritPositionProperty = BindableProperty.Create(nameof(InheritPosition), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.inheritPosition = (bool?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.inheritPosition; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty MaximumSizeProperty = BindableProperty.Create(nameof(MaximumSize), typeof(Size2D), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).maximumSize = (Size2D)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).maximumSize + ); + + /// Bindable property of ClippingMode. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ClippingModeProperty = BindableProperty.Create(nameof(ClippingMode), typeof(ClippingModeType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.clippingMode = (ClippingModeType?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.clippingMode; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty ClippingModeProperty = BindableProperty.Create(nameof(ClippingMode), typeof(ClippingModeType?), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).clippingMode = (ClippingModeType?)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).clippingMode + ); + + /// Bindable property of Size. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty SizeProperty = BindableProperty.Create(nameof(Size), typeof(Size), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { @@ -723,56 +289,15 @@ namespace Tizen.NUI.BaseComponents var viewStyle = (ViewStyle)bindable; return viewStyle.size; }); - /// 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 static readonly BindableProperty InheritLayoutDirectionProperty = BindableProperty.Create(nameof(InheritLayoutDirection), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.inheritLayoutDirection = (bool?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.inheritLayoutDirection; - }); - /// 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 static readonly BindableProperty LayoutDirectionProperty = BindableProperty.Create(nameof(LayoutDirection), typeof(ViewLayoutDirectionType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.layoutDirection = (ViewLayoutDirectionType?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.layoutDirection; - }); - /// 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 static readonly BindableProperty MarginProperty = BindableProperty.Create(nameof(Margin), typeof(Extents), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - if (null == viewStyle.margin) viewStyle.margin = new Extents(viewStyle.OnMarginChanged, 0, 0, 0, 0); - viewStyle.margin.CopyFrom(null == newValue ? new Extents() : (Extents)newValue); - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.margin; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + + /// Bindable property of Margin. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty WeightProperty = BindableProperty.Create(nameof(Weight), typeof(float?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - var viewStyle = (ViewStyle)bindable; - viewStyle.weight = (float?)newValue; - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.weight; - }); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + public static readonly BindableProperty MarginProperty = BindableProperty.Create(nameof(Margin), typeof(Extents), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).margin = (Extents)((Extents)newValue)?.Clone(), + defaultValueCreator: (bindable) => ((ViewStyle)bindable).margin + ); + + /// Bindable property of BackgroundColor. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { @@ -791,34 +316,24 @@ namespace Tizen.NUI.BaseComponents }, defaultValueCreator: (bindable) => { - var viewStyle = (ViewStyle)bindable; - return viewStyle.backgroundColorSelector; + return ((ViewStyle)bindable).backgroundColorSelector; }); + /// Bindable property of ColorSelector. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ColorSelectorProperty = BindableProperty.Create("ColorSelector", typeof(Selector), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - ((ViewStyle)bindable).colorSelector = ((Selector)newValue)?.Clone(); - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.colorSelector; - }); + public static readonly BindableProperty ColorSelectorProperty = BindableProperty.Create("ColorSelector", typeof(Selector), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).colorSelector = ((Selector)newValue)?.Clone(), + defaultValueCreator: (bindable) => ((ViewStyle)bindable).colorSelector + ); - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// Bindable property of BackgroundImageBorder. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty BackgroundImageBorderSelectorProperty = BindableProperty.Create("BackgroundImageBorderSelector", typeof(Selector), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - ((ViewStyle)bindable).backgroundImageBorderSelector = ((Selector)newValue)?.Clone(); - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.backgroundImageBorderSelector; - }); + public static readonly BindableProperty BackgroundImageBorderSelectorProperty = BindableProperty.Create("BackgroundImageBorderSelector", typeof(Selector), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).backgroundImageBorderSelector = ((Selector)newValue)?.Clone(), + defaultValueCreator: (bindable) => ((ViewStyle)bindable).backgroundImageBorderSelector + ); - /// A BindableProperty for ImageShadow + /// Bindable property of ImageShadow. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty ImageShadowSelectorProperty = BindableProperty.Create("ImageShadowSelector", typeof(Selector), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { @@ -834,10 +349,10 @@ namespace Tizen.NUI.BaseComponents defaultValueCreator: (bindable) => { var viewStyle = (ViewStyle)bindable; - return viewStyle.imageShadow; + return ((ViewStyle)bindable).imageShadow; }); - /// A BindableProperty for BoxShadow + /// Bindable property of BoxShadow. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty BoxShadowSelectorProperty = BindableProperty.Create("BoxShadowSelector", typeof(Selector), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { @@ -853,52 +368,28 @@ namespace Tizen.NUI.BaseComponents defaultValueCreator: (bindable) => { var viewStyle = (ViewStyle)bindable; - return viewStyle.boxShadow; + return ((ViewStyle)bindable).boxShadow; }); - /// A BindableProperty for CornerRadius + /// Bindable property of CornerRadius. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create("CornerRadiusSelector", typeof(Selector), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - ((ViewStyle)bindable).cornerRadius = ((Selector)(newValue))?.Clone(); - }, - defaultValueCreator: (bindable) => - { - var viewStyle = (ViewStyle)bindable; - return viewStyle.cornerRadius; - }); + public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create(nameof(CornerRadius), typeof(float?), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).cornerRadius = (float?)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).cornerRadius + ); - /// A BindableProperty for CornerRadiusPolicy + /// Bindable property of CornerRadiusPolicy. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty CornerRadiusPolicyProperty = BindableProperty.Create(nameof(CornerRadiusPolicy), typeof(VisualTransformPolicyType?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).cornerRadiusPolicy = (VisualTransformPolicyType?)newValue, defaultValueCreator: (bindable) => ((ViewStyle)bindable).cornerRadiusPolicy ); - /// - /// EnableControlState property - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableControlStateProperty = BindableProperty.Create(nameof(EnableControlState), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - ((ViewStyle)bindable).enableControlState = (bool?)newValue; - }, - defaultValueCreator: (bindable) => - { - return ((ViewStyle)bindable).enableControlState; - }); - - /// - /// EnableControlState property - /// + /// Bindable property of ThemeChangeSensitive. Please do not open it. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ThemeChangeSensitiveProperty = BindableProperty.Create(nameof(ThemeChangeSensitive), typeof(bool?), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => - { - ((ViewStyle)bindable).themeChangeSensitive = (bool?)newValue; - }, - defaultValueCreator: (bindable) => - { - return ((ViewStyle)bindable).themeChangeSensitive; - }); + public static readonly BindableProperty ThemeChangeSensitiveProperty = BindableProperty.Create(nameof(ThemeChangeSensitive), typeof(bool?), typeof(ViewStyle), null, + propertyChanged: (bindable, oldValue, newValue) => ((ViewStyle)bindable).themeChangeSensitive = (bool?)newValue, + defaultValueCreator: (bindable) => ((ViewStyle)bindable).themeChangeSensitive + ); } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 03edab5..e8de926 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -475,7 +475,6 @@ namespace Tizen.NUI.BaseComponents set { SetValue(CornerRadiusProperty, value); - selectorData?.CornerRadius.UpdateIfNeeds(this, value); NotifyPropertyChanged(); } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs index 127fc8e..73a302c 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs @@ -1740,21 +1740,6 @@ namespace Tizen.NUI.BaseComponents var view = (View)bindable; return view.SelectorData.BoxShadow.Get(view); }); - - /// - /// CornerRadius Selector Property - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CornerRadiusSelectorProperty = BindableProperty.Create("CornerRadiusSelector", typeof(Selector), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => - { - var view = (View)bindable; - view.SelectorData.CornerRadius.Update(view, (Selector)newValue, true); - }, - defaultValueCreator: (bindable) => - { - var view = (View)bindable; - return view.SelectorData.CornerRadius.Get(view); - }); #endregion } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewSelectorData.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewSelectorData.cs index c67da08..0032a01 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewSelectorData.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewSelectorData.cs @@ -55,7 +55,6 @@ namespace Tizen.NUI.BaseComponents public TriggerableSelector Opacity { get; } = new TriggerableSelector(View.OpacityProperty); public TriggerableSelector ImageShadow { get; } = new TriggerableSelector(View.ImageShadowProperty); public TriggerableSelector BoxShadow { get; } = new TriggerableSelector(View.BoxShadowProperty); - public TriggerableSelector CornerRadius { get; } = new TriggerableSelector(View.CornerRadiusProperty); public void Reset(View view) { @@ -66,7 +65,6 @@ namespace Tizen.NUI.BaseComponents Opacity.Reset(view); ImageShadow.Reset(view); BoxShadow.Reset(view); - CornerRadius.Reset(view); } } }