X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.NUI%2Fsrc%2Fpublic%2FBaseComponents%2FStyle%2FTextLabelStyle.cs;h=ef3d29894f64cb967505f5f694ce777c400d7907;hb=4389bdc8eb5a4ad3852956870d0dfe119d8e04ef;hp=f478ea315a9c6c73487dcbef874218f44ba8d7c1;hpb=8ccbeaa9613a79c6d6c61b6e3b201666ac31e6de;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git diff --git a/src/Tizen.NUI/src/public/BaseComponents/Style/TextLabelStyle.cs b/src/Tizen.NUI/src/public/BaseComponents/Style/TextLabelStyle.cs index f478ea3..ef3d298 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Style/TextLabelStyle.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Style/TextLabelStyle.cs @@ -31,66 +31,51 @@ namespace Tizen.NUI.BaseComponents [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create("TranslatableTextSelector", typeof(Selector), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { - var textFieldStyle = (TextLabelStyle)bindable; - if (null == textFieldStyle.translatableTextSelector) textFieldStyle.translatableTextSelector = new Selector(); - textFieldStyle.translatableTextSelector.Clone(null == newValue ? new Selector() : (Selector)newValue); + ((TextLabelStyle)bindable).translatableTextSelector = ((Selector)newValue)?.Clone(); }, defaultValueCreator: (bindable) => { - var textFieldStyle = (TextLabelStyle)bindable; - return textFieldStyle.translatableTextSelector; + return ((TextLabelStyle)bindable).translatableTextSelector; }); /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty TextSelectorProperty = BindableProperty.Create("TextSelector", typeof(Selector), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { - var textFieldStyle = (TextLabelStyle)bindable; - if (null == textFieldStyle.textSelector) textFieldStyle.textSelector = new Selector(); - textFieldStyle.textSelector.Clone(null == newValue ? new Selector() : (Selector)newValue); + ((TextLabelStyle)bindable).textSelector = ((Selector)newValue)?.Clone(); }, defaultValueCreator: (bindable) => { - var textFieldStyle = (TextLabelStyle)bindable; - return textFieldStyle.textSelector; + return ((TextLabelStyle)bindable).textSelector; }); /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty FontFamilySelectorProperty = BindableProperty.Create("FontFamilySelector", typeof(Selector), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { - var textFieldStyle = (TextLabelStyle)bindable; - if (null == textFieldStyle.fontFamilySelector) textFieldStyle.fontFamilySelector = new Selector(); - textFieldStyle.fontFamilySelector.Clone(null == newValue ? new Selector() : (Selector)newValue); + ((TextLabelStyle)bindable).fontFamilySelector = ((Selector)newValue)?.Clone(); }, defaultValueCreator: (bindable) => { - var textFieldStyle = (TextLabelStyle)bindable; - return textFieldStyle.fontFamilySelector; + return ((TextLabelStyle)bindable).fontFamilySelector; }); /// 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 PointSizeSelectorProperty = BindableProperty.Create("PointSizeSelector", typeof(Selector), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { - var textFieldStyle = (TextLabelStyle)bindable; - if (null == textFieldStyle.pointSizeSelector) textFieldStyle.pointSizeSelector = new Selector(); - textFieldStyle.pointSizeSelector.Clone(null == newValue ? new Selector() : (Selector)newValue); + ((TextLabelStyle)bindable).pointSizeSelector = ((Selector)newValue)?.Clone(); }, defaultValueCreator: (bindable) => { - var textFieldStyle = (TextLabelStyle)bindable; - return textFieldStyle.pointSizeSelector; + return ((TextLabelStyle)bindable).pointSizeSelector; }); /// 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 TextColorSelectorProperty = BindableProperty.Create("TextColorSelector", typeof(Selector), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { - var textFieldStyle = (TextLabelStyle)bindable; - if (null == textFieldStyle.textColorSelector) textFieldStyle.textColorSelector = new Selector(); - textFieldStyle.textColorSelector.Clone(null == newValue ? new Selector() : (Selector)newValue); + ((TextLabelStyle)bindable).textColorSelector = ((Selector)newValue)?.Clone(); }, defaultValueCreator: (bindable) => { - var textFieldStyle = (TextLabelStyle)bindable; - return textFieldStyle.textColorSelector; + return ((TextLabelStyle)bindable).textColorSelector; }); /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. @@ -299,15 +284,13 @@ namespace Tizen.NUI.BaseComponents }); /// A BindableProperty for ImageShadow [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TextShadowProperty = BindableProperty.Create(nameof(TextShadow), typeof(Selector), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty TextShadowProperty = BindableProperty.Create("TextShadowSelector", typeof(Selector), typeof(TextLabelStyle), null, propertyChanged: (bindable, oldValue, newValue) => { - var textLabelStyle = (TextLabelStyle)bindable; - textLabelStyle.textShadow = SelectorHelper.CopyCloneable(newValue); + ((TextLabelStyle)bindable).textShadow = ((Selector)newValue)?.Clone(); }, defaultValueCreator: (bindable) => { - var textLabelStyle = (TextLabelStyle)bindable; - return textLabelStyle.textShadow; + return ((TextLabelStyle)bindable).textShadow; }); private bool? multiLine; @@ -336,6 +319,23 @@ namespace Tizen.NUI.BaseComponents static TextLabelStyle() { } + /// + /// Create an empty instance. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public TextLabelStyle() + { + } + + /// + /// Create an instance and set properties from the given TextLabel. + /// + /// The TextLabel instance that includes property data. + [EditorBrowsable(EditorBrowsableState.Never)] + public TextLabelStyle(TextLabel textLabel) : base(textLabel) + { + } + /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public Selector TranslatableText