From: Fang Xiaohui Date: Thu, 2 Dec 2021 02:47:09 +0000 (+0800) Subject: [NUI] Fix failed in TCT X-Git-Tag: accepted/tizen/unified/20231205.024657~1281 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c810bbe47e52051c459771270e44a68ae11e2f4;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Fix failed in TCT --- diff --git a/src/Tizen.NUI.Components/Controls/Button.cs b/src/Tizen.NUI.Components/Controls/Button.cs index d6e8305..07eb119 100755 --- a/src/Tizen.NUI.Components/Controls/Button.cs +++ b/src/Tizen.NUI.Components/Controls/Button.cs @@ -607,7 +607,7 @@ namespace Tizen.NUI.Components } private StringSelector InternalTextSelector { - get => buttonText == null ? null : new StringSelector(buttonText.TextSelector); + get => buttonText?.TextSelector == null ? null : new StringSelector(buttonText.TextSelector); set { if (value == null || buttonText == null) @@ -641,7 +641,7 @@ namespace Tizen.NUI.Components } private StringSelector InternalTranslatableTextSelector { - get => buttonText == null ? null : new StringSelector(buttonText.TranslatableTextSelector); + get => (buttonText?.TranslatableTextSelector == null) ? null : new StringSelector(buttonText.TranslatableTextSelector); set { if (value == null || buttonText == null) @@ -675,7 +675,7 @@ namespace Tizen.NUI.Components } private ColorSelector InternalTextColorSelector { - get => buttonText == null ? null : new ColorSelector(buttonText.TextColorSelector); + get => buttonText?.TextColorSelector == null ? null : new ColorSelector(buttonText.TextColorSelector); set { if (value == null || buttonText == null) @@ -709,7 +709,7 @@ namespace Tizen.NUI.Components } private FloatSelector InternalPointSizeSelector { - get => buttonText == null ? null : new FloatSelector(buttonText.PointSizeSelector); + get => buttonText?.PointSizeSelector == null ? null : new FloatSelector(buttonText.PointSizeSelector); set { if (value == null || buttonText == null) @@ -743,7 +743,7 @@ namespace Tizen.NUI.Components } private StringSelector InternalIconURLSelector { - get => buttonIcon == null ? null : new StringSelector(buttonIcon.ResourceUrlSelector); + get => buttonIcon?.ResourceUrlSelector == null ? null : new StringSelector(buttonIcon.ResourceUrlSelector); set { if (value == null || buttonIcon == null) diff --git a/src/Tizen.NUI.Components/Controls/ButtonBindableProperty.cs b/src/Tizen.NUI.Components/Controls/ButtonBindableProperty.cs index 9c35857..b1f5832 100755 --- a/src/Tizen.NUI.Components/Controls/ButtonBindableProperty.cs +++ b/src/Tizen.NUI.Components/Controls/ButtonBindableProperty.cs @@ -156,10 +156,7 @@ namespace Tizen.NUI.Components public static readonly BindableProperty TextSelectorProperty = BindableProperty.Create(nameof(TextSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) => { var instance = (Button)bindable; - if (newValue != null) - { - instance.InternalTextSelector = newValue as StringSelector; - } + instance.InternalTextSelector = newValue as StringSelector; }, defaultValueCreator: (bindable) => { @@ -174,10 +171,7 @@ namespace Tizen.NUI.Components public static readonly BindableProperty TranslatableTextSelectorProperty = BindableProperty.Create(nameof(TranslatableTextSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) => { var instance = (Button)bindable; - if (newValue != null) - { - instance.InternalTranslatableTextSelector = newValue as StringSelector; - } + instance.InternalTranslatableTextSelector = newValue as StringSelector; }, defaultValueCreator: (bindable) => { @@ -192,10 +186,7 @@ namespace Tizen.NUI.Components public static readonly BindableProperty TextColorSelectorProperty = BindableProperty.Create(nameof(TextColorSelector), typeof(ColorSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) => { var instance = (Button)bindable; - if (newValue != null) - { - instance.InternalTextColorSelector = newValue as ColorSelector; - } + instance.InternalTextColorSelector = newValue as ColorSelector; }, defaultValueCreator: (bindable) => { @@ -210,10 +201,7 @@ namespace Tizen.NUI.Components public static readonly BindableProperty PointSizeSelectorProperty = BindableProperty.Create(nameof(PointSizeSelector), typeof(FloatSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) => { var instance = (Button)bindable; - if (newValue != null) - { - instance.InternalPointSizeSelector = newValue as FloatSelector; - } + instance.InternalPointSizeSelector = newValue as FloatSelector; }, defaultValueCreator: (bindable) => { @@ -228,10 +216,7 @@ namespace Tizen.NUI.Components public static readonly BindableProperty IconURLSelectorProperty = BindableProperty.Create(nameof(IconURLSelector), typeof(StringSelector), typeof(Button), null, propertyChanged: (bindable, oldValue, newValue) => { var instance = (Button)bindable; - if (newValue != null) - { - instance.InternalIconURLSelector = newValue as StringSelector; - } + instance.InternalIconURLSelector = newValue as StringSelector; }, defaultValueCreator: (bindable) => {