From 8dd37d7c3782001ec70245d4932ac0de965a2e80 Mon Sep 17 00:00:00 2001 From: Xianbing Teng Date: Wed, 18 Dec 2019 09:24:38 +0800 Subject: [PATCH] Refine background property of control (#1183) (#1196) * Refine background property of control * [NUI] Refine SelectButton control of NUI.Components * [NUI] Remove thumb background from slider --- .../Attributes/ButtonAttributes.cs | 143 ++-- .../Attributes/ControlStyle.cs | 141 ++-- .../Attributes/ImageControlStyle.cs | 88 ++- .../Attributes/PopupAttributes.cs | 14 - .../Attributes/SelectButtonAttributes.cs | 92 --- .../Attributes/SliderAttributes.cs | 123 +--- src/Tizen.NUI.Components/Controls/Button.cs | 124 ++-- src/Tizen.NUI.Components/Controls/CheckBox.cs | 4 +- src/Tizen.NUI.Components/Controls/CheckBoxGroup.cs | 9 +- src/Tizen.NUI.Components/Controls/Control.cs | 196 ++++-- src/Tizen.NUI.Components/Controls/DropDown.cs | 84 +-- src/Tizen.NUI.Components/Controls/ImageControl.cs | 110 +++- src/Tizen.NUI.Components/Controls/Popup.cs | 12 +- src/Tizen.NUI.Components/Controls/RadioButton.cs | 2 +- .../Controls/RadioButtonGroup.cs | 4 +- src/Tizen.NUI.Components/Controls/Scrollbar.cs | 2 +- src/Tizen.NUI.Components/Controls/SelectButton.cs | 168 +---- src/Tizen.NUI.Components/Controls/SelectGroup.cs | 18 +- src/Tizen.NUI.Components/Controls/Slider.cs | 71 +- .../public/BaseComponents/Style/ViewAttributes.cs | 727 +++++---------------- src/Tizen.NUI/src/public/BaseComponents/View.cs | 80 ++- .../public/BaseComponents/ViewBindableProperty.cs | 20 +- 22 files changed, 895 insertions(+), 1337 deletions(-) delete mode 100755 src/Tizen.NUI.Components/Attributes/SelectButtonAttributes.cs diff --git a/src/Tizen.NUI.Components/Attributes/ButtonAttributes.cs b/src/Tizen.NUI.Components/Attributes/ButtonAttributes.cs index 04f2597..bd63fd8 100755 --- a/src/Tizen.NUI.Components/Attributes/ButtonAttributes.cs +++ b/src/Tizen.NUI.Components/Attributes/ButtonAttributes.cs @@ -33,6 +33,8 @@ namespace Tizen.NUI.Components private bool? isSelected; private bool? isEnabled; private Button.IconOrientation? iconRelativeOrientation; + private Extents iconPadding; + private Extents textPadding; /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] @@ -82,6 +84,30 @@ namespace Tizen.NUI.Components var buttonStyle = (ButtonStyle)bindable; return buttonStyle.iconRelativeOrientation; }); + /// 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 IconPaddingProperty = BindableProperty.Create("IconPadding", typeof(Extents), typeof(ButtonStyle), null, propertyChanged: (bindable, oldValue, newValue) => + { + var buttonStyle = (ButtonStyle)bindable; + buttonStyle.iconPadding = (Extents)newValue; + }, + defaultValueCreator: (bindable) => + { + var buttonStyle = (ButtonStyle)bindable; + return buttonStyle.iconPadding; + }); + /// 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 TextPaddingProperty = BindableProperty.Create("TextPadding", typeof(Extents), typeof(ButtonStyle), null, propertyChanged: (bindable, oldValue, newValue) => + { + var buttonStyle = (ButtonStyle)bindable; + buttonStyle.textPadding = (Extents)newValue; + }, + defaultValueCreator: (bindable) => + { + var buttonStyle = (ButtonStyle)bindable; + return buttonStyle.textPadding; + }); /// /// Creates a new instance of a ButtonStyle. @@ -91,8 +117,9 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public ButtonStyle() : base() { - InitSubAttributes(); + InitSubStyle(); } + /// /// Creates a new instance of a ButtonStyle with style. /// @@ -107,14 +134,9 @@ namespace Tizen.NUI.Components return; } - IsSelectable = style.IsSelectable; - IconRelativeOrientation = style.IconRelativeOrientation; - - InitSubAttributes(); + InitSubStyle(); - Overlay.CopyFrom(style.Overlay); - Text.CopyFrom(style.Text); - Icon.CopyFrom(style.Icon); + this.CopyFrom(style); } /// /// Overlay image's Style. @@ -122,62 +144,38 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public ImageViewStyle Overlay - { - get; - set; - } + public ImageViewStyle Overlay { get; set; } + /// /// Text's Style. /// /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public TextLabelStyle Text - { - get; - set; - } + public TextLabelStyle Text { get; set; } + /// /// Icon's Style. /// /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public ImageViewStyle Icon - { - get; - set; - } + public ImageControlStyle Icon { get; set; } /// 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? IsSelectable { - get - { - bool? temp = (bool?)GetValue(IsSelectableProperty); - return temp; - } - set - { - SetValue(IsSelectableProperty, value); - } + get => (bool?)GetValue(IsSelectableProperty); + set => SetValue(IsSelectableProperty, 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? IsSelected { - get - { - bool? temp = (bool?)GetValue(IsSelectedProperty); - return temp; - } - set - { - SetValue(IsSelectedProperty, value); - } + get => (bool?)GetValue(IsSelectedProperty); + set => SetValue(IsSelectedProperty, value); } /// @@ -188,15 +186,8 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public bool? IsEnabled { - get - { - bool? temp = (bool?)GetValue(IsEnabledProperty); - return temp; - } - set - { - SetValue(IsEnabledProperty, value); - } + get => (bool?)GetValue(IsEnabledProperty); + set => SetValue(IsEnabledProperty, value); } /// @@ -207,15 +198,32 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public Button.IconOrientation? IconRelativeOrientation { + get => (Button.IconOrientation?)GetValue(IconRelativeOrientationProperty); + set => SetValue(IconRelativeOrientationProperty, 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 IconPadding + { get { - Button.IconOrientation? temp = (Button.IconOrientation?)GetValue(IconRelativeOrientationProperty); - return temp; + Extents padding = (Extents)GetValue(IconPaddingProperty); + return (null != padding) ? padding : iconPadding = new Extents((ushort start, ushort end, ushort top, ushort bottom) => { IconPadding = new Extents(start, end, top, bottom); }, 0, 0, 0, 0); } - set + set => SetValue(IconPaddingProperty, 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 TextPadding + { + get { - SetValue(IconRelativeOrientationProperty, value); + Extents padding = (Extents)GetValue(TextPaddingProperty); + return (null != padding) ? padding : textPadding = new Extents((ushort start, ushort end, ushort top, ushort bottom) => { TextPadding = new Extents(start, end, top, bottom); }, 0, 0, 0, 0); } + set => SetValue(TextPaddingProperty, value); } /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -224,28 +232,31 @@ namespace Tizen.NUI.Components { base.CopyFrom(bindableObject); - ButtonStyle buttonAttributes = bindableObject as ButtonStyle; + ButtonStyle buttonStyle = bindableObject as ButtonStyle; - if (null != buttonAttributes) + if (null != buttonStyle) { - if (null != buttonAttributes.Overlay) + if (null != buttonStyle.Overlay) { - Overlay.CopyFrom(buttonAttributes.Overlay); + Overlay.CopyFrom(buttonStyle.Overlay); } - if (null != buttonAttributes.Text) + if (null != buttonStyle.Text) { - Text.CopyFrom(buttonAttributes.Text); + Text.CopyFrom(buttonStyle.Text); } - if (null != buttonAttributes.Icon) + if (null != buttonStyle.Icon) { - Icon.CopyFrom(buttonAttributes.Icon); + Icon.CopyFrom(buttonStyle.Icon); } + + IsSelectable = buttonStyle.IsSelectable; + IconRelativeOrientation = buttonStyle.IconRelativeOrientation; } } - private void InitSubAttributes() + private void InitSubStyle() { Overlay = new ImageViewStyle() { @@ -269,13 +280,13 @@ namespace Tizen.NUI.Components }; Text.PropertyChanged += SubStyleCalledEvent; - Icon = new ImageViewStyle() + Icon = new ImageControlStyle() { PositionUsesPivotPoint = true, ParentOrigin = Tizen.NUI.ParentOrigin.Center, PivotPoint = Tizen.NUI.PivotPoint.Center, - WidthResizePolicy = ResizePolicyType.UseNaturalSize, - HeightResizePolicy = ResizePolicyType.UseNaturalSize, + WidthResizePolicy = ResizePolicyType.FitToChildren, + HeightResizePolicy = ResizePolicyType.FitToChildren, }; Icon.PropertyChanged += SubStyleCalledEvent; } diff --git a/src/Tizen.NUI.Components/Attributes/ControlStyle.cs b/src/Tizen.NUI.Components/Attributes/ControlStyle.cs index 329dd06..030c3f6 100755 --- a/src/Tizen.NUI.Components/Attributes/ControlStyle.cs +++ b/src/Tizen.NUI.Components/Attributes/ControlStyle.cs @@ -22,65 +22,128 @@ using Tizen.NUI.Binding; namespace Tizen.NUI.Components { /// - /// ButtonAttributes is a class which saves Button's ux data. + /// ControlStyle is a base class of NUI.Components style. /// /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public class ControlStyle : 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 BackgroundImageProperty = BindableProperty.Create("ControlBackgroundImage", typeof(Selector), typeof(ControlStyle), null, propertyChanged: (bindable, oldValue, newValue) => + { + var controlStyle = (ControlStyle)bindable; + if (null == controlStyle.backgroundImage) controlStyle.backgroundImage = new Selector(); + controlStyle.backgroundImage.Clone((Selector)newValue); + }, + defaultValueCreator: (bindable) => + { + var controlStyle = (ControlStyle)bindable; + return controlStyle.backgroundImage; + }); + /// 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 BackgroundColorProperty = BindableProperty.Create("ControlBackgroundColor", typeof(Selector), typeof(ControlStyle), null, propertyChanged: (bindable, oldValue, newValue) => + { + var controlStyle = (ControlStyle)bindable; + if (null == controlStyle.backgroundColor) controlStyle.backgroundColor = new Selector(); + controlStyle.backgroundColor.Clone((Selector)newValue); + }, + defaultValueCreator: (bindable) => + { + var controlStyle = (ControlStyle)bindable; + return controlStyle.backgroundColor; + }); + /// 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 BackgroundImageBorderProperty = BindableProperty.Create("ControlBackgroundImageBorder", typeof(Selector), typeof(ControlStyle), null, propertyChanged: (bindable, oldValue, newValue) => + { + var controlStyle = (ControlStyle)bindable; + if (null == controlStyle.backgroundImageBorder) controlStyle.backgroundImageBorder = new Selector(); + controlStyle.backgroundImageBorder.Clone((Selector)newValue); + }, + defaultValueCreator: (bindable) => + { + var controlStyle = (ControlStyle)bindable; + return controlStyle.backgroundImageBorder; + }); + private Selector backgroundImage; + private Selector backgroundImageBorder; + private Selector backgroundColor; /// - /// Creates a new instance of a ButtonStyle. + /// Creates a new instance of a ControlStyle. /// /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public ControlStyle() : base() { - InitSubAttributes(); + InitSubstyle(); } + /// - /// Creates a new instance of a ButtonStyle with style. + /// Creates a new instance of a ControlStyle with style. /// - /// Create ButtonStyle by style customized by user. + /// Create ControlStyle by style customized by user. /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public ControlStyle(ControlStyle style) : base(style) { - if(style == null) + if(null == style) return; + + InitSubstyle(); + + this.CopyFrom(style); + } + + /// Background image resource. + /// 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 new Selector BackgroundImage + { + get { - return; + Selector image = (Selector)GetValue(BackgroundImageProperty); + return (null != image) ? image : backgroundImage = new Selector(); } + set => SetValue(BackgroundImageProperty, value); + } - InitSubAttributes(); - - Shadow.CopyFrom(style.Shadow); - Background.CopyFrom(style.Background); + /// Background image border. + /// 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 new Selector BackgroundImageBorder + { + get + { + Selector boder = (Selector)GetValue(BackgroundImageBorderProperty); + return (null != boder) ? boder : backgroundImageBorder = new Selector(); + } + set => SetValue(BackgroundImageBorderProperty, value); } - /// - /// Shadow image's Style. - /// - /// 6 + /// Background image color. /// 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 ImageViewStyle Shadow + public new Selector BackgroundColor { - get; - set; + get + { + Selector color = (Selector)GetValue(BackgroundColorProperty); + return (null != color) ? color : backgroundColor = new Selector(); + } + set => SetValue(BackgroundColorProperty, value); } + /// - /// Background image's Style. + /// Shadow image's Style. /// /// 6 - /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + /// 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 ImageViewStyle Background - { - get; - set; - } + public ImageViewStyle Shadow { get; set; } /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] @@ -96,15 +159,25 @@ namespace Tizen.NUI.Components { Shadow.CopyFrom(controlStyle.Shadow); } - - if (null != controlStyle.Background) + if (null != controlStyle.BackgroundImage) + { + if (null == BackgroundImage) BackgroundImage = new Selector(); + BackgroundImage.Clone(controlStyle.BackgroundImage); + } + if (null != controlStyle.BackgroundImageBorder) { - Background.CopyFrom(controlStyle.Background); + if (null == BackgroundImageBorder) BackgroundImageBorder = new Selector(); + BackgroundImageBorder.Clone(controlStyle.BackgroundImageBorder); + } + if (null != controlStyle.BackgroundColor) + { + if (null == BackgroundColor) BackgroundColor = new Selector(); + BackgroundColor.Clone(controlStyle.BackgroundColor); } } } - private void InitSubAttributes() + private void InitSubstyle() { Shadow = new ImageViewStyle() { @@ -115,16 +188,6 @@ namespace Tizen.NUI.Components HeightResizePolicy = ResizePolicyType.FillToParent }; Shadow.PropertyChanged += SubStyleCalledEvent; - - Background = new ImageViewStyle() - { - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.Center, - PivotPoint = Tizen.NUI.PivotPoint.Center, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent - }; - Background.PropertyChanged += SubStyleCalledEvent; } private void SubStyleCalledEvent(object sender, global::System.EventArgs e) diff --git a/src/Tizen.NUI.Components/Attributes/ImageControlStyle.cs b/src/Tizen.NUI.Components/Attributes/ImageControlStyle.cs index dcf7853..3c692bf 100755 --- a/src/Tizen.NUI.Components/Attributes/ImageControlStyle.cs +++ b/src/Tizen.NUI.Components/Attributes/ImageControlStyle.cs @@ -29,6 +29,36 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public class ImageControlStyle : ControlStyle { + /// 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 ResourceUrlProperty = BindableProperty.Create("ImageControlResourceUrl", typeof(Selector), typeof(ImageControlStyle), null, propertyChanged: (bindable, oldValue, newValue) => + { + var imageControlStyle = (ImageControlStyle)bindable; + if (null == imageControlStyle.resourceUrlSelector) imageControlStyle.resourceUrlSelector = new Selector(); + imageControlStyle.resourceUrlSelector.Clone((Selector)newValue); + }, + defaultValueCreator: (bindable) => + { + var imageControlStyle = (ImageControlStyle)bindable; + return imageControlStyle.resourceUrlSelector; + }); + /// 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 BorderProperty = BindableProperty.Create("ImageControlBorder", typeof(Selector), typeof(ImageControlStyle), null, propertyChanged: (bindable, oldValue, newValue) => + { + var imageControlStyle = (ImageControlStyle)bindable; + if (null == imageControlStyle.borderSelector) imageControlStyle.borderSelector = new Selector(); + imageControlStyle.borderSelector.Clone((Selector)newValue); + }, + defaultValueCreator: (bindable) => + { + var imageControlStyle = (ImageControlStyle)bindable; + return imageControlStyle.borderSelector; + }); + + private Selector resourceUrlSelector; + private Selector borderSelector; + /// /// Creates a new instance of a ImageControlStyle. /// @@ -37,8 +67,8 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public ImageControlStyle() : base() { - InitSubStyle(); } + /// /// Creates a new instance of a ImageControlStyle with style. /// @@ -48,26 +78,39 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public ImageControlStyle(ImageControlStyle style) : base(style) { - if(style == null) - { - return; - } + if(null == style) return; - InitSubStyle(); + this.CopyFrom(style); + } - Image.CopyFrom(style.Image); + /// + /// Image URL. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public Selector ResourceUrl + { + get + { + Selector url = (Selector)GetValue(ResourceUrlProperty); + return (null != url) ? url : resourceUrlSelector = new Selector(); + } + set => SetValue(ResourceUrlProperty, value); } /// - /// Image's Style. + /// Image border. /// - /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public ImageViewStyle Image + public Selector Border { - get; - set; + get + { + Selector border = (Selector)GetValue(BorderProperty); + return (null != border) ? border : borderSelector = new Selector(); + } + set => SetValue(BorderProperty, value); } /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -80,22 +123,17 @@ namespace Tizen.NUI.Components if (null != imageControlStyle) { - if (null != imageControlStyle.Image) + if (null != imageControlStyle.ResourceUrl) { - Image.CopyFrom(imageControlStyle.Image); + if (null == ResourceUrl) ResourceUrl = new Selector(); + ResourceUrl.Clone(imageControlStyle.ResourceUrl); + } + if (null != imageControlStyle.Border) + { + if (null == Border) Border = new Selector(); + Border.Clone(imageControlStyle.Border); } } } - - private void InitSubStyle() - { - Image = new ImageViewStyle(); - Image.PropertyChanged += SubStyleCalledEvent; - } - - private void SubStyleCalledEvent(object sender, global::System.EventArgs e) - { - OnPropertyChanged(); - } } } diff --git a/src/Tizen.NUI.Components/Attributes/PopupAttributes.cs b/src/Tizen.NUI.Components/Attributes/PopupAttributes.cs index c483117..3a1f3a8 100755 --- a/src/Tizen.NUI.Components/Attributes/PopupAttributes.cs +++ b/src/Tizen.NUI.Components/Attributes/PopupAttributes.cs @@ -106,11 +106,6 @@ namespace Tizen.NUI.Components Shadow.CopyFrom(popupAttributes.Shadow); } - if (popupAttributes.Background != null) - { - Background.CopyFrom(popupAttributes.Background); - } - if (popupAttributes.Title != null) { Title.CopyFrom(popupAttributes.Title); @@ -137,15 +132,6 @@ namespace Tizen.NUI.Components PivotPoint = Tizen.NUI.PivotPoint.Center }; - Background = new ImageViewStyle() - { - PositionUsesPivotPoint = true, - ParentOrigin = Tizen.NUI.ParentOrigin.Center, - PivotPoint = Tizen.NUI.PivotPoint.Center, - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent - }; - Title = new TextLabelStyle() { Size = new Size(0, 0), diff --git a/src/Tizen.NUI.Components/Attributes/SelectButtonAttributes.cs b/src/Tizen.NUI.Components/Attributes/SelectButtonAttributes.cs deleted file mode 100755 index 1c085ae..0000000 --- a/src/Tizen.NUI.Components/Attributes/SelectButtonAttributes.cs +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright(c) 2019 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -using System.ComponentModel; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Binding; - -namespace Tizen.NUI.Components -{ - /// - /// SelectButtonStyle is a class which saves SelectButton's ux data. - /// - /// 6 - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public class SelectButtonStyle : ButtonStyle - { - /// - /// Creates a new instance of a SelectButtonStyle. - /// - /// 6 - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public SelectButtonStyle() : base() - { - IsSelectable = true; - CreateSubStyles(); - } - /// - /// Creates a new instance of a SelectButtonStyle with style. - /// - /// Create SelectButtonStyle by style customized by user. - /// 6 - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public SelectButtonStyle(SelectButtonStyle style) : base(style) - { - if (style == null) - { - return; - } - - CreateSubStyles(); - - CopyFrom(style); - } - - /// - /// Selectable image's attributes. - /// - /// 6 - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public ImageControlStyle SelectableImage - { - get; - set; - } - - /// 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 override void CopyFrom(BindableObject bindableObject) - { - base.CopyFrom(bindableObject); - - SelectButtonStyle selectButtonStyle = bindableObject as SelectButtonStyle; - - if (null != selectButtonStyle && null != selectButtonStyle.SelectableImage) - { - SelectableImage.CopyFrom(selectButtonStyle.SelectableImage); - } - } - - private void CreateSubStyles() - { - SelectableImage = new ImageControlStyle(); - } - } -} diff --git a/src/Tizen.NUI.Components/Attributes/SliderAttributes.cs b/src/Tizen.NUI.Components/Attributes/SliderAttributes.cs index e49aa72..7b94976 100755 --- a/src/Tizen.NUI.Components/Attributes/SliderAttributes.cs +++ b/src/Tizen.NUI.Components/Attributes/SliderAttributes.cs @@ -128,11 +128,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public ImageViewStyle Track - { - get; - set; - } + public ImageViewStyle Track { get; set; } /// /// Get or set slided track. @@ -140,11 +136,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public ImageViewStyle Progress - { - get; - set; - } + public ImageViewStyle Progress { get; set; } /// /// Get or set thumb. @@ -152,23 +144,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public ImageViewStyle Thumb - { - get; - set; - } - - /// - /// Get or set thumb background. - /// - /// 6 - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public ImageViewStyle ThumbBackground - { - get; - set; - } + public ImageViewStyle Thumb { get; set; } /// /// Get or set low indicator image. @@ -176,11 +152,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public ImageViewStyle LowIndicatorImage - { - get; - set; - } + public ImageViewStyle LowIndicatorImage { get; set; } /// /// Get or set high indicator image. @@ -188,11 +160,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public ImageViewStyle HighIndicatorImage - { - get; - set; - } + public ImageViewStyle HighIndicatorImage { get; set; } /// /// Get or set low indicator text. @@ -200,11 +168,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public TextLabelStyle LowIndicator - { - get; - set; - } + public TextLabelStyle LowIndicator { get; set; } /// /// Get or set high indicator text. @@ -212,11 +176,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public TextLabelStyle HighIndicator - { - get; - set; - } + public TextLabelStyle HighIndicator { get; set; } /// /// Get or set Indicator type @@ -226,21 +186,12 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public IndicatorType? IndicatorType { - get - { - return (IndicatorType?)GetValue(IndicatorTypeProperty); - } - set - { - SetValue(IndicatorTypeProperty, value); - } - } - private IndicatorType? privateIndicatorType - { - get; - set; + get => (IndicatorType?)GetValue(IndicatorTypeProperty); + set => SetValue(IndicatorTypeProperty, value); } + private IndicatorType? privateIndicatorType { get; set; } + /// /// Get or set track thickness /// @@ -249,20 +200,10 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public uint? TrackThickness { - get - { - return (uint?)GetValue(TrackThicknessProperty); - } - set - { - SetValue(TrackThicknessProperty, value); - } - } - private uint? privateTrackThickness - { - get; - set; + get => (uint?)GetValue(TrackThicknessProperty); + set => SetValue(TrackThicknessProperty, value); } + private uint? privateTrackThickness { get; set; } /// /// Get or set space between track and indicator @@ -272,20 +213,10 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public uint? SpaceBetweenTrackAndIndicator { - get - { - return (uint?)GetValue(SpaceBetweenTrackAndIndicatorProperty); - } - set - { - SetValue(SpaceBetweenTrackAndIndicatorProperty, value); - } - } - private uint? privateSpaceBetweenTrackAndIndicator - { - get; - set; + get => (uint?)GetValue(SpaceBetweenTrackAndIndicatorProperty); + set => SetValue(SpaceBetweenTrackAndIndicatorProperty, value); } + private uint? privateSpaceBetweenTrackAndIndicator { get; set; } /// /// Get or set space between track and indicator @@ -295,14 +226,8 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public Extents TrackPadding { - get - { - return (Extents)GetValue(TrackPaddingProperty); - } - set - { - SetValue(TrackPaddingProperty, value); - } + get => (Extents)GetValue(TrackPaddingProperty); + set => SetValue(TrackPaddingProperty, value); } private Extents _trackPadding; private Extents trackPadding @@ -362,15 +287,6 @@ namespace Tizen.NUI.Components Thumb.CopyFrom(sliderAttributes.Thumb); } - if (sliderAttributes.ThumbBackground != null) - { - if (null == ThumbBackground) - { - ThumbBackground = new ImageViewStyle(); - } - ThumbBackground.CopyFrom(sliderAttributes.ThumbBackground); - } - if (sliderAttributes.LowIndicatorImage != null) { if (null == LowIndicatorImage) @@ -424,7 +340,6 @@ namespace Tizen.NUI.Components Track = new ImageViewStyle(); Progress = new ImageViewStyle(); Thumb = new ImageViewStyle(); - ThumbBackground = new ImageViewStyle(); LowIndicatorImage = new ImageViewStyle(); HighIndicatorImage = new ImageViewStyle(); LowIndicator = new TextLabelStyle(); diff --git a/src/Tizen.NUI.Components/Controls/Button.cs b/src/Tizen.NUI.Components/Controls/Button.cs index 74a4e98..f2ca4ae 100755 --- a/src/Tizen.NUI.Components/Controls/Button.cs +++ b/src/Tizen.NUI.Components/Controls/Button.cs @@ -30,9 +30,9 @@ namespace Tizen.NUI.Components { /// 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 IconRelativeOrientationProperty = BindableProperty.Create("IconRelativeOrientation", typeof(IconOrientation?), typeof(Tizen.NUI.Components.Button), null, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty IconRelativeOrientationProperty = BindableProperty.Create("IconRelativeOrientation", typeof(IconOrientation?), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) => { - var instance = (Tizen.NUI.Components.Button)bindable; + var instance = (Button)bindable; if (newValue != null) { instance.privateIconRelativeOrientation = (IconOrientation?)newValue; @@ -40,14 +40,14 @@ namespace Tizen.NUI.Components }, defaultValueCreator: (bindable) => { - var instance = (Tizen.NUI.Components.Button)bindable; + var instance = (Button)bindable; return instance.privateIconRelativeOrientation; }); /// 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 IsEnabledProperty = BindableProperty.Create("IsEnabled", typeof(bool), typeof(Tizen.NUI.Components.Button), true, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty IsEnabledProperty = BindableProperty.Create("IsEnabled", typeof(bool), typeof(Button), true, propertyChanged: (bindable, oldValue, newValue) => { - var instance = (Tizen.NUI.Components.Button)bindable; + var instance = (Button)bindable; if (newValue != null) { instance.privateIsEnabled = (bool)newValue; @@ -55,14 +55,14 @@ namespace Tizen.NUI.Components }, defaultValueCreator: (bindable) => { - var instance = (Tizen.NUI.Components.Button)bindable; + var instance = (Button)bindable; return instance.privateIsEnabled; }); /// 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 IsSelectedProperty = BindableProperty.Create("IsSelected", typeof(bool), typeof(Tizen.NUI.Components.Button), true, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty IsSelectedProperty = BindableProperty.Create("IsSelected", typeof(bool), typeof(Button), true, propertyChanged: (bindable, oldValue, newValue) => { - var instance = (Tizen.NUI.Components.Button)bindable; + var instance = (Button)bindable; if (newValue != null) { instance.privateIsSelected = (bool)newValue; @@ -70,14 +70,14 @@ namespace Tizen.NUI.Components }, defaultValueCreator: (bindable) => { - var instance = (Tizen.NUI.Components.Button)bindable; + var instance = (Button)bindable; return instance.privateIsSelected; }); /// 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 IsSelectableProperty = BindableProperty.Create("IsSelectable", typeof(bool), typeof(Tizen.NUI.Components.Button), true, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty IsSelectableProperty = BindableProperty.Create("IsSelectable", typeof(bool), typeof(Button), true, propertyChanged: (bindable, oldValue, newValue) => { - var instance = (Tizen.NUI.Components.Button)bindable; + var instance = (Button)bindable; if (newValue != null) { instance.privateIsSelectable = (bool)newValue; @@ -85,14 +85,46 @@ namespace Tizen.NUI.Components }, defaultValueCreator: (bindable) => { - var instance = (Tizen.NUI.Components.Button)bindable; + var instance = (Button)bindable; return instance.privateIsSelectable; }); + /// 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 IconPaddingProperty = BindableProperty.Create("IconPadding", typeof(Extents), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Button)bindable; + if (null != newValue && null != instance.Style?.IconPadding) + { + instance.Style.IconPadding.CopyFrom((Extents)newValue); + instance.UpdateUIContent(); + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Button)bindable; + return instance.Style?.IconPadding; + }); + /// 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 TextPaddingProperty = BindableProperty.Create("TextPadding", typeof(Extents), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) => + { + var instance = (Button)bindable; + if (null != newValue && null != instance.Style?.TextPadding) + { + instance.Style.TextPadding.CopyFrom((Extents)newValue); + instance.UpdateUIContent(); + } + }, + defaultValueCreator: (bindable) => + { + var instance = (Button)bindable; + return instance.Style?.TextPadding; + }); private ImageView overlayImage; private TextLabel buttonText; - private ImageView buttonIcon; + private ImageControl buttonIcon; private EventHandler stateChangeHander; @@ -522,17 +554,8 @@ namespace Tizen.NUI.Components /// 6 public Extents IconPadding { - get - { - return Style?.Icon?.Padding; - } - set - { - if (null != value && null != Style?.Icon?.Padding) - { - Style.Icon.Padding.CopyFrom(value); - } - } + get => (Extents)GetValue(IconPaddingProperty); + set => SetValue(IconPaddingProperty, value); } /// @@ -541,17 +564,8 @@ namespace Tizen.NUI.Components /// 6 public Extents TextPadding { - get - { - return Style?.Text?.Padding; - } - set - { - if (null != value && null != Style?.Text?.Padding) - { - Style.Text.Padding.CopyFrom(value); - } - } + get => (Extents) GetValue(TextPaddingProperty); + set => SetValue(TextPaddingProperty, value); } /// @@ -726,7 +740,7 @@ namespace Tizen.NUI.Components if (null == buttonIcon) { - buttonIcon = new ImageView(); + buttonIcon = new ImageControl(); buttonIcon.Relayout += OnIconRelayout; this.Add(buttonIcon); } @@ -789,6 +803,7 @@ namespace Tizen.NUI.Components /// 6 private void Initialize() { + if (null == Style.IconRelativeOrientation) Style.IconRelativeOrientation = IconOrientation.Left; UpdateState(); LayoutDirectionChanged += OnLayoutDirectionChanged; } @@ -807,15 +822,15 @@ namespace Tizen.NUI.Components } buttonText.WidthResizePolicy = ResizePolicyType.Fixed; buttonText.HeightResizePolicy = ResizePolicyType.Fixed; - int textPaddingStart = Style.Text.Padding.Start; - int textPaddingEnd = Style.Text.Padding.End; - int textPaddingTop = Style.Text.Padding.Top; - int textPaddingBottom = Style.Text.Padding.Bottom; + int textPaddingStart = Style.TextPadding.Start; + int textPaddingEnd = Style.TextPadding.End; + int textPaddingTop = Style.TextPadding.Top; + int textPaddingBottom = Style.TextPadding.Bottom; - int iconPaddingStart = Style.Icon.Padding.Start; - int iconPaddingEnd = Style.Icon.Padding.End; - int iconPaddingTop = Style.Icon.Padding.Top; - int iconPaddingBottom = Style.Icon.Padding.Bottom; + int iconPaddingStart = Style.IconPadding.Start; + int iconPaddingEnd = Style.IconPadding.End; + int iconPaddingTop = Style.IconPadding.Top; + int iconPaddingBottom = Style.IconPadding.Bottom; if (IconRelativeOrientation == IconOrientation.Top || IconRelativeOrientation == IconOrientation.Bottom) { @@ -841,15 +856,15 @@ namespace Tizen.NUI.Components return; } - int textPaddingStart = Style.Text.Padding.Start; - int textPaddingEnd = Style.Text.Padding.End; - int textPaddingTop = Style.Text.Padding.Top; - int textPaddingBottom = Style.Text.Padding.Bottom; + int textPaddingStart = Style.TextPadding.Start; + int textPaddingEnd = Style.TextPadding.End; + int textPaddingTop = Style.TextPadding.Top; + int textPaddingBottom = Style.TextPadding.Bottom; - int iconPaddingStart = Style.Icon.Padding.Start; - int iconPaddingEnd = Style.Icon.Padding.End; - int iconPaddingTop = Style.Icon.Padding.Top; - int iconPaddingBottom = Style.Icon.Padding.Bottom; + int iconPaddingStart = Style.IconPadding.Start; + int iconPaddingEnd = Style.IconPadding.End; + int iconPaddingTop = Style.IconPadding.Top; + int iconPaddingBottom = Style.IconPadding.Bottom; switch (IconRelativeOrientation) { @@ -931,6 +946,11 @@ namespace Tizen.NUI.Components default: break; } + if ("" == buttonText.Text) + { + buttonIcon.ParentOrigin = NUI.ParentOrigin.Center; + buttonIcon.PivotPoint = NUI.PivotPoint.Center; + } } /// /// Theme change callback when theme is changed, this callback will be trigger. diff --git a/src/Tizen.NUI.Components/Controls/CheckBox.cs b/src/Tizen.NUI.Components/Controls/CheckBox.cs index 7418756..f73e962 100755 --- a/src/Tizen.NUI.Components/Controls/CheckBox.cs +++ b/src/Tizen.NUI.Components/Controls/CheckBox.cs @@ -29,6 +29,7 @@ namespace Tizen.NUI.Components /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public CheckBox() : base() { } + /// /// Creates a new instance of a CheckBox with style. /// @@ -37,13 +38,14 @@ namespace Tizen.NUI.Components /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public CheckBox(string style) : base(style) { } + /// /// Creates a new instance of a CheckBox with attributes. /// /// /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public CheckBox(SelectButtonStyle attrs) : base(attrs) { } + public CheckBox(ButtonStyle attrs) : base(attrs) { } /// /// Get CheckBoxGroup to which this CheckBox belong. diff --git a/src/Tizen.NUI.Components/Controls/CheckBoxGroup.cs b/src/Tizen.NUI.Components/Controls/CheckBoxGroup.cs index 47f7054..528084a 100755 --- a/src/Tizen.NUI.Components/Controls/CheckBoxGroup.cs +++ b/src/Tizen.NUI.Components/Controls/CheckBoxGroup.cs @@ -42,7 +42,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public CheckBoxGroup() : base() { - } /// @@ -79,7 +78,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public CheckBox GetItemByIndex(int index) + public CheckBox GetItem(int index) { return itemGroup[index] as CheckBox; } @@ -91,7 +90,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public int[] GetCheckedIndexArray() + public int[] GetCheckedIndices() { List selectedItemsList = new List(); for (int i = 0; i < itemGroup.Count; i++) @@ -113,7 +112,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public CheckBox[] GetCheckedItemArray() + public CheckBox[] GetCheckedItems() { List selectedList = new List(); @@ -154,7 +153,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public void CheckingAll(bool state) + public void CheckAll(bool state) { foreach (CheckBox cb in itemGroup) { diff --git a/src/Tizen.NUI.Components/Controls/Control.cs b/src/Tizen.NUI.Components/Controls/Control.cs index 0f361d5..6a9e174 100755 --- a/src/Tizen.NUI.Components/Controls/Control.cs +++ b/src/Tizen.NUI.Components/Controls/Control.cs @@ -18,6 +18,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; namespace Tizen.NUI.Components { @@ -29,9 +30,52 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public class Control : VisualView { - /// - /// Control style. - /// + /// BackgroundImageProperty + [EditorBrowsable(EditorBrowsableState.Never)] + public new static readonly BindableProperty BackgroundImageProperty = BindableProperty.Create("ControlBackgroundImage", typeof(Selector), typeof(Control), null, propertyChanged: (bindable, oldValue, newValue) => + { + var control = (Control)bindable; + if (null != newValue) + { + control.BackgroundImageSelector.Clone((Selector)newValue); + } + }, + defaultValueCreator: (bindable) => + { + var control = (Control)bindable; + return control.BackgroundImageSelector; + }); + /// BackgroundBorderProperty + [EditorBrowsable(EditorBrowsableState.Never)] + public new static readonly BindableProperty BackgroundImageBorderProperty = BindableProperty.Create("ControlBackgroundImageBorder", typeof(Selector), typeof(Control), default(Rectangle), propertyChanged: (bindable, oldValue, newValue) => + { + var control = (Control)bindable; + if (null != newValue) + { + control.backgroundImageBorderSelector.Clone((Selector)newValue); + } + }, + defaultValueCreator: (bindable) => + { + var control = (Control)bindable; + return control.backgroundImageBorderSelector; + }); + /// BackgroundColorProperty + [EditorBrowsable(EditorBrowsableState.Never)] + public new static readonly BindableProperty BackgroundColorProperty = BindableProperty.Create("ControlBackgroundColor", typeof(Selector), typeof(Control), null, propertyChanged: (bindable, oldValue, newValue) => + { + var control = (Control)bindable; + if (null != newValue) + { + control.BackgroundColorSelector.Clone((Selector)newValue); + } + }, + defaultValueCreator: (bindable) => + { + var control = (Control)bindable; + return control.BackgroundColorSelector; + }); + /// Control style. /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] @@ -71,41 +115,99 @@ namespace Tizen.NUI.Components } /// - /// Construct with style + /// Construct with styleSheet /// - /// Style to be applied + /// StyleSheet to be applied /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public Control(string style) : base() + public Control(string styleSheet) : base() { + ViewStyle viewStyle = StyleManager.Instance.GetAttributes(styleSheet); + if (viewStyle == null) + { + throw new InvalidOperationException($"There is no style {styleSheet}"); + } + + ApplyStyle(viewStyle); + this.style = styleSheet; + Initialize(style); } - public new Selector BackgroundImage + private TriggerableSelector _backgroundImageSelector; + private TriggerableSelector BackgroundImageSelector { get { - return Style.Background.ResourceUrl; - } - set - { - Style.Background.ResourceUrl = value; + if (null == _backgroundImageSelector) + { + _backgroundImageSelector = new TriggerableSelector(backgroundImage, ImageView.ResourceUrlProperty); + } + return _backgroundImageSelector; } } - - public Selector BackgroundBorder + private TriggerableSelector _backgroundImageBorderSelector; + private TriggerableSelector backgroundImageBorderSelector { get { - return Style.Background.Border; + if (null == _backgroundImageBorderSelector) + { + _backgroundImageBorderSelector = new TriggerableSelector(backgroundImage, ImageView.BorderProperty); + } + return _backgroundImageBorderSelector; } - set + } + private TriggerableSelector _backgroundColorSelector; + private TriggerableSelector BackgroundColorSelector + { + get { - Style.Background.Border = value; + if (null == _backgroundColorSelector) + { + _backgroundColorSelector = new TriggerableSelector(backgroundImage, View.BackgroundColorProperty); + } + return _backgroundColorSelector; } } + /// + /// Override view's BackgroundImage. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public new Selector BackgroundImage + { + get => (Selector)GetValue(BackgroundImageProperty); + set => SetValue(BackgroundImageProperty, value); + } + /// + /// Override view's BackgroundImageBorder. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public new Selector BackgroundImageBorder + { + get => (Selector)GetValue(BackgroundImageBorderProperty); + set => SetValue(BackgroundImageBorderProperty, value); + } + /// + /// Override view's BackgroundBorder. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public new Selector BackgroundColor + { + get => (Selector)GetValue(BackgroundColorProperty); + set => SetValue(BackgroundColorProperty, value); + } + + /// + /// Shadow image. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] public Selector ShadowImage { get @@ -118,6 +220,11 @@ namespace Tizen.NUI.Components } } + /// + /// Shadow image border. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] public Selector ShadowImageBorder { get @@ -139,19 +246,9 @@ namespace Tizen.NUI.Components /// Whether focusable when touch /// /// 6 - internal bool StateFocusableOnTouchMode - { - get; - set; - } + internal bool StateFocusableOnTouchMode { get; set; } - internal bool IsFocused - { - get - { - return isFocused || HasFocus(); - } - } + internal bool IsFocused => (isFocused || HasFocus()); /// /// Dispose Control and all children on it. @@ -249,21 +346,26 @@ namespace Tizen.NUI.Components { if (null == shadowImage) { - shadowImage = new ImageView(); + shadowImage = new ImageView() + { + WidthResizePolicy = ResizePolicyType.FillToParent, + HeightResizePolicy = ResizePolicyType.FillToParent, + }; this.Add(shadowImage); + shadowImage.LowerToBottom(); } shadowImage.ApplyStyle(controlStyle.Shadow); - } - if (null != controlStyle?.Background) - { if (null == backgroundImage) { - backgroundImage = new ImageView(); + backgroundImage = new ImageView() + { + WidthResizePolicy = ResizePolicyType.FillToParent, + HeightResizePolicy = ResizePolicyType.FillToParent, + }; this.Add(backgroundImage); } - backgroundImage.ApplyStyle(controlStyle.Background); } } @@ -275,9 +377,8 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - protected virtual void OnTapGestureDetected(object source, TapGestureDetector.DetectedEventArgs e) - { - } + protected virtual void OnTapGestureDetected(object source, TapGestureDetector.DetectedEventArgs e) { } + /// /// Called after a touch event is received by the owning view.
/// CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
@@ -301,6 +402,7 @@ namespace Tizen.NUI.Components protected virtual void OnUpdate() { } + /// /// Theme change callback when theme is changed, this callback will be trigger. /// @@ -309,16 +411,11 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - protected virtual void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e) - { - } + protected virtual void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e) { } /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - protected virtual void RegisterDetectionOfSubstyleChanges() - { - - } + protected virtual void RegisterDetectionOfSubstyleChanges() { } /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] @@ -330,6 +427,15 @@ namespace Tizen.NUI.Components private void Initialize(string style) { ControlState = ControlStates.Normal; + if(null == backgroundImage) + { + backgroundImage = new ImageView() + { + WidthResizePolicy = ResizePolicyType.FillToParent, + HeightResizePolicy = ResizePolicyType.FillToParent, + }; + this.Add(backgroundImage); + } RegisterDetectionOfSubstyleChanges(); diff --git a/src/Tizen.NUI.Components/Controls/DropDown.cs b/src/Tizen.NUI.Components/Controls/DropDown.cs index b946f60..419a0c4 100755 --- a/src/Tizen.NUI.Components/Controls/DropDown.cs +++ b/src/Tizen.NUI.Components/Controls/DropDown.cs @@ -393,6 +393,7 @@ namespace Tizen.NUI.Components button.ApplyStyle(Style.Button); headerText.ApplyStyle(Style.HeaderText); listBackgroundImage.ApplyStyle(Style.ListBackgroundImage); + UpdateDropDown(); } } @@ -419,12 +420,7 @@ namespace Tizen.NUI.Components } else if (listRelativeOrientation == ListOrientation.Right) { - int listWidth = 0; - if (dropDownMenuFullList.Size2D != null) - { - listWidth = dropDownMenuFullList.Size2D.Width; - } - listBackgroundImageX = Size2D.Width - listWidth - (int)listMargin.End; + listBackgroundImageX = -(int)listMargin.End; listBackgroundImageY = (int)listMargin.Top; } listBackgroundImage.Position2D = new Position2D(listBackgroundImageX, listBackgroundImageY); @@ -823,7 +819,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public Selector BackgroundColorSelector + public Selector BackgroundColor { get { @@ -1106,11 +1102,7 @@ namespace Tizen.NUI.Components { get { - if(mText == null) - { - return null; - } - return mText.Text; + return (null == mText) ? null : mText.Text; } set { @@ -1125,11 +1117,7 @@ namespace Tizen.NUI.Components { get { - if (mText == null) - { - return null; - } - return mText.FontFamily; + return (null == mText) ? null : mText.FontFamily; } set { @@ -1144,11 +1132,7 @@ namespace Tizen.NUI.Components { get { - if (mText == null) - { - return 0; - } - return mText.PointSize; + return (null == mText) ? 0 : mText.PointSize; } set { @@ -1163,11 +1147,7 @@ namespace Tizen.NUI.Components { get { - if (mText == null) - { - return null; - } - return mText.TextColor; + return (null == mText) ? null : mText.TextColor; } set { @@ -1182,11 +1162,7 @@ namespace Tizen.NUI.Components { get { - if (mText == null) - { - return null; - } - return mText.Position; + return (null == mText) ? null : mText.Position; } set { @@ -1201,11 +1177,7 @@ namespace Tizen.NUI.Components { get { - if (mIcon == null) - { - return null; - } - return mIcon.ResourceUrl; + return (null == mIcon) ? null : mIcon.ResourceUrl; } set { @@ -1220,11 +1192,7 @@ namespace Tizen.NUI.Components { get { - if (mIcon == null) - { - return null; - } - return mIcon.Size; + return (null == mIcon) ? null : mIcon.Size; } set { @@ -1239,11 +1207,7 @@ namespace Tizen.NUI.Components { get { - if (mIcon == null) - { - return null; - } - return mIcon.Position; + return (null == mIcon) ? null : mIcon.Position; } set { @@ -1258,11 +1222,7 @@ namespace Tizen.NUI.Components { get { - if (mCheck == null) - { - return null; - } - return mCheck.ResourceUrl; + return (null == mCheck) ? null : mCheck.ResourceUrl; } set { @@ -1277,11 +1237,7 @@ namespace Tizen.NUI.Components { get { - if (mCheck == null) - { - return null; - } - return mCheck.Position; + return (null == mCheck) ? null : mCheck.Position; } set { @@ -1296,11 +1252,7 @@ namespace Tizen.NUI.Components { get { - if (mCheck == null) - { - return null; - } - return mCheck.Size; + return (null == mCheck) ? null : mCheck.Size; } set { @@ -1315,11 +1267,7 @@ namespace Tizen.NUI.Components { get { - if (mCheck == null) - { - return false; - } - return mCheck.Visibility; + return (null == mCheck) ? false : mCheck.Visibility; } set { @@ -1545,7 +1493,7 @@ namespace Tizen.NUI.Components if (listItemView != null) { - listItemView.BackgroundColorSelector = listItemData.BackgroundColorSelector; + listItemView.BackgroundColorSelector = listItemData.BackgroundColor; if (listItemData.Text != null) { listItemView.Text = listItemData.Text; diff --git a/src/Tizen.NUI.Components/Controls/ImageControl.cs b/src/Tizen.NUI.Components/Controls/ImageControl.cs index df9fe41..18a017e 100755 --- a/src/Tizen.NUI.Components/Controls/ImageControl.cs +++ b/src/Tizen.NUI.Components/Controls/ImageControl.cs @@ -14,10 +14,9 @@ * limitations under the License. * */ -using System; -using System.Collections.Generic; using System.ComponentModel; using Tizen.NUI.BaseComponents; +using Tizen.NUI.Binding; namespace Tizen.NUI.Components { @@ -29,6 +28,37 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public class ImageControl : Control { + /// 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 ResourceUrlProperty = BindableProperty.Create("ImageControlResourceUrl", typeof(Selector), typeof(ImageControl), null, propertyChanged: (bindable, oldValue, newValue) => + { + var imageControl = (ImageControl)bindable; + if (null != newValue) + { + imageControl.ResourceUrlSelector.Clone((Selector)newValue); + } + }, + defaultValueCreator: (bindable) => + { + var imageControl = (ImageControl)bindable; + return imageControl.ResourceUrlSelector; + }); + /// 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 BorderProperty = BindableProperty.Create("ImageControlBorder", typeof(Selector), typeof(ImageControl), null, propertyChanged: (bindable, oldValue, newValue) => + { + var imageControl = (ImageControl)bindable; + if (null == newValue) + { + imageControl.BorderSelector.Clone((Selector)newValue); + } + }, + defaultValueCreator: (bindable) => + { + var imageControl = (ImageControl)bindable; + return imageControl.BorderSelector; + }); + /// /// Control style. /// @@ -51,6 +81,7 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public ImageControl() : base() { + Initialize(null); } /// @@ -62,6 +93,7 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public ImageControl(ImageControlStyle style) : base(style) { + Initialize(null); } /// @@ -73,6 +105,54 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public ImageControl(string style) : base(style) { + Initialize(style); + } + + /// + /// Override view's BackgroundImage. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public Selector ResourceUrl + { + get => (Selector)GetValue(ResourceUrlProperty); + set => SetValue(ResourceUrlProperty, value); + } + + /// + /// Override view's BackgroundImageBorder. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public Selector Border + { + get => (Selector)GetValue(BorderProperty); + set => SetValue(BorderProperty, value); + } + + private TriggerableSelector _resourceUrlSelector; + private TriggerableSelector ResourceUrlSelector + { + get + { + if (null == _resourceUrlSelector) + { + _resourceUrlSelector = new TriggerableSelector(imageView, ImageView.ResourceUrlProperty); + } + return _resourceUrlSelector; + } + } + private TriggerableSelector _borderSelector; + private TriggerableSelector BorderSelector + { + get + { + if (null == _borderSelector) + { + _borderSelector = new TriggerableSelector(imageView, ImageView.BorderProperty); + } + return _borderSelector; + } } /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -86,10 +166,16 @@ namespace Tizen.NUI.Components { if (null == imageView) { - imageView = new ImageView(); + imageView = new ImageView() + { + PositionUsesPivotPoint = true, + ParentOrigin = Tizen.NUI.ParentOrigin.Center, + PivotPoint = Tizen.NUI.PivotPoint.Center, + WidthResizePolicy = ResizePolicyType.UseNaturalSize, + HeightResizePolicy = ResizePolicyType.UseNaturalSize, + }; this.Add(imageView); } - imageView.ApplyStyle(imageControlStyle.Image); } } @@ -122,5 +208,21 @@ namespace Tizen.NUI.Components imageControlStyle = new ImageControlStyle(); return imageControlStyle; } + + private void Initialize(string style) + { + if (null == imageView) + { + imageView = new ImageView() + { + PositionUsesPivotPoint = true, + ParentOrigin = Tizen.NUI.ParentOrigin.Center, + PivotPoint = Tizen.NUI.PivotPoint.Center, + WidthResizePolicy = ResizePolicyType.UseNaturalSize, + HeightResizePolicy = ResizePolicyType.UseNaturalSize, + }; + this.Add(imageView); + } + } } } diff --git a/src/Tizen.NUI.Components/Controls/Popup.cs b/src/Tizen.NUI.Components/Controls/Popup.cs index 06a3d04..34041b5 100755 --- a/src/Tizen.NUI.Components/Controls/Popup.cs +++ b/src/Tizen.NUI.Components/Controls/Popup.cs @@ -197,9 +197,9 @@ namespace Tizen.NUI.Components var instance = (Popup)bindable; if (newValue != null) { - if (null != instance.Style?.Buttons?.Background) + if (null != instance.Style?.Buttons?.BackgroundImage) { - instance.Style.Buttons.Background.ResourceUrl = (string)newValue; + instance.Style.Buttons.BackgroundImage = (string)newValue; instance.UpdateButton(); } } @@ -207,7 +207,7 @@ namespace Tizen.NUI.Components defaultValueCreator: (bindable) => { var instance = (Popup)bindable; - return instance.Style.Buttons?.Background?.ResourceUrl?.All; + return instance.Style.Buttons?.BackgroundImage?.All; }); /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -217,9 +217,9 @@ namespace Tizen.NUI.Components var instance = (Popup)bindable; if (newValue != null) { - if (null != instance.Style?.Buttons?.Background) + if (null != instance.Style?.Buttons?.BackgroundImageBorder) { - instance.Style.Buttons.Background.Border = (Rectangle)newValue; + instance.Style.Buttons.BackgroundImageBorder = (Rectangle)newValue; instance.UpdateButton(); } } @@ -227,7 +227,7 @@ namespace Tizen.NUI.Components defaultValueCreator: (bindable) => { var instance = (Popup)bindable; - return instance.Style.Buttons?.Background?.Border?.All; + return instance.Style.Buttons?.BackgroundImageBorder?.All; }); private TextLabel titleText; diff --git a/src/Tizen.NUI.Components/Controls/RadioButton.cs b/src/Tizen.NUI.Components/Controls/RadioButton.cs index 872d20d..724905f 100755 --- a/src/Tizen.NUI.Components/Controls/RadioButton.cs +++ b/src/Tizen.NUI.Components/Controls/RadioButton.cs @@ -55,7 +55,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public RadioButton(SelectButtonStyle attrs) : base(attrs) { } + public RadioButton(ButtonStyle attrs) : base(attrs) { } /// /// Get RadioButtonGroup to which this selections belong. /// diff --git a/src/Tizen.NUI.Components/Controls/RadioButtonGroup.cs b/src/Tizen.NUI.Components/Controls/RadioButtonGroup.cs index 16b5bd7..6bab7ef 100755 --- a/src/Tizen.NUI.Components/Controls/RadioButtonGroup.cs +++ b/src/Tizen.NUI.Components/Controls/RadioButtonGroup.cs @@ -42,7 +42,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] public RadioButtonGroup() : base() { - } /// @@ -53,7 +52,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public RadioButton GetItemByIndex(int index) + public RadioButton GetItem(int index) { return itemGroup[index] as RadioButton; } @@ -71,7 +70,6 @@ namespace Tizen.NUI.Components radio.ItemGroup = this; } - /// /// Remove RadioButton from the RadioButtonGroup. /// diff --git a/src/Tizen.NUI.Components/Controls/Scrollbar.cs b/src/Tizen.NUI.Components/Controls/Scrollbar.cs index 5fbcf53..fe2be17 100755 --- a/src/Tizen.NUI.Components/Controls/Scrollbar.cs +++ b/src/Tizen.NUI.Components/Controls/Scrollbar.cs @@ -110,7 +110,7 @@ namespace Tizen.NUI.Components instance.Style.Duration = (uint)newValue; if (instance.scrollAniPlayer != null) { - instance.scrollAniPlayer.Duration = (int)instance.Style.Duration; + instance.scrollAniPlayer.Duration = (int)newValue; } } }, diff --git a/src/Tizen.NUI.Components/Controls/SelectButton.cs b/src/Tizen.NUI.Components/Controls/SelectButton.cs index dfea788..30c5e81 100755 --- a/src/Tizen.NUI.Components/Controls/SelectButton.cs +++ b/src/Tizen.NUI.Components/Controls/SelectButton.cs @@ -38,12 +38,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] protected SelectGroup itemGroup = null; - private ImageControl selectableImage; - - /// 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 new SelectButtonStyle Style => ViewStyle as SelectButtonStyle; - /// /// Creates a new instance of a SelectButton. /// @@ -74,7 +68,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public SelectButton(SelectButtonStyle style) : base(style) + public SelectButton(ButtonStyle style) : base(style) { Initialize(); } @@ -107,22 +101,6 @@ namespace Tizen.NUI.Components } /// - /// Theme change callback when theme is changed, this callback will be trigger. - /// - /// 6 - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e) - { - SelectButtonStyle selectButtonStyle = StyleManager.Instance.GetAttributes(style) as SelectButtonStyle; - if (null != selectButtonStyle) - { - Style?.CopyFrom(selectButtonStyle); - UpdateUIContent(); - } - } - - /// /// Dispose SelectButton and all children on it. /// /// Dispose type. @@ -138,25 +116,11 @@ namespace Tizen.NUI.Components if (type == DisposeTypes.Explicit) { - if (selectableImage != null) - { - Remove(selectableImage); - selectableImage.Dispose(); - selectableImage = null; - } } base.Dispose(type); } - private void UpdateUIContent() - { - UpdateTextAttributes(); - base.OnUpdate(); - - selectableImage?.RaiseToTop(); - } - /// /// Called after a key event is received by the view that has had its focus set. /// @@ -212,40 +176,6 @@ namespace Tizen.NUI.Components return ret; } - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public override void ApplyStyle(ViewStyle viewStyle) - { - base.ApplyStyle(viewStyle); - - SelectButtonStyle selectButtonStyle = viewStyle as SelectButtonStyle; - - if (null != selectButtonStyle) - { - if (selectableImage == null) - { - selectableImage = new ImageControl(); - selectableImage.Name = "SelectableImage"; - Add(selectableImage); - - selectableImage.RaiseToTop(); - } - - selectableImage.ApplyStyle(selectButtonStyle.SelectableImage); - } - } - - /// - /// Get SelectButton attribues. - /// - /// 6 - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - protected override ViewStyle GetViewStyle() - { - return new SelectButtonStyle(); - } - /// /// Overrides this method if want to handle behavior after pressing return key by user. /// @@ -259,103 +189,7 @@ namespace Tizen.NUI.Components private void Initialize() { if (null == Style) return; - if (null == selectableImage) - { - selectableImage = new ImageControl(); - selectableImage.Name = "SelectableImage"; - Add(selectableImage); - - selectableImage.RaiseToTop(); - } - - if (null == Style.SelectableImage) - { - Style.SelectableImage = new ImageControlStyle(); - } - Style.SelectableImage.PositionUsesPivotPoint = true; - Style.SelectableImage.ParentOrigin = NUI.ParentOrigin.TopLeft; - Style.SelectableImage.PivotPoint = NUI.PivotPoint.TopLeft; - Style.IsSelectable = true; - LayoutDirectionChanged += SelectButtonLayoutDirectionChanged; - } - - private void UpdateTextAttributes() - { - if (null == Style) return; - if (null == selectableImage) return; - if (null != Style.Text) - { - Style.Text.PositionUsesPivotPoint = true; - Style.Text.ParentOrigin = NUI.ParentOrigin.TopLeft; - Style.Text.PivotPoint = NUI.PivotPoint.TopLeft; - Style.Text.WidthResizePolicy = ResizePolicyType.Fixed; - Style.Text.HeightResizePolicy = ResizePolicyType.Fixed; - - int iconWidth = (int)selectableImage.SizeWidth; - - int textPaddingLeft = Style.Text.Padding?.Start ?? 0; - int textPaddingRight = Style.Text.Padding?.End ?? 0; - int imagePaddingStart = selectableImage.Padding?.Start ?? 0; - int imagePaddingEnd = selectableImage.Padding?.End ?? 0; - - if (null == Style.Text.Size && null != Size2D) - { - Style.Text.Size = new Size(Size2D.Width - iconWidth - imagePaddingStart - imagePaddingEnd - textPaddingLeft - textPaddingRight, Size2D.Height); - } - - if(null == Style.Text.Position) - { - Style.Text.Position = new Position(imagePaddingStart + iconWidth + imagePaddingEnd + textPaddingLeft, 0); - } - - Style.Text.VerticalAlignment = VerticalAlignment.Center; - } - } - - private void SelectButtonLayoutDirectionChanged(object sender, LayoutDirectionChangedEventArgs e) - { - if (null == Style || null == Style.Text) return; - if (null == selectableImage) return; - - UpdateTextAttributes(); - - int iconWidth = (int)selectableImage.SizeWidth; - - int textPaddingLeft = Style.Text.Padding?.Start ?? 0; - int textPaddingRight = Style.Text.Padding?.End ?? 0; - int pos = 0; - int sizeWidth = (int)(Style.Text.Size?.Width ?? 0); - if (null == Style.Text.Position) - { - Style.Text.Position = new Position(0, 0, 0); - } - if (LayoutDirection == ViewLayoutDirectionType.RTL) - { - Style.Text.HorizontalAlignment = HorizontalAlignment.End; - - Style.Text.Position.X = textPaddingRight; - pos = sizeWidth + textPaddingLeft + textPaddingRight; - if (null != Style.Icon?.Padding) - { - pos += Style.Icon.Padding.End; - } - } - else if (LayoutDirection == ViewLayoutDirectionType.LTR) - { - Style.Text.HorizontalAlignment = HorizontalAlignment.Begin; - Style.Text.Position.X = iconWidth + textPaddingLeft; - if (null != Style.Icon?.Padding) - { - Style.Text.Position.X += (Style.Icon.Padding.Start + Style.Icon.Padding.End); - pos = Style.Icon.Padding.Start; - } - } - if (null == selectableImage.Position2D) - { - selectableImage.Position2D = new Position2D(0, 0); - } - selectableImage.Position2D.X = pos; } private void OnSelect() diff --git a/src/Tizen.NUI.Components/Controls/SelectGroup.cs b/src/Tizen.NUI.Components/Controls/SelectGroup.cs index 1d724d7..96eb46b 100755 --- a/src/Tizen.NUI.Components/Controls/SelectGroup.cs +++ b/src/Tizen.NUI.Components/Controls/SelectGroup.cs @@ -46,13 +46,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public int Count - { - get - { - return itemGroup.Count; - } - } + public int Count => itemGroup.Count; /// /// Get the index of currently or latest selected item. @@ -60,13 +54,7 @@ namespace Tizen.NUI.Components /// 6 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public int SelectedIndex - { - get - { - return selectedIndex; - } - } + public int SelectedIndex => selectedIndex; /// /// Construct SelectionGroup @@ -139,7 +127,6 @@ namespace Tizen.NUI.Components itemGroup.Remove(selection); } - /// /// Overrides this method if want to handle behavior after pressing return key by user. /// @@ -149,7 +136,6 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] protected virtual void SelectionHandler(SelectButton selection) { - } private void OnSelectedEvent(object sender, SelectButton.SelectEventArgs args) diff --git a/src/Tizen.NUI.Components/Controls/Slider.cs b/src/Tizen.NUI.Components/Controls/Slider.cs index 159d6ea..8e73dea 100755 --- a/src/Tizen.NUI.Components/Controls/Slider.cs +++ b/src/Tizen.NUI.Components/Controls/Slider.cs @@ -33,8 +33,6 @@ namespace Tizen.NUI.Components private ImageView slidedTrackImage = null; // the thumb image object private ImageView thumbImage = null; - // the background thumb image object - private ImageView bgThumbImage = null; // the low indicator image object private ImageView lowIndicatorImage = null; // the high indicator image object @@ -762,7 +760,6 @@ namespace Tizen.NUI.Components thumbImage.TouchEvent -= OnTouchEventForThumb; Utility.Dispose(thumbImage); } - Utility.Dispose(bgThumbImage); Utility.Dispose(slidedTrackImage); if (null != bgTrackImage) { @@ -805,10 +802,10 @@ namespace Tizen.NUI.Components [EditorBrowsable(EditorBrowsableState.Never)] protected override void OnThemeChangedEvent(object sender, StyleManager.ThemeChangeEventArgs e) { - SliderStyle tempAttributes = StyleManager.Instance.GetAttributes(style) as SliderStyle; - if (tempAttributes != null) + SliderStyle sliderStyle = StyleManager.Instance.GetAttributes(style) as SliderStyle; + if (sliderStyle != null) { - Style.CopyFrom(tempAttributes); + Style?.CopyFrom(sliderStyle); RelayoutRequest(); } } @@ -845,11 +842,6 @@ namespace Tizen.NUI.Components { CreateThumbAttributes(); } - - if (null != sliderStyle.ThumbBackground) - { - CreateThumbBackgroundAttributes(); - } } private void Initialize() @@ -880,9 +872,9 @@ namespace Tizen.NUI.Components bgTrackImage.Add(slidedTrackImage); } - if (null != bgThumbImage) + if (null != thumbImage) { - slidedTrackImage.Add(bgThumbImage); + slidedTrackImage.Add(thumbImage); } } @@ -970,15 +962,15 @@ namespace Tizen.NUI.Components { thumbImage = new ImageView() { - WidthResizePolicy = ResizePolicyType.FillToParent, - HeightResizePolicy = ResizePolicyType.FillToParent, + WidthResizePolicy = ResizePolicyType.Fixed, + HeightResizePolicy = ResizePolicyType.Fixed, ParentOrigin = NUI.ParentOrigin.Center, PivotPoint = NUI.PivotPoint.Center, PositionUsesPivotPoint = true }; - if (bgThumbImage != null) + if (slidedTrackImage != null) { - bgThumbImage.Add(thumbImage); + slidedTrackImage.Add(thumbImage); } thumbImage.TouchEvent += OnTouchEventForThumb; @@ -995,35 +987,6 @@ namespace Tizen.NUI.Components thumbImage.ApplyStyle(Style.Thumb); } - private void CreateThumbBackgroundAttributes() - { - if (null == bgThumbImage) - { - bgThumbImage = new ImageView() - { - WidthResizePolicy = ResizePolicyType.Fixed, - HeightResizePolicy = ResizePolicyType.Fixed - }; - - if (slidedTrackImage != null) - { - slidedTrackImage.Add(bgThumbImage); - } - - if (null != thumbImage) - { - bgThumbImage.Add(thumbImage); - } - } - - if (null == Style.ThumbBackground) - { - Style.ThumbBackground= new ImageViewStyle(); - } - - bgThumbImage.ApplyStyle(Style.ThumbBackground); - } - private void OnPanGestureDetected(object source, PanGestureDetector.DetectedEventArgs e) { if (e.PanGesture.State == Gesture.StateType.Started) @@ -1076,11 +1039,11 @@ namespace Tizen.NUI.Components slidedTrackImage.PivotPoint = NUI.PivotPoint.CenterLeft; slidedTrackImage.PositionUsesPivotPoint = true; } - if (bgThumbImage != null) + if (thumbImage != null) { - bgThumbImage.ParentOrigin = NUI.ParentOrigin.CenterRight; - bgThumbImage.PivotPoint = NUI.PivotPoint.Center; - bgThumbImage.PositionUsesPivotPoint = true; + thumbImage.ParentOrigin = NUI.ParentOrigin.CenterRight; + thumbImage.PivotPoint = NUI.PivotPoint.Center; + thumbImage.PositionUsesPivotPoint = true; } if (lowIndicatorImage != null) { @@ -1123,11 +1086,11 @@ namespace Tizen.NUI.Components slidedTrackImage.PivotPoint = NUI.PivotPoint.BottomCenter; slidedTrackImage.PositionUsesPivotPoint = true; } - if (bgThumbImage != null) + if (thumbImage != null) { - bgThumbImage.ParentOrigin = NUI.ParentOrigin.TopCenter; - bgThumbImage.PivotPoint = NUI.PivotPoint.Center; - bgThumbImage.PositionUsesPivotPoint = true; + thumbImage.ParentOrigin = NUI.ParentOrigin.TopCenter; + thumbImage.PivotPoint = NUI.PivotPoint.Center; + thumbImage.PositionUsesPivotPoint = true; } if (lowIndicatorImage != null) { diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/ViewAttributes.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/ViewAttributes.cs index 1d3d49a..322a448 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/ViewAttributes.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/ViewAttributes.cs @@ -99,15 +99,16 @@ 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 BackgroundImageProperty = BindableProperty.Create("BackgroundImage", typeof(string), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty BackgroundImageSelectorProperty = BindableProperty.Create("BackgroundImageSelector", typeof(Selector), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var viewStyle = (ViewStyle)bindable; - viewStyle.backgroundImage = (string)newValue; + if (null == viewStyle.backgroundImageSelector) viewStyle.backgroundImageSelector = new Selector(); + viewStyle.backgroundImageSelector.Clone((Selector)newValue); }, defaultValueCreator: (bindable) => { var viewStyle = (ViewStyle)bindable; - return viewStyle.backgroundImage; + 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)] @@ -303,15 +304,16 @@ 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 OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector), typeof(ViewStyle), null, propertyChanged: (BindableProperty.BindingPropertyChangedDelegate)((bindable, oldValue, newValue) => + public static readonly BindableProperty OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var viewStyle = (ViewStyle)bindable; - viewStyle.OpacitySelector.Clone((Selector)newValue); - }), + if (null == viewStyle.opacitySelector) viewStyle.opacitySelector = new Selector(); + viewStyle.opacitySelector.Clone((Selector)newValue); + }, defaultValueCreator: (bindable) => { - var viewStyle = (ViewStyle)bindable; - return viewStyle.OpacitySelector; + 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. [EditorBrowsable(EditorBrowsableState.Never)] @@ -654,31 +656,11 @@ namespace Tizen.NUI.BaseComponents public static readonly BindableProperty PaddingProperty = BindableProperty.Create("Padding", typeof(Extents), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var viewStyle = (ViewStyle)bindable; - if (null == viewStyle.padding) - { - viewStyle.padding = new Extents((ushort start, ushort end, ushort top, ushort bottom) => - { - Extents extents = new Extents(start, end, top, bottom); - viewStyle.padding.CopyFrom(extents); - viewStyle.SetValue(PaddingProperty, extents); - }, 0, 0, 0, 0); - } - viewStyle.padding.CopyFrom((Extents)newValue); + viewStyle.padding = (Extents)newValue; }, defaultValueCreator: (bindable) => { var viewStyle = (ViewStyle)bindable; - - if (null == viewStyle.padding) - { - viewStyle.padding = new Extents((ushort start, ushort end, ushort top, ushort bottom) => - { - Extents extents = new Extents(start, end, top, bottom); - viewStyle.padding.CopyFrom(extents); - viewStyle.SetValue(PaddingProperty, extents); - }, 0, 0, 0, 0); - } - return viewStyle.padding; }); /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -775,17 +757,6 @@ namespace Tizen.NUI.BaseComponents defaultValueCreator: (bindable) => { var viewStyle = (ViewStyle)bindable; - - if (null == viewStyle.padding) - { - viewStyle.margin = new Extents((ushort start, ushort end, ushort top, ushort bottom) => - { - Extents extents = new Extents(start, end, top, bottom); - viewStyle.margin.CopyFrom(extents); - viewStyle.SetValue(MarginProperty, extents); - }, 0, 0, 0, 0); - } - return viewStyle.margin; }); /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -805,12 +776,26 @@ namespace Tizen.NUI.BaseComponents public static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => { var viewStyle = (ViewStyle)bindable; - viewStyle.BackgroundColorSelector.Clone((Selector)newValue); + if (null == viewStyle.backgroundColorSelector) viewStyle.backgroundColorSelector = new Selector(); + viewStyle.backgroundColorSelector.Clone((Selector)newValue); + }, + defaultValueCreator: (bindable) => + { + var viewStyle = (ViewStyle)bindable; + return viewStyle.backgroundColorSelector; + }); + /// 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 BackgroundImageBorderSelectorProperty = BindableProperty.Create("BackgroundImageBorderSelector", typeof(Selector), typeof(ViewStyle), null, propertyChanged: (bindable, oldValue, newValue) => + { + var viewStyle = (ViewStyle)bindable; + if (null == viewStyle.backgroundImageBorderSelector) viewStyle.backgroundImageBorderSelector = new Selector(); + viewStyle.backgroundImageBorderSelector.Clone((Selector)newValue); }, defaultValueCreator: (bindable) => { var viewStyle = (ViewStyle)bindable; - return viewStyle.BackgroundColorSelector; + return viewStyle.backgroundImageBorderSelector; }); /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -833,716 +818,386 @@ namespace Tizen.NUI.BaseComponents [EditorBrowsable(EditorBrowsableState.Never)] public string StyleName { - get - { - string temp = (string)GetValue(StyleNameProperty); - return temp; - } - set - { - SetValue(StyleNameProperty, value); - } + get => (string)GetValue(StyleNameProperty); + set => SetValue(StyleNameProperty, value); } + private Selector 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 string BackgroundImage + public Selector BackgroundImage { get { - string temp = (string)GetValue(BackgroundImageProperty); - return temp; - } - set - { - SetValue(BackgroundImageProperty, value); + Selector image = (Selector)GetValue(BackgroundImageSelectorProperty); + return (null != image) ? image : backgroundImageSelector = new Selector(); } + set => SetValue(BackgroundImageSelectorProperty, 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? State { - get - { - View.States? temp = (View.States?)GetValue(StateProperty); - return temp; - } - set - { - SetValue(StateProperty, value); - } + 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? temp = (View.States?)GetValue(SubStateProperty); - return temp; - } - set - { - SetValue(SubStateProperty, value); - } + 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? temp = (float?)GetValue(FlexProperty); - return temp; - } - set - { - SetValue(FlexProperty, value); - } + 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? temp = (int?)GetValue(AlignSelfProperty); - return temp; - } - set - { - SetValue(AlignSelfProperty, value); - } + 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 temp = (Vector4)GetValue(FlexMarginProperty); - return temp; - } - set - { - SetValue(FlexMarginProperty, value); - } + 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 temp = (Vector2)GetValue(CellIndexProperty); - return temp; - } - set - { - SetValue(CellIndexProperty, value); - } + 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? temp = (float?)GetValue(RowSpanProperty); - return temp; - } - set - { - SetValue(RowSpanProperty, value); - } + 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? temp = (float?)GetValue(ColumnSpanProperty); - return temp; - } - set - { - SetValue(ColumnSpanProperty, value); - } + 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? temp = (HorizontalAlignmentType?)GetValue(CellHorizontalAlignmentProperty); - return temp; - } - set - { - SetValue(CellHorizontalAlignmentProperty, value); - } + 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? temp = (VerticalAlignmentType?)GetValue(CellVerticalAlignmentProperty); - return temp; - } - set - { - SetValue(CellVerticalAlignmentProperty, value); - } + 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 temp = (View)GetValue(LeftFocusableViewProperty); - return temp; - } - set - { - SetValue(LeftFocusableViewProperty, value); - } + 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 temp = (View)GetValue(RightFocusableViewProperty); - return temp; - } - set - { - SetValue(RightFocusableViewProperty, value); - } + 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 temp = (View)GetValue(UpFocusableViewProperty); - return temp; - } - set - { - SetValue(UpFocusableViewProperty, value); - } + 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 temp = (View)GetValue(DownFocusableViewProperty); - return temp; - } - set - { - SetValue(DownFocusableViewProperty, value); - } + 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? temp = (bool?)GetValue(FocusableProperty); - return temp; - } - set - { - SetValue(FocusableProperty, value); - } + get => (bool?)GetValue(FocusableProperty); + set => SetValue(FocusableProperty, 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 Size2D Size2D { - get - { - Size2D temp = (Size2D)GetValue(Size2DProperty); - return temp; - } - set - { - SetValue(Size2DProperty, value); - } + get => (Size2D)GetValue(Size2DProperty); + set => SetValue(Size2DProperty, value); } private Selector opacitySelector; - private Selector OpacitySelector - { - get - { - if (null == opacitySelector) - { - opacitySelector = new Selector(); - } - return opacitySelector; - } - } /// 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 Opacity { get { - return (Selector)GetValue(OpacitySelectorProperty); - } - set - { - SetValue(OpacitySelectorProperty, value); + Selector opacity = (Selector)GetValue(OpacitySelectorProperty); + return (null != opacity) ? opacity : opacitySelector = new Selector(); } + set => SetValue(OpacitySelectorProperty, 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 Position2D Position2D { - get - { - Position2D temp = (Position2D)GetValue(Position2DProperty); - return temp; - } - set - { - SetValue(Position2DProperty, value); - } + get => (Position2D)GetValue(Position2DProperty); + set => SetValue(Position2DProperty, 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? PositionUsesPivotPoint { - get - { - bool? temp = (bool?)GetValue(PositionUsesPivotPointProperty); - return temp; - } - set - { - SetValue(PositionUsesPivotPointProperty, value); - } + get => (bool?)GetValue(PositionUsesPivotPointProperty); + set => SetValue(PositionUsesPivotPointProperty, 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? SiblingOrder { - get - { - int? temp = (int?)GetValue(SiblingOrderProperty); - return temp; - } - set - { - SetValue(SiblingOrderProperty, value); - } + 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 temp = (Position)GetValue(ParentOriginProperty); - return temp; - } - set - { - SetValue(ParentOriginProperty, value); - } + get => (Position)GetValue(ParentOriginProperty); + set => SetValue(ParentOriginProperty, 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 PivotPoint { - get - { - Position temp = (Position)GetValue(PivotPointProperty); - return temp; - } - set - { - SetValue(PivotPointProperty, value); - } + get => (Position)GetValue(PivotPointProperty); + set => SetValue(PivotPointProperty, 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? SizeWidth { - get - { - float? temp = (float?)GetValue(SizeWidthProperty); - return temp; - } - set - { - SetValue(SizeWidthProperty, value); - } + get => (float?)GetValue(SizeWidthProperty); + set => SetValue(SizeWidthProperty, 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? SizeHeight { - get - { - float? temp = (float?)GetValue(SizeHeightProperty); - return temp; - } - set - { - SetValue(SizeHeightProperty, value); - } + get => (float?)GetValue(SizeHeightProperty); + set => SetValue(SizeHeightProperty, 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 Position { - get - { - Position temp = (Position)GetValue(PositionProperty); - return temp; - } - set - { - SetValue(PositionProperty, value); - } + get => (Position)GetValue(PositionProperty); + set => SetValue(PositionProperty, 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? PositionX { - get - { - float? temp = (float?)GetValue(PositionXProperty); - return temp; - } - set - { - SetValue(PositionXProperty, value); - } + get => (float?)GetValue(PositionXProperty); + set => SetValue(PositionXProperty, 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? PositionY { - get - { - float? temp = (float?)GetValue(PositionYProperty); - return temp; - } - set - { - SetValue(PositionYProperty, value); - } + get => (float?)GetValue(PositionYProperty); + set => SetValue(PositionYProperty, 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? PositionZ { - get - { - float? temp = (float?)GetValue(PositionZProperty); - return temp; - } - set - { - SetValue(PositionZProperty, value); - } + 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 temp = (Rotation)GetValue(OrientationProperty); - return temp; - } - set - { - SetValue(OrientationProperty, value); - } + get => (Rotation)GetValue(OrientationProperty); + set => SetValue(OrientationProperty, 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 Vector3 Scale { - get - { - Vector3 temp = (Vector3)GetValue(ScaleProperty); - return temp; - } - set - { - SetValue(ScaleProperty, value); - } + 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? temp = (float?)GetValue(ScaleXProperty); - return temp; - } - set - { - SetValue(ScaleXProperty, value); - } + 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? temp = (float?)GetValue(ScaleYProperty); - return temp; - } - set - { - SetValue(ScaleYProperty, value); - } + 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? temp = (float?)GetValue(ScaleZProperty); - return temp; - } - set - { - SetValue(ScaleZProperty, value); - } + 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 temp = (string)GetValue(NameProperty); - return temp; - } - set - { - SetValue(NameProperty, value); - } + 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? temp = (bool?)GetValue(SensitiveProperty); - return temp; - } - set - { - SetValue(SensitiveProperty, value); - } + 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? temp = (bool?)GetValue(LeaveRequiredProperty); - return temp; - } - set - { - SetValue(LeaveRequiredProperty, value); - } + 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? temp = (bool?)GetValue(InheritOrientationProperty); - return temp; - } - set - { - SetValue(InheritOrientationProperty, value); - } + 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? temp = (bool?)GetValue(InheritScaleProperty); - return temp; - } - set - { - SetValue(InheritScaleProperty, value); - } + 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? temp = (DrawModeType?)GetValue(DrawModeProperty); - return temp; - } - set - { - SetValue(DrawModeProperty, value); - } + get => (DrawModeType?)GetValue(DrawModeProperty); + set => SetValue(DrawModeProperty, 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 Vector3 SizeModeFactor { - get - { - Vector3 temp = (Vector3)GetValue(SizeModeFactorProperty); - return temp; - } - set - { - SetValue(SizeModeFactorProperty, value); - } + get => (Vector3)GetValue(SizeModeFactorProperty); + set => SetValue(SizeModeFactorProperty, 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 ResizePolicyType? WidthResizePolicy { - get - { - ResizePolicyType? temp = (ResizePolicyType?)GetValue(WidthResizePolicyProperty); - return temp; - } - set - { - SetValue(WidthResizePolicyProperty, value); - } + get => (ResizePolicyType?)GetValue(WidthResizePolicyProperty); + set => SetValue(WidthResizePolicyProperty, 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 ResizePolicyType? HeightResizePolicy { - get - { - ResizePolicyType? temp = (ResizePolicyType?)GetValue(HeightResizePolicyProperty); - return temp; - } - set - { - SetValue(HeightResizePolicyProperty, value); - } + get => (ResizePolicyType?)GetValue(HeightResizePolicyProperty); + set => SetValue(HeightResizePolicyProperty, 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 SizeScalePolicyType? SizeScalePolicy { - get - { - SizeScalePolicyType? temp = (SizeScalePolicyType?)GetValue(SizeScalePolicyProperty); - return temp; - } - set - { - SetValue(SizeScalePolicyProperty, value); - } + 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? temp = (bool?)GetValue(WidthForHeightProperty); - return temp; - } - set - { - SetValue(WidthForHeightProperty, value); - } + get => (bool?)GetValue(WidthForHeightProperty); + set => SetValue(WidthForHeightProperty, 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? HeightForWidth { - get - { - bool? temp = (bool?)GetValue(HeightForWidthProperty); - return temp; - } - set - { - SetValue(HeightForWidthProperty, value); - } + get => (bool?)GetValue(HeightForWidthProperty); + set => SetValue(HeightForWidthProperty, value); } /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -1551,73 +1206,42 @@ namespace Tizen.NUI.BaseComponents { get { - Extents temp = (Extents)GetValue(PaddingProperty); - return temp; - } - set - { - SetValue(PaddingProperty, value); + Extents tmp = (Extents)GetValue(PaddingProperty); + return (null != tmp) ? tmp : padding = new Extents((ushort start, ushort end, ushort top, ushort bottom) => { Padding = new Extents(start, end, top, bottom); }, 0, 0, 0, 0); } + set => SetValue(PaddingProperty, 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 Size2D MinimumSize { - get - { - Size2D temp = (Size2D)GetValue(MinimumSizeProperty); - return temp; - } - set - { - SetValue(MinimumSizeProperty, value); - } + get => (Size2D)GetValue(MinimumSizeProperty); + set => SetValue(MinimumSizeProperty, 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 Size2D MaximumSize { - get - { - Size2D temp = (Size2D)GetValue(MaximumSizeProperty); - return temp; - } - set - { - SetValue(MaximumSizeProperty, value); - } + get => (Size2D)GetValue(MaximumSizeProperty); + set => SetValue(MaximumSizeProperty, 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? InheritPosition { - get - { - bool? temp = (bool?)GetValue(InheritPositionProperty); - return temp; - } - set - { - SetValue(InheritPositionProperty, value); - } + 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? temp = (ClippingModeType?)GetValue(ClippingModeProperty); - return temp; - } - set - { - SetValue(ClippingModeProperty, value); - } + get => (ClippingModeType?)GetValue(ClippingModeProperty); + set => SetValue(ClippingModeProperty, value); } /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -1626,43 +1250,26 @@ namespace Tizen.NUI.BaseComponents { get { - Size temp = (Size)GetValue(SizeProperty); - return temp; - } - set - { - SetValue(SizeProperty, value); + Size tmp = (Size)GetValue(SizeProperty); + return (null != tmp) ? tmp : size = new Size((float width, float height, float depth) => { Size = new Size(width, height, depth); }, 0, 0, 0); } + 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? temp = (bool?)GetValue(InheritLayoutDirectionProperty); - return temp; - } - set - { - SetValue(InheritLayoutDirectionProperty, value); - } + 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? temp = (ViewLayoutDirectionType?)GetValue(LayoutDirectionProperty); - return temp; - } - set - { - SetValue(LayoutDirectionProperty, value); - } + 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. @@ -1671,57 +1278,45 @@ namespace Tizen.NUI.BaseComponents { get { - Extents temp = (Extents)GetValue(MarginProperty); - return temp; - } - set - { - SetValue(MarginProperty, value); + Extents tmp = (Extents)GetValue(MarginProperty); + return (null != tmp) ? tmp : margin = new Extents((ushort start, ushort end, ushort top, ushort bottom) => { Margin = new Extents(start, end, top, bottom); }, 0, 0, 0, 0); } + 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? temp = (float?)GetValue(WeightProperty); - return temp; - } - set - { - SetValue(WeightProperty, value); - } + get => (float?)GetValue(WeightProperty); + set => SetValue(WeightProperty, value); } private Selector backgroundColorSelector; - private Selector BackgroundColorSelector + /// 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)] + public Selector BackgroundColor { get { - if (null == backgroundColorSelector) - { - backgroundColorSelector = new Selector(); - } - return backgroundColorSelector; + Selector color = (Selector)GetValue(BackgroundColorSelectorProperty); + return (null != color) ? color : backgroundColorSelector = new Selector(); } + set => SetValue(BackgroundColorSelectorProperty, value); } - /// - /// View BackgroundColor - /// + private Selector backgroundImageBorderSelector; + /// View BackgroundBorder /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public Selector BackgroundColor + public Selector BackgroundImageBorder { get { - return (Selector)GetValue(BackgroundColorSelectorProperty); - } - set - { - SetValue(BackgroundColorSelectorProperty, value); + Selector border = (Selector)GetValue(BackgroundImageBorderSelectorProperty); + return (null != border) ? border : backgroundImageBorderSelector = new Selector(); } + set => SetValue(BackgroundImageBorderSelectorProperty, value); } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 5f3e063..9b7a9dd 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -57,6 +57,7 @@ namespace Tizen.NUI.BaseComponents private bool _backgroundImageSynchronosLoading = false; private Dictionary transDictionary = new Dictionary(); private string[] transitionNames; + private Rectangle backgroundImageBorder; internal Size2D sizeSetExplicitly = new Size2D(); // Store size set by API, will be used in place of NaturalSize if not set. @@ -168,9 +169,12 @@ namespace Tizen.NUI.BaseComponents ControlStateChangeEvent?.Invoke(this, value); - foreach (View child in Children) + if (true == OnControlStateChanged(value)) { - child.ControlState = value; + foreach (View child in Children) + { + child.ControlState = value; + } } } } @@ -256,6 +260,24 @@ namespace Tizen.NUI.BaseComponents } /// + /// Get or set the border of background image. + /// + /// 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 Rectangle BackgroundImageBorder + { + get + { + return (Rectangle)GetValue(BackgroundImageBorderProperty); + } + set + { + SetValue(BackgroundImageBorderProperty, value); + NotifyPropertyChanged(); + } + } + + /// /// The background of view. /// /// 3 @@ -2161,7 +2183,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Get attribues, it is abstract function and must be override. + /// Get Style, it is abstract function and must be override. /// /// 6 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -2172,6 +2194,35 @@ namespace Tizen.NUI.BaseComponents return 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)] + protected virtual bool OnControlStateChanged(ControlStates currentState) + { + //If need to apply the state to all child, return true; + return true; + } + internal static readonly BindableProperty BackgroundImageSelectorProperty = BindableProperty.Create("BackgroundImageSelector", typeof(Selector), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + view.backgroundImageSelector.Clone((Selector)newValue); + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + return view.backgroundImageSelector; + }); + private TriggerableSelector _backgroundImageSelector; + private TriggerableSelector backgroundImageSelector + { + get + { + if (null == _backgroundImageSelector) + { + _backgroundImageSelector = new TriggerableSelector(this, BackgroundImageProperty); + } + return _backgroundImageSelector; + } + } internal static readonly BindableProperty BackgroundColorSelectorProperty = BindableProperty.Create("BackgroundColorSelector", typeof(Selector), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => { var view = (View)bindable; @@ -2194,7 +2245,28 @@ namespace Tizen.NUI.BaseComponents return _backgroundColorSelector; } } - + internal static readonly BindableProperty BackgroundImageBorderSelectorProperty = BindableProperty.Create("BackgroundImageBorderSelector", typeof(Selector), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + view.backgroundImageBorderSelector.Clone((Selector)newValue); + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + return view.backgroundImageBorderSelector; + }); + private TriggerableSelector _backgroundImageBorderSelector; + private TriggerableSelector backgroundImageBorderSelector + { + get + { + if (null == _backgroundImageBorderSelector) + { + _backgroundImageBorderSelector = new TriggerableSelector(this, BackgroundImageBorderProperty); + } + return _backgroundImageBorderSelector; + } + } internal static readonly BindableProperty OpacitySelectorProperty = BindableProperty.Create("OpacitySelector", typeof(Selector), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => { var view = (View)bindable; diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs index 377c1cb..55cc478 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs @@ -74,9 +74,7 @@ namespace Tizen.NUI.BaseComponents return backgroundColor; }); - /// - /// BackgroundImageProperty - /// + /// BackgroundImageProperty [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty BackgroundImageProperty = BindableProperty.Create("BackgroundImage", typeof(string), typeof(View), default(string), propertyChanged: (bindable, oldValue, newValue) => { @@ -102,7 +100,21 @@ namespace Tizen.NUI.BaseComponents return backgroundImage; }); - + /// BackgroundImageBorderProperty + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty BackgroundImageBorderProperty = BindableProperty.Create(nameof(BackgroundImageBorder), typeof(Rectangle), typeof(View), default(Rectangle), propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (null != newValue) + { + view.backgroundImageBorder = (Rectangle)newValue; + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + return view.backgroundImageBorder; + }); /// /// BackgroundProperty /// -- 2.7.4