From: huayong.xu Date: Fri, 7 Mar 2025 02:20:54 +0000 (+0800) Subject: [NUI] Remove boxing/unboxing in ScrollableBase, etc. X-Git-Tag: submit/tizen/20250312.043201~1^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff92f94aff18aa539611e8d80d379fb40a19dec5;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Remove boxing/unboxing in ScrollableBase, etc. --- diff --git a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs index 0050cae56..179fd3c3f 100755 --- a/src/Tizen.NUI.Components/Controls/ScrollableBase.cs +++ b/src/Tizen.NUI.Components/Controls/ScrollableBase.cs @@ -265,7 +265,7 @@ namespace Tizen.NUI.Components } else { - return (Direction)GetInternalScrollingDirectionProperty(this); + return InternalScrollingDirection; } } set @@ -276,7 +276,7 @@ namespace Tizen.NUI.Components } else { - SetInternalScrollingDirectionProperty(this, null, value); + InternalScrollingDirection = value; } NotifyPropertyChanged(); } @@ -320,7 +320,7 @@ namespace Tizen.NUI.Components } else { - return (bool)GetInternalScrollEnabledProperty(this); + return InternalScrollEnabled; } } set @@ -331,7 +331,7 @@ namespace Tizen.NUI.Components } else { - SetInternalScrollEnabledProperty(this, null, value); + InternalScrollEnabled = value; } NotifyPropertyChanged(); } @@ -383,7 +383,7 @@ namespace Tizen.NUI.Components } else { - return (bool)GetInternalSnapToPageProperty(this); + return InternalSnapToPage; } } set @@ -394,7 +394,7 @@ namespace Tizen.NUI.Components } else { - SetInternalSnapToPageProperty(this, null, value); + InternalSnapToPage = value; } NotifyPropertyChanged(); } @@ -423,7 +423,7 @@ namespace Tizen.NUI.Components } else { - return (int)GetInternalScrollDurationProperty(this); + return InternalScrollDuration; } } set @@ -434,7 +434,7 @@ namespace Tizen.NUI.Components } else { - SetInternalScrollDurationProperty(this, null, value); + InternalScrollDuration = value; } NotifyPropertyChanged(); } @@ -465,7 +465,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalScrollAvailableAreaProperty(this) as Vector2; + return InternalScrollAvailableArea; } } set @@ -476,7 +476,7 @@ namespace Tizen.NUI.Components } else { - SetInternalScrollAvailableAreaProperty(this, null, value); + InternalScrollAvailableArea = value; } NotifyPropertyChanged(); } @@ -533,7 +533,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalScrollbarProperty(this) as ScrollbarBase; + return InternalScrollbar; } } set @@ -544,7 +544,7 @@ namespace Tizen.NUI.Components } else { - SetInternalScrollbarProperty(this, null, value); + InternalScrollbar = value; } NotifyPropertyChanged(); } @@ -596,7 +596,7 @@ namespace Tizen.NUI.Components } else { - return (bool)GetInternalHideScrollbarProperty(this); + return InternalHideScrollbar; } } set @@ -607,7 +607,7 @@ namespace Tizen.NUI.Components } else { - SetInternalHideScrollbarProperty(this, null, value); + InternalHideScrollbar = value; } NotifyPropertyChanged(); } @@ -657,7 +657,7 @@ namespace Tizen.NUI.Components } else { - return (bool)GetInternalFadeScrollbarProperty(this); + return InternalFadeScrollbar; } } set @@ -668,7 +668,7 @@ namespace Tizen.NUI.Components } else { - SetInternalFadeScrollbarProperty(this, null, value); + InternalFadeScrollbar = value; } } } @@ -719,7 +719,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalLayoutProperty(this) as LayoutItem; + return InternalLayout; } } set @@ -730,7 +730,7 @@ namespace Tizen.NUI.Components } else { - SetInternalLayoutProperty(this, null, value); + InternalLayout = value; } NotifyPropertyChanged(); } @@ -775,7 +775,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalDecelerationRateProperty(this); + return InternalDecelerationRate; } } set @@ -786,7 +786,7 @@ namespace Tizen.NUI.Components } else { - SetInternalDecelerationRateProperty(this, null, value); + InternalDecelerationRate = value; } NotifyPropertyChanged(); } @@ -818,7 +818,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalDecelerationThresholdProperty(this); + return InternalDecelerationThreshold; } } set @@ -829,7 +829,7 @@ namespace Tizen.NUI.Components } else { - SetInternalDecelerationThresholdProperty(this, null, value); + InternalDecelerationThreshold = value; } NotifyPropertyChanged(); } @@ -853,7 +853,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalScrollingEventThresholdProperty(this); + return InternalScrollingEventThreshold; } } set @@ -864,7 +864,7 @@ namespace Tizen.NUI.Components } else { - SetInternalScrollingEventThresholdProperty(this, null, value); + InternalScrollingEventThreshold = value; } NotifyPropertyChanged(); } @@ -902,7 +902,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalPageFlickThresholdProperty(this); + return InternalPageFlickThreshold; } } set @@ -913,7 +913,7 @@ namespace Tizen.NUI.Components } else { - SetInternalPageFlickThresholdProperty(this, null, value); + InternalPageFlickThreshold = value; } NotifyPropertyChanged(); } @@ -944,7 +944,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalPaddingProperty(this) as Extents; + return InternalPadding; } } set @@ -955,7 +955,7 @@ namespace Tizen.NUI.Components } else { - SetInternalPaddingProperty(this, null, value); + InternalPadding = value; } NotifyPropertyChanged(); } @@ -986,7 +986,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalScrollAlphaFunctionProperty(this) as AlphaFunction; + return InternalScrollAlphaFunction; } } set @@ -997,7 +997,7 @@ namespace Tizen.NUI.Components } else { - SetInternalScrollAlphaFunctionProperty(this, null, value); + InternalScrollAlphaFunction = value; } NotifyPropertyChanged(); } @@ -1033,7 +1033,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalNoticeAnimationEndBeforePositionProperty(this); + return InternalNoticeAnimationEndBeforePosition; } } set @@ -1044,7 +1044,7 @@ namespace Tizen.NUI.Components } else { - SetInternalNoticeAnimationEndBeforePositionProperty(this, null, value); + InternalNoticeAnimationEndBeforePosition = value; } NotifyPropertyChanged(); } @@ -1074,7 +1074,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalStepScrollDistanceProperty(this); + return stepScrollDistance; } } set @@ -1085,7 +1085,7 @@ namespace Tizen.NUI.Components } else { - SetInternalStepScrollDistanceProperty(this, null, value); + stepScrollDistance = value; } NotifyPropertyChanged(); } @@ -1107,7 +1107,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalWheelScrollDistanceProperty(this); + return wheelScrollDistance; } } set @@ -1118,7 +1118,7 @@ namespace Tizen.NUI.Components } else { - SetInternalWheelScrollDistanceProperty(this, null, value); + wheelScrollDistance = value; } NotifyPropertyChanged(); } @@ -1781,7 +1781,7 @@ namespace Tizen.NUI.Components } else { - return (bool)GetInternalEnableOverShootingEffectProperty(this); + return InternalEnableOverShootingEffect; } } set @@ -1792,7 +1792,7 @@ namespace Tizen.NUI.Components } else { - SetInternalEnableOverShootingEffectProperty(this, null, value); + InternalEnableOverShootingEffect = value; } NotifyPropertyChanged(); } diff --git a/src/Tizen.NUI.Components/Controls/ScrollableBaseBindableProperty.cs b/src/Tizen.NUI.Components/Controls/ScrollableBaseBindableProperty.cs index 00f21fe3a..1e063ab72 100755 --- a/src/Tizen.NUI.Components/Controls/ScrollableBaseBindableProperty.cs +++ b/src/Tizen.NUI.Components/Controls/ScrollableBaseBindableProperty.cs @@ -12,9 +12,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty ScrollingDirectionProperty = null; internal static void SetInternalScrollingDirectionProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalScrollingDirection = (Direction)newValue; } } @@ -31,9 +31,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty ScrollEnabledProperty = null; internal static void SetInternalScrollEnabledProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalScrollEnabled = (bool)newValue; } } @@ -50,9 +50,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty SnapToPageProperty = null; internal static void SetInternalSnapToPageProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalSnapToPage = (bool)newValue; } } @@ -69,9 +69,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty ScrollDurationProperty = null; internal static void SetInternalScrollDurationProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalScrollDuration = (int)newValue; } } @@ -88,9 +88,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty ScrollAvailableAreaProperty = null; internal static void SetInternalScrollAvailableAreaProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalScrollAvailableArea = newValue as Vector2; } } @@ -107,9 +107,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty ScrollbarProperty = null; internal static void SetInternalScrollbarProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalScrollbar = newValue as ScrollbarBase; } } @@ -126,9 +126,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty HideScrollbarProperty = null; internal static void SetInternalHideScrollbarProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalHideScrollbar = (bool)newValue; } } @@ -145,9 +145,9 @@ namespace Tizen.NUI.Components public static readonly new BindableProperty LayoutProperty = null; internal static new void SetInternalLayoutProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalLayout = newValue as LayoutItem; } } @@ -164,9 +164,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty DecelerationRateProperty = null; internal static void SetInternalDecelerationRateProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalDecelerationRate = (float)newValue; } } @@ -183,9 +183,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty DecelerationThresholdProperty = null; internal static void SetInternalDecelerationThresholdProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalDecelerationThreshold = (float)newValue; } } @@ -202,9 +202,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty ScrollingEventThresholdProperty = null; internal static void SetInternalScrollingEventThresholdProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalScrollingEventThreshold = (float)newValue; } } @@ -221,9 +221,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty PageFlickThresholdProperty = null; internal static void SetInternalPageFlickThresholdProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalPageFlickThreshold = (float)newValue; } } @@ -240,9 +240,9 @@ namespace Tizen.NUI.Components public static readonly new BindableProperty PaddingProperty = null; internal static new void SetInternalPaddingProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalPadding = newValue as Extents; } } @@ -259,9 +259,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty ScrollAlphaFunctionProperty = null; internal static void SetInternalScrollAlphaFunctionProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalScrollAlphaFunction = newValue as AlphaFunction; } } @@ -278,9 +278,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty NoticeAnimationEndBeforePositionProperty = null; internal static void SetInternalNoticeAnimationEndBeforePositionProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalNoticeAnimationEndBeforePosition = (float)newValue; } } @@ -297,9 +297,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty EnableOverShootingEffectProperty = null; internal static void SetInternalEnableOverShootingEffectProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalEnableOverShootingEffect = (bool)newValue; } } @@ -316,9 +316,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty StepScrollDistanceProperty = null; internal static void SetInternalStepScrollDistanceProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.stepScrollDistance = (float)newValue; } } @@ -335,9 +335,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty WheelScrollDistanceProperty = null; internal static void SetInternalWheelScrollDistanceProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.wheelScrollDistance = (float)newValue; } } @@ -354,9 +354,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty FadeScrollbarProperty = null; internal static void SetInternalFadeScrollbarProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (ScrollableBase)bindable; if (newValue != null) { + var instance = (ScrollableBase)bindable; instance.InternalFadeScrollbar = (bool)newValue; } } diff --git a/src/Tizen.NUI.Components/Controls/Scrollbar.cs b/src/Tizen.NUI.Components/Controls/Scrollbar.cs index ca4f55285..aaccd25ea 100755 --- a/src/Tizen.NUI.Components/Controls/Scrollbar.cs +++ b/src/Tizen.NUI.Components/Controls/Scrollbar.cs @@ -90,6 +90,7 @@ namespace Tizen.NUI.Components } internal static object GetInternalTrackPaddingProperty(BindableObject bindable) { + //NOTE: the type of trackPadding is not Extents. return ((Scrollbar)bindable).trackPadding; } @@ -212,7 +213,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalTrackThicknessProperty(this); + return trackThickness; } } set @@ -223,7 +224,7 @@ namespace Tizen.NUI.Components } else { - SetInternalTrackThicknessProperty(this, null, value); + UpdateTrackThickness(value); } } } @@ -242,7 +243,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalThumbThicknessProperty(this); + return thumbThickness; } } set @@ -253,7 +254,7 @@ namespace Tizen.NUI.Components } else { - SetInternalThumbThicknessProperty(this, null, value); + UpdateThumbThickness(value); } } } @@ -272,7 +273,7 @@ namespace Tizen.NUI.Components } else { - return (Color)GetInternalTrackColorProperty(this); + return trackView.BackgroundColor; } } set @@ -283,7 +284,7 @@ namespace Tizen.NUI.Components } else { - SetInternalTrackColorProperty(this, null, value); + trackView.BackgroundColor = value; } } } @@ -302,7 +303,7 @@ namespace Tizen.NUI.Components } else { - return (Color)GetInternalThumbColorProperty(this); + return thumbColor; } } set @@ -313,7 +314,7 @@ namespace Tizen.NUI.Components } else { - SetInternalThumbColorProperty(this, null, value); + UpdateThumbColor(value); } } } @@ -334,7 +335,7 @@ namespace Tizen.NUI.Components } else { - return (Extents)GetInternalTrackPaddingProperty(this); + return new Extents(trackPadding.Item1, trackPadding.Item2, trackPadding.Item3, trackPadding.Item4); } } set @@ -345,7 +346,7 @@ namespace Tizen.NUI.Components } else { - SetInternalTrackPaddingProperty(this, null, value); + UpdateTrackPadding(value); } } } @@ -364,7 +365,7 @@ namespace Tizen.NUI.Components } else { - return (string)GetInternalThumbVerticalImageUrlProperty(this); + return thumbVerticalImageUrl; } } set @@ -375,7 +376,7 @@ namespace Tizen.NUI.Components } else { - SetInternalThumbVerticalImageUrlProperty(this, null, value); + UpdateThumbImage(value, false); } } } @@ -394,7 +395,7 @@ namespace Tizen.NUI.Components } else { - return (string)GetInternalThumbHorizontalImageUrlProperty(this); + return thumbHorizontalImageUrl; } } set @@ -405,7 +406,7 @@ namespace Tizen.NUI.Components } else { - SetInternalThumbHorizontalImageUrlProperty(this, null, value); + UpdateThumbImage(value, true); } } } diff --git a/src/Tizen.NUI.Components/Controls/Slider.cs b/src/Tizen.NUI.Components/Controls/Slider.cs index 7cd948e7e..a982e8dfe 100755 --- a/src/Tizen.NUI.Components/Controls/Slider.cs +++ b/src/Tizen.NUI.Components/Controls/Slider.cs @@ -68,151 +68,6 @@ namespace Tizen.NUI.Components /// 6 public partial class Slider : Control, IAtspiValue { - /// - /// SpaceBetweenTrackAndIndicatorProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty IndicatorProperty = null; - internal static void SetInternalIndicatorProperty(BindableObject bindable, object oldValue, object newValue) - { - var instance = (Slider)bindable; - if (newValue != null) - { - instance.privateIndicatorType = (IndicatorType)newValue; - } - } - internal static object GetInternalIndicatorProperty(BindableObject bindable) - { - var instance = (Slider)bindable; - return instance.privateIndicatorType; - } - - /// - /// SpaceBetweenTrackAndIndicatorProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SpaceBetweenTrackAndIndicatorProperty = null; - internal static void SetInternalSpaceBetweenTrackAndIndicatorProperty(BindableObject bindable, object oldValue, object newValue) - { - var instance = (Slider)bindable; - if (newValue != null) - { - instance.privateSpaceBetweenTrackAndIndicator = (uint)newValue; - } - } - internal static object GetInternalSpaceBetweenTrackAndIndicatorProperty(BindableObject bindable) - { - var instance = (Slider)bindable; - return instance.privateSpaceBetweenTrackAndIndicator; - } - - /// - /// TrackThicknessProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TrackThicknessProperty = null; - internal static void SetInternalTrackThicknessProperty(BindableObject bindable, object oldValue, object newValue) - { - var instance = (Slider)bindable; - if (newValue != null) - { - instance.privateTrackThickness = (uint)newValue; - } - } - internal static object GetInternalTrackThicknessProperty(BindableObject bindable) - { - var instance = (Slider)bindable; - return instance.privateTrackThickness; - } - - /// - /// IsValueShownProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty IsValueShownProperty = null; - internal static void SetInternalIsValueShownProperty(BindableObject bindable, object oldValue, object newValue) - { - var instance = (Slider)bindable; - if (newValue != null) - { - bool newValueShown = (bool)newValue; - if (instance.isValueShown != newValueShown) - { - instance.isValueShown = newValueShown; - } - } - } - internal static object GetInternalIsValueShownProperty(BindableObject bindable) - { - var instance = (Slider)bindable; - return instance.isValueShown; - } - - /// - /// ValueIndicatorTextProperty - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ValueIndicatorTextProperty = null; - internal static void SetInternalValueIndicatorTextProperty(BindableObject bindable, object oldValue, object newValue) - { - var instance = (Slider)bindable; - if (newValue != null) - { - string newText = (string)newValue; - instance.valueIndicatorText.Text = newText; - } - } - internal static object GetInternalValueIndicatorTextProperty(BindableObject bindable) - { - var instance = (Slider)bindable; - return instance.valueIndicatorText.Text; - } - - /// - /// Bindable property of CurrentValue - /// - /// Hidden API, used for NUI XAML data binding - /// - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CurrentValueProperty = null; - internal static void SetInternalCurrentValueProperty(BindableObject bindable, object oldValue, object newValue) - { - var instance = (Slider)bindable; - - if (newValue != null) - { - float value = (float)newValue; - if (value < instance.minValue) - { - instance.curValue = instance.minValue; - } - else if (value > instance.maxValue) - { - instance.curValue = instance.maxValue; - } - else - { - instance.curValue = value; - } - - instance.sliderValueChangedHandler?.Invoke(instance, new SliderValueChangedEventArgs - { - CurrentValue = instance.curValue - }); - if (Accessibility.Accessibility.IsEnabled && instance.IsHighlighted) - { - instance.EmitAccessibilityEvent(AccessibilityPropertyChangeEvent.Value); - } - instance.UpdateValue(); - } - } - internal static object GetInternalCurrentValueProperty(BindableObject bindable) - { - var instance = (Slider)bindable; - return instance.curValue; - } - static Slider() { if (NUIApplication.IsUsingXaml) @@ -423,7 +278,7 @@ namespace Tizen.NUI.Components } else { - return (DirectionType)GetInternalDirectionProperty(this); + return InternalDirection; } } set @@ -434,7 +289,7 @@ namespace Tizen.NUI.Components } else { - SetInternalDirectionProperty(this, null, value); + InternalDirection = value; } NotifyPropertyChanged(); } @@ -474,7 +329,7 @@ namespace Tizen.NUI.Components } else { - return (IndicatorType)GetInternalIndicatorProperty(this); + return privateIndicatorType; } } set @@ -485,7 +340,7 @@ namespace Tizen.NUI.Components } else { - SetInternalIndicatorProperty(this, null, value); + privateIndicatorType = value; } } } @@ -504,7 +359,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalMinValueProperty(this); + return InternalMinValue; } } set @@ -515,7 +370,7 @@ namespace Tizen.NUI.Components } else { - SetInternalMinValueProperty(this, null, value); + InternalMinValue = value; } NotifyPropertyChanged(); } @@ -547,7 +402,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalMaxValueProperty(this); + return InternalMaxValue; } } set @@ -558,7 +413,7 @@ namespace Tizen.NUI.Components } else { - SetInternalMaxValueProperty(this, null, value); + InternalMaxValue = value; } NotifyPropertyChanged(); } @@ -590,7 +445,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalCurrentValueProperty(this); + return GetInternalCurrentValue(); } } set @@ -601,11 +456,43 @@ namespace Tizen.NUI.Components } else { - SetInternalCurrentValueProperty(this, null, value); + SetInternalCurrentValue(value); } } } + private void SetInternalCurrentValue(float newValue) + { + float value = (float)newValue; + if (value < minValue) + { + curValue = minValue; + } + else if (value > maxValue) + { + curValue = maxValue; + } + else + { + curValue = value; + } + + sliderValueChangedHandler?.Invoke(this, new SliderValueChangedEventArgs + { + CurrentValue = curValue + }); + if (Accessibility.Accessibility.IsEnabled && IsHighlighted) + { + EmitAccessibilityEvent(AccessibilityPropertyChangeEvent.Value); + } + UpdateValue(); + } + + private float GetInternalCurrentValue() + { + return curValue; + } + /// /// Gets or sets the size of the thumb image object. /// @@ -620,7 +507,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalThumbSizeProperty(this) as Size; + return InternalThumbSize; } } set @@ -631,7 +518,10 @@ namespace Tizen.NUI.Components } else { - SetInternalThumbSizeProperty(this, null, value); + if (value != null) + { + InternalThumbSize = value; + } } NotifyPropertyChanged(); } @@ -668,7 +558,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalThumbImageURLProperty(this) as string; + return InternalThumbImageURL; } } set @@ -679,7 +569,10 @@ namespace Tizen.NUI.Components } else { - SetInternalThumbImageURLProperty(this, null, value); + if (value != null) + { + InternalThumbImageURL = value; + } } NotifyPropertyChanged(); } @@ -718,7 +611,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalThumbImageURLSelectorProperty(this) as StringSelector; + return InternalThumbImageURLSelector; } } set @@ -729,7 +622,8 @@ namespace Tizen.NUI.Components } else { - SetInternalThumbImageURLSelectorProperty(this, null, value); + //NOTE: null value is allowed here. + InternalThumbImageURLSelector = value; } NotifyPropertyChanged(); } @@ -773,7 +667,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalThumbImageUrlProperty(this) as Selector; + return InternalThumbImageUrl; } } set @@ -784,7 +678,10 @@ namespace Tizen.NUI.Components } else { - SetInternalThumbImageUrlProperty(this, null, value); + if (value != null) + { + InternalThumbImageUrl = value; + } } NotifyPropertyChanged(); } @@ -829,7 +726,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalThumbColorProperty(this) as Color; + return InternalThumbColor; } } set @@ -840,7 +737,10 @@ namespace Tizen.NUI.Components } else { - SetInternalThumbColorProperty(this, null, value); + if (value != null) + { + InternalThumbColor = value; + } } NotifyPropertyChanged(); } @@ -901,7 +801,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalBgTrackColorProperty(this) as Color; + return InternalBgTrackColor; } } set @@ -912,7 +812,10 @@ namespace Tizen.NUI.Components } else { - SetInternalBgTrackColorProperty(this, null, value); + if (value != null) + { + InternalBgTrackColor = value; + } } NotifyPropertyChanged(); } @@ -946,7 +849,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalSlidedTrackColorProperty(this) as Color; + return InternalSlidedTrackColor; } } set @@ -957,7 +860,10 @@ namespace Tizen.NUI.Components } else { - SetInternalSlidedTrackColorProperty(this, null, value); + if (value != null) + { + InternalSlidedTrackColor = value; + } } NotifyPropertyChanged(); } @@ -991,7 +897,7 @@ namespace Tizen.NUI.Components } else { - return (uint)GetInternalTrackThicknessProperty(this); + return privateTrackThickness; } } set @@ -1002,7 +908,7 @@ namespace Tizen.NUI.Components } else { - SetInternalTrackThicknessProperty(this, null, value); + privateTrackThickness = value; } } } @@ -1022,7 +928,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalWarningStartValueProperty(this); + return InternalWarningStartValue; } } set @@ -1033,7 +939,7 @@ namespace Tizen.NUI.Components } else { - SetInternalWarningStartValueProperty(this, null, value); + InternalWarningStartValue = value; } NotifyPropertyChanged(); } @@ -1066,7 +972,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalWarningTrackColorProperty(this) as Color; + return InternalWarningTrackColor; } } set @@ -1077,7 +983,10 @@ namespace Tizen.NUI.Components } else { - SetInternalWarningTrackColorProperty(this, null, value); + if (value != null) + { + InternalWarningTrackColor = value; + } } NotifyPropertyChanged(); } @@ -1112,7 +1021,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalWarningSlidedTrackColorProperty(this) as Color; + return InternalWarningSlidedTrackColor; } } set @@ -1123,7 +1032,10 @@ namespace Tizen.NUI.Components } else { - SetInternalWarningSlidedTrackColorProperty(this, null, value); + if (value != null) + { + InternalWarningSlidedTrackColor = value; + } } NotifyPropertyChanged(); } @@ -1159,7 +1071,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalWarningThumbImageUrlProperty(this) as Selector; + return InternalWarningThumbImageUrl; } } set @@ -1170,7 +1082,10 @@ namespace Tizen.NUI.Components } else { - SetInternalWarningThumbImageUrlProperty(this, null, value); + if (value != null) + { + InternalWarningThumbImageUrl = value; + } } NotifyPropertyChanged(); } @@ -1209,7 +1124,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalWarningThumbColorProperty(this) as Color; + return InternalWarningThumbColor; } } set @@ -1220,7 +1135,10 @@ namespace Tizen.NUI.Components } else { - SetInternalWarningThumbColorProperty(this, null, value); + if (value != null) + { + InternalWarningThumbColor = value; + } } NotifyPropertyChanged(); } @@ -1251,7 +1169,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalLowIndicatorImageURLProperty(this) as string; + return InternalLowIndicatorImageURL; } } set @@ -1262,7 +1180,10 @@ namespace Tizen.NUI.Components } else { - SetInternalLowIndicatorImageURLProperty(this, null, value); + if (value != null) + { + InternalLowIndicatorImageURL = value; + } } NotifyPropertyChanged(); } @@ -1301,7 +1222,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalHighIndicatorImageURLProperty(this) as string; + return InternalHighIndicatorImageURL; } } set @@ -1312,7 +1233,10 @@ namespace Tizen.NUI.Components } else { - SetInternalHighIndicatorImageURLProperty(this, null, value); + if (value != null) + { + InternalHighIndicatorImageURL = value; + } } NotifyPropertyChanged(); } @@ -1351,7 +1275,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalLowIndicatorTextContentProperty(this) as string; + return InternalLowIndicatorTextContent; } } set @@ -1362,7 +1286,10 @@ namespace Tizen.NUI.Components } else { - SetInternalLowIndicatorTextContentProperty(this, null, value); + if (value != null) + { + InternalLowIndicatorTextContent = value; + } } NotifyPropertyChanged(); } @@ -1396,7 +1323,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalHighIndicatorTextContentProperty(this) as string; + return InternalHighIndicatorTextContent; } } set @@ -1407,7 +1334,10 @@ namespace Tizen.NUI.Components } else { - SetInternalHighIndicatorTextContentProperty(this, null, value); + if (value != null) + { + InternalHighIndicatorTextContent = value; + } } NotifyPropertyChanged(); } @@ -1441,7 +1371,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalLowIndicatorSizeProperty(this) as Size; + return InternalLowIndicatorSize; } } set @@ -1452,7 +1382,10 @@ namespace Tizen.NUI.Components } else { - SetInternalLowIndicatorSizeProperty(this, null, value); + if (value != null) + { + InternalLowIndicatorSize = value; + } } NotifyPropertyChanged(); } @@ -1487,7 +1420,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalHighIndicatorSizeProperty(this) as Size; + return InternalHighIndicatorSize; } } set @@ -1498,7 +1431,10 @@ namespace Tizen.NUI.Components } else { - SetInternalHighIndicatorSizeProperty(this, null, value); + if (value != null) + { + InternalHighIndicatorSize = value; + } } NotifyPropertyChanged(); } @@ -1533,7 +1469,7 @@ namespace Tizen.NUI.Components } else { - return (uint)GetInternalSpaceBetweenTrackAndIndicatorProperty(this); + return privateSpaceBetweenTrackAndIndicator; } } set @@ -1544,7 +1480,7 @@ namespace Tizen.NUI.Components } else { - SetInternalSpaceBetweenTrackAndIndicatorProperty(this, null, value); + privateSpaceBetweenTrackAndIndicator = value; } } } @@ -1563,7 +1499,7 @@ namespace Tizen.NUI.Components } else { - return (bool)GetInternalIsValueShownProperty(this); + return GetInternalIsValueShown(); } } set @@ -1574,11 +1510,25 @@ namespace Tizen.NUI.Components } else { - SetInternalIsValueShownProperty(this, null, value); + SetInternalIsValueShown(value); } } } + private void SetInternalIsValueShown(bool newValue) + { + bool newValueShown = newValue; + if (isValueShown != newValueShown) + { + isValueShown = newValueShown; + } + } + + private bool GetInternalIsValueShown() + { + return isValueShown; + } + /// /// Gets or sets the text of value indicator. /// @@ -1593,7 +1543,7 @@ namespace Tizen.NUI.Components } else { - return (string)GetInternalValueIndicatorTextProperty(this); + return valueIndicatorText.Text; } } set @@ -1604,7 +1554,10 @@ namespace Tizen.NUI.Components } else { - SetInternalValueIndicatorTextProperty(this, null, value); + if (value != null) + { + valueIndicatorText.Text = value; + } } } } @@ -1623,7 +1576,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalValueIndicatorSizeProperty(this) as Size; + return InternalValueIndicatorSize; } } set @@ -1634,7 +1587,10 @@ namespace Tizen.NUI.Components } else { - SetInternalValueIndicatorSizeProperty(this, null, value); + if (value != null) + { + InternalValueIndicatorSize = value; + } } NotifyPropertyChanged(); } @@ -1668,7 +1624,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalValueIndicatorUrlProperty(this) as string; + return InternalValueIndicatorUrl; } } set @@ -1679,7 +1635,10 @@ namespace Tizen.NUI.Components } else { - SetInternalValueIndicatorUrlProperty(this, null, value); + if (value != null) + { + InternalValueIndicatorUrl = value; + } } NotifyPropertyChanged(); } @@ -1715,7 +1674,7 @@ namespace Tizen.NUI.Components } else { - return (bool)GetInternalIsDiscreteProperty(this); + return InternalIsDiscrete; } } set @@ -1726,7 +1685,7 @@ namespace Tizen.NUI.Components } else { - SetInternalIsDiscreteProperty(this, null, value); + InternalIsDiscrete = value; } NotifyPropertyChanged(); } @@ -1753,7 +1712,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalDiscreteValueProperty(this); + return InternalDiscreteValue; } } set @@ -1764,7 +1723,7 @@ namespace Tizen.NUI.Components } else { - SetInternalDiscreteValueProperty(this, null, value); + InternalDiscreteValue = value; } NotifyPropertyChanged(); } diff --git a/src/Tizen.NUI.Components/Controls/SliderBindableProperty.cs b/src/Tizen.NUI.Components/Controls/SliderBindableProperty.cs index e1c227a9c..b64db6dc1 100755 --- a/src/Tizen.NUI.Components/Controls/SliderBindableProperty.cs +++ b/src/Tizen.NUI.Components/Controls/SliderBindableProperty.cs @@ -6,6 +6,123 @@ namespace Tizen.NUI.Components { public partial class Slider { + /// + /// SpaceBetweenTrackAndIndicatorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IndicatorProperty = null; + internal static void SetInternalIndicatorProperty(BindableObject bindable, object oldValue, object newValue) + { + if (newValue != null) + { + var instance = (Slider)bindable; + instance.privateIndicatorType = (IndicatorType)newValue; + } + } + internal static object GetInternalIndicatorProperty(BindableObject bindable) + { + var instance = (Slider)bindable; + return instance.privateIndicatorType; + } + + /// + /// SpaceBetweenTrackAndIndicatorProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SpaceBetweenTrackAndIndicatorProperty = null; + internal static void SetInternalSpaceBetweenTrackAndIndicatorProperty(BindableObject bindable, object oldValue, object newValue) + { + if (newValue != null) + { + var instance = (Slider)bindable; + instance.privateSpaceBetweenTrackAndIndicator = (uint)newValue; + } + } + internal static object GetInternalSpaceBetweenTrackAndIndicatorProperty(BindableObject bindable) + { + var instance = (Slider)bindable; + return instance.privateSpaceBetweenTrackAndIndicator; + } + + /// + /// TrackThicknessProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TrackThicknessProperty = null; + internal static void SetInternalTrackThicknessProperty(BindableObject bindable, object oldValue, object newValue) + { + if (newValue != null) + { + var instance = (Slider)bindable; + instance.privateTrackThickness = (uint)newValue; + } + } + internal static object GetInternalTrackThicknessProperty(BindableObject bindable) + { + var instance = (Slider)bindable; + return instance.privateTrackThickness; + } + + /// + /// IsValueShownProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty IsValueShownProperty = null; + internal static void SetInternalIsValueShownProperty(BindableObject bindable, object oldValue, object newValue) + { + if (newValue != null) + { + var instance = (Slider)bindable; + instance.SetInternalIsValueShown((bool)newValue); + } + } + internal static object GetInternalIsValueShownProperty(BindableObject bindable) + { + var instance = (Slider)bindable; + return instance.GetInternalIsValueShown(); + } + + /// + /// ValueIndicatorTextProperty + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ValueIndicatorTextProperty = null; + internal static void SetInternalValueIndicatorTextProperty(BindableObject bindable, object oldValue, object newValue) + { + if (newValue != null) + { + var instance = (Slider)bindable; + instance.valueIndicatorText.Text = (string)newValue; + } + } + internal static object GetInternalValueIndicatorTextProperty(BindableObject bindable) + { + var instance = (Slider)bindable; + return instance.valueIndicatorText.Text; + } + + /// + /// Bindable property of CurrentValue + /// + /// Hidden API, used for NUI XAML data binding + /// + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty CurrentValueProperty = null; + internal static void SetInternalCurrentValueProperty(BindableObject bindable, object oldValue, object newValue) + { + if (newValue != null) + { + var instance = (Slider)bindable; + instance.SetInternalCurrentValue((float)newValue); + } + } + internal static object GetInternalCurrentValueProperty(BindableObject bindable) + { + var instance = (Slider)bindable; + return instance.GetInternalCurrentValue(); + } + /// /// DirectionProperty /// @@ -13,9 +130,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty DirectionProperty = null; internal static void SetInternalDirectionProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalDirection = (DirectionType)newValue; } } @@ -32,9 +149,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty MinValueProperty = null; internal static void SetInternalMinValueProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalMinValue = (float)newValue; } } @@ -51,9 +168,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty MaxValueProperty = null; internal static void SetInternalMaxValueProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalMaxValue = (float)newValue; } } @@ -70,9 +187,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty ThumbSizeProperty = null; internal static void SetInternalThumbSizeProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalThumbSize = newValue as Size; } } @@ -89,9 +206,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty ThumbImageURLProperty = null; internal static void SetInternalThumbImageURLProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalThumbImageURL = newValue as string; } } @@ -109,6 +226,7 @@ namespace Tizen.NUI.Components internal static void SetInternalThumbImageURLSelectorProperty(BindableObject bindable, object oldValue, object newValue) { var instance = (Slider)bindable; + //NOTE: null value is allowed here. instance.InternalThumbImageURLSelector = newValue as StringSelector; } internal static object GetInternalThumbImageURLSelectorProperty(BindableObject bindable) @@ -124,9 +242,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty ThumbImageUrlProperty = null; internal static void SetInternalThumbImageUrlProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalThumbImageUrl = newValue as Tizen.NUI.BaseComponents.Selector; } } @@ -143,9 +261,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty ThumbColorProperty = null; internal static void SetInternalThumbColorProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalThumbColor = newValue as Color; } } @@ -162,9 +280,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty BgTrackColorProperty = null; internal static void SetInternalBgTrackColorProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalBgTrackColor = newValue as Color; } } @@ -181,9 +299,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty SlidedTrackColorProperty = null; internal static void SetInternalSlidedTrackColorProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalSlidedTrackColor = newValue as Color; } } @@ -200,9 +318,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty WarningStartValueProperty = null; internal static void SetInternalWarningStartValueProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalWarningStartValue = (float)newValue; } } @@ -219,9 +337,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty WarningTrackColorProperty = null; internal static void SetInternalWarningTrackColorProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalWarningTrackColor = newValue as Color; } } @@ -238,9 +356,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty WarningSlidedTrackColorProperty = null; internal static void SetInternalWarningSlidedTrackColorProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalWarningSlidedTrackColor = newValue as Color; } } @@ -257,9 +375,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty WarningThumbImageUrlProperty = null; internal static void SetInternalWarningThumbImageUrlProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalWarningThumbImageUrl = newValue as Tizen.NUI.BaseComponents.Selector; } } @@ -276,9 +394,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty WarningThumbColorProperty = null; internal static void SetInternalWarningThumbColorProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalWarningThumbColor = newValue as Color; } } @@ -295,9 +413,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty LowIndicatorImageURLProperty = null; internal static void SetInternalLowIndicatorImageURLProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalLowIndicatorImageURL = newValue as string; } } @@ -314,9 +432,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty HighIndicatorImageURLProperty = null; internal static void SetInternalHighIndicatorImageURLProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalHighIndicatorImageURL = newValue as string; } } @@ -333,9 +451,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty LowIndicatorTextContentProperty = null; internal static void SetInternalLowIndicatorTextContentProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalLowIndicatorTextContent = newValue as string; } } @@ -352,9 +470,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty HighIndicatorTextContentProperty = null; internal static void SetInternalHighIndicatorTextContentProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalHighIndicatorTextContent = newValue as string; } } @@ -371,9 +489,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty LowIndicatorSizeProperty = null; internal static void SetInternalLowIndicatorSizeProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue as Size is var nVal && nVal != null) { + var instance = (Slider)bindable; instance.InternalLowIndicatorSize = nVal; } } @@ -390,9 +508,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty HighIndicatorSizeProperty = null; internal static void SetInternalHighIndicatorSizeProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue as Size is var nVal && nVal != null) { + var instance = (Slider)bindable; instance.InternalHighIndicatorSize = nVal; } } @@ -409,9 +527,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty ValueIndicatorSizeProperty = null; internal static void SetInternalValueIndicatorSizeProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue as Size is var nVal && nVal != null) { + var instance = (Slider)bindable; instance.InternalValueIndicatorSize = nVal; } } @@ -428,9 +546,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty ValueIndicatorUrlProperty = null; internal static void SetInternalValueIndicatorUrlProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalValueIndicatorUrl = newValue as string; } } @@ -447,9 +565,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty IsDiscreteProperty = null; internal static void SetInternalIsDiscreteProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalIsDiscrete = (bool)newValue; } } @@ -466,9 +584,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty DiscreteValueProperty = null; internal static void SetInternalDiscreteValueProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Slider)bindable; if (newValue != null) { + var instance = (Slider)bindable; instance.InternalDiscreteValue = (float)newValue; } } diff --git a/src/Tizen.NUI.Components/Controls/Switch.cs b/src/Tizen.NUI.Components/Controls/Switch.cs index dc9c66ed4..0a31adf02 100755 --- a/src/Tizen.NUI.Components/Controls/Switch.cs +++ b/src/Tizen.NUI.Components/Controls/Switch.cs @@ -212,7 +212,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalSwitchBackgroundImageURLSelectorProperty(this) as StringSelector; + return InternalSwitchBackgroundImageURLSelector; } } set @@ -223,7 +223,7 @@ namespace Tizen.NUI.Components } else { - SetInternalSwitchBackgroundImageURLSelectorProperty(this, null, value); + InternalSwitchBackgroundImageURLSelector = value; } NotifyPropertyChanged(); } @@ -260,7 +260,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalSwitchHandlerImageURLProperty(this) as string; + return InternalSwitchHandlerImageURL; } } set @@ -271,7 +271,7 @@ namespace Tizen.NUI.Components } else { - SetInternalSwitchHandlerImageURLProperty(this, null, value); + InternalSwitchHandlerImageURL = value; } NotifyPropertyChanged(); } @@ -303,7 +303,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalSwitchHandlerImageURLSelectorProperty(this) as StringSelector; + return InternalSwitchHandlerImageURLSelector; } } set @@ -314,7 +314,7 @@ namespace Tizen.NUI.Components } else { - SetInternalSwitchHandlerImageURLSelectorProperty(this, null, value); + InternalSwitchHandlerImageURLSelector = value; } NotifyPropertyChanged(); } @@ -351,7 +351,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalSwitchHandlerImageSizeProperty(this) as Size; + return InternalSwitchHandlerImageSize; } } set @@ -362,7 +362,7 @@ namespace Tizen.NUI.Components } else { - SetInternalSwitchHandlerImageSizeProperty(this, null, value); + InternalSwitchHandlerImageSize = value; } NotifyPropertyChanged(); } diff --git a/src/Tizen.NUI.Components/Controls/SwitchBindableProperty.cs b/src/Tizen.NUI.Components/Controls/SwitchBindableProperty.cs index 6610566cd..47afd79a7 100755 --- a/src/Tizen.NUI.Components/Controls/SwitchBindableProperty.cs +++ b/src/Tizen.NUI.Components/Controls/SwitchBindableProperty.cs @@ -12,9 +12,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty SwitchBackgroundImageURLSelectorProperty = null; internal static void SetInternalSwitchBackgroundImageURLSelectorProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Switch)bindable; if (newValue != null) { + var instance = (Switch)bindable; instance.InternalSwitchBackgroundImageURLSelector = newValue as StringSelector; } } @@ -31,9 +31,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty SwitchHandlerImageURLProperty = null; internal static void SetInternalSwitchHandlerImageURLProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Switch)bindable; if (newValue != null) { + var instance = (Switch)bindable; instance.InternalSwitchHandlerImageURL = newValue as string; } } @@ -50,9 +50,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty SwitchHandlerImageURLSelectorProperty = null; internal static void SetInternalSwitchHandlerImageURLSelectorProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Switch)bindable; if (newValue != null) { + var instance = (Switch)bindable; instance.InternalSwitchHandlerImageURLSelector = newValue as StringSelector; } } @@ -69,9 +69,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty SwitchHandlerImageSizeProperty = null; internal static void SetInternalSwitchHandlerImageSizeProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Switch)bindable; if (newValue != null) { + var instance = (Switch)bindable; instance.InternalSwitchHandlerImageSize = newValue as Size; } } diff --git a/src/Tizen.NUI.Components/Controls/Tab.cs b/src/Tizen.NUI.Components/Controls/Tab.cs index 42c9a33ce..8135021f0 100755 --- a/src/Tizen.NUI.Components/Controls/Tab.cs +++ b/src/Tizen.NUI.Components/Controls/Tab.cs @@ -155,7 +155,7 @@ namespace Tizen.NUI.Components } else { - return (int)GetInternalSelectedItemIndexProperty(this); + return InternalSelectedItemIndex; } } set @@ -166,7 +166,7 @@ namespace Tizen.NUI.Components } else { - SetInternalSelectedItemIndexProperty(this, null, value); + InternalSelectedItemIndex = value; } NotifyPropertyChanged(); } @@ -202,7 +202,7 @@ namespace Tizen.NUI.Components } else { - return (bool)GetInternalUseTextNaturalSizeProperty(this); + return InternalUseTextNaturalSize; } } set @@ -213,7 +213,7 @@ namespace Tizen.NUI.Components } else { - SetInternalUseTextNaturalSizeProperty(this, null, value); + InternalUseTextNaturalSize = value; } NotifyPropertyChanged(); } @@ -249,7 +249,7 @@ namespace Tizen.NUI.Components } else { - return (int)GetInternalItemSpaceProperty(this); + return InternalItemSpace; } } set @@ -260,7 +260,7 @@ namespace Tizen.NUI.Components } else { - SetInternalItemSpaceProperty(this, null, value); + InternalItemSpace = value; } NotifyPropertyChanged(); } @@ -296,7 +296,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalSpaceProperty(this) as Extents; + return InternalSpace; } } set @@ -307,7 +307,7 @@ namespace Tizen.NUI.Components } else { - SetInternalSpaceProperty(this, null, value); + InternalSpace = value; } NotifyPropertyChanged(); } @@ -340,7 +340,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalItemPaddingProperty(this) as Extents; + return InternalItemPadding; } } set @@ -351,7 +351,7 @@ namespace Tizen.NUI.Components } else { - SetInternalItemPaddingProperty(this, null, value); + InternalItemPadding = value; } NotifyPropertyChanged(); } @@ -404,7 +404,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalUnderLineSizeProperty(this) as Size; + return InternalUnderLineSize; } } set @@ -415,7 +415,7 @@ namespace Tizen.NUI.Components } else { - SetInternalUnderLineSizeProperty(this, null, value); + InternalUnderLineSize = value; } NotifyPropertyChanged(); } @@ -451,7 +451,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalUnderLineBackgroundColorProperty(this) as Color; + return InternalUnderLineBackgroundColor; } } set @@ -462,7 +462,7 @@ namespace Tizen.NUI.Components } else { - SetInternalUnderLineBackgroundColorProperty(this, null, value); + InternalUnderLineBackgroundColor = value; } NotifyPropertyChanged(); } @@ -498,7 +498,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalPointSizeProperty(this); + return InternalPointSize; } } set @@ -509,7 +509,7 @@ namespace Tizen.NUI.Components } else { - SetInternalPointSizeProperty(this, null, value); + InternalPointSize = value; } NotifyPropertyChanged(); } @@ -545,7 +545,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalFontFamilyProperty(this) as string; + return InternalFontFamily; } } set @@ -556,7 +556,7 @@ namespace Tizen.NUI.Components } else { - SetInternalFontFamilyProperty(this, null, value); + InternalFontFamily = value; } NotifyPropertyChanged(); } @@ -592,7 +592,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalTextColorProperty(this) as Color; + return InternalTextColor; } } set @@ -603,7 +603,7 @@ namespace Tizen.NUI.Components } else { - SetInternalTextColorProperty(this, null, value); + InternalTextColor = value; } NotifyPropertyChanged(); } @@ -640,7 +640,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalTextColorSelectorProperty(this) as ColorSelector; + return InternalTextColorSelector; } } set @@ -651,7 +651,7 @@ namespace Tizen.NUI.Components } else { - SetInternalTextColorSelectorProperty(this, null, value); + InternalTextColorSelector = value; } NotifyPropertyChanged(); } diff --git a/src/Tizen.NUI.Components/Controls/TabBindableProperty.cs b/src/Tizen.NUI.Components/Controls/TabBindableProperty.cs index 3ecb7e045..f1c06acaa 100755 --- a/src/Tizen.NUI.Components/Controls/TabBindableProperty.cs +++ b/src/Tizen.NUI.Components/Controls/TabBindableProperty.cs @@ -12,9 +12,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty SelectedItemIndexProperty = null; internal static void SetInternalSelectedItemIndexProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tab)bindable; if (newValue != null) { + var instance = (Tab)bindable; instance.InternalSelectedItemIndex = (int)newValue; } } @@ -31,9 +31,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty UseTextNaturalSizeProperty = null; internal static void SetInternalUseTextNaturalSizeProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tab)bindable; if (newValue != null) { + var instance = (Tab)bindable; instance.InternalUseTextNaturalSize = (bool)newValue; } } @@ -50,9 +50,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty ItemSpaceProperty = null; internal static void SetInternalItemSpaceProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tab)bindable; if (newValue != null) { + var instance = (Tab)bindable; instance.InternalItemSpace = (int)newValue; } } @@ -69,9 +69,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty SpaceProperty = null; internal static void SetInternalSpaceProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tab)bindable; if (newValue != null) { + var instance = (Tab)bindable; instance.InternalSpace = newValue as Extents; } } @@ -88,9 +88,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty ItemPaddingProperty = null; internal static void SetInternalItemPaddingProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tab)bindable; if (newValue != null) { + var instance = (Tab)bindable; instance.InternalItemPadding = newValue as Extents; } } @@ -107,9 +107,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty UnderLineSizeProperty = null; internal static void SetInternalUnderLineSizeProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tab)bindable; if (newValue != null) { + var instance = (Tab)bindable; instance.InternalUnderLineSize = newValue as Size; } } @@ -126,9 +126,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty UnderLineBackgroundColorProperty = null; internal static void SetInternalUnderLineBackgroundColorProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tab)bindable; if (newValue != null) { + var instance = (Tab)bindable; instance.InternalUnderLineBackgroundColor = newValue as Color; } } @@ -145,9 +145,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty PointSizeProperty = null; internal static void SetInternalPointSizeProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tab)bindable; if (newValue != null) { + var instance = (Tab)bindable; instance.InternalPointSize = (float)newValue; } } @@ -164,9 +164,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty FontFamilyProperty = null; internal static void SetInternalFontFamilyProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tab)bindable; if (newValue != null) { + var instance = (Tab)bindable; instance.InternalFontFamily = newValue as string; } } @@ -183,9 +183,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty TextColorProperty = null; internal static void SetInternalTextColorProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tab)bindable; if (newValue != null) { + var instance = (Tab)bindable; instance.InternalTextColor = newValue as Color; } } @@ -202,9 +202,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty TextColorSelectorProperty = null; internal static void SetInternalTextColorSelectorProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Tab)bindable; if (newValue != null) { + var instance = (Tab)bindable; instance.InternalTextColorSelector = newValue as ColorSelector; } } diff --git a/src/Tizen.NUI.Components/Controls/Toast.cs b/src/Tizen.NUI.Components/Controls/Toast.cs index aeec637e4..d6a4c7a6b 100755 --- a/src/Tizen.NUI.Components/Controls/Toast.cs +++ b/src/Tizen.NUI.Components/Controls/Toast.cs @@ -31,48 +31,6 @@ namespace Tizen.NUI.Components [Obsolete("Deprecated in API8; Will be removed in API10")] public partial class Toast : 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 MessageProperty = null; - internal static void SetInternalMessageProperty(BindableObject bindable, object oldValue, object newValue) - { - var instance = (Toast)bindable; - if (newValue != null) - { - instance.strText = (string)(newValue); - if (null != instance.textLabel) - { - instance.textLabel.Text = instance.strText; - } - } - } - internal static object GetInternalMessageProperty(BindableObject bindable) - { - var instance = (Toast)bindable; - return instance.strText; - } - - /// 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 DurationProperty = null; - internal static void SetInternalDurationProperty(BindableObject bindable, object oldValue, object newValue) - { - var instance = (Toast)bindable; - if (newValue != null) - { - if (instance.timer == null) - { - instance.timer = new Timer(instance.duration); - } - instance.timer.Interval = (uint)newValue; - } - } - internal static object GetInternalDurationProperty(BindableObject bindable) - { - var instance = (Toast)bindable; - return instance.timer == null ? instance.duration : instance.timer.Interval; - } - /// 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 Toast FromText(string text, uint duration) @@ -162,7 +120,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalTextArrayProperty(this) as string[]; + return InternalTextArray; } } set @@ -173,7 +131,7 @@ namespace Tizen.NUI.Components } else { - SetInternalTextArrayProperty(this, null, value); + InternalTextArray = value; } NotifyPropertyChanged(); } @@ -199,7 +157,7 @@ namespace Tizen.NUI.Components } else { - return (float)GetInternalPointSizeProperty(this); + return InternalPointSize; } } set @@ -210,7 +168,7 @@ namespace Tizen.NUI.Components } else { - SetInternalPointSizeProperty(this, null, value); + InternalPointSize = value; } NotifyPropertyChanged(); } @@ -245,7 +203,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalFontFamilyProperty(this) as string; + return InternalFontFamily; } } set @@ -256,7 +214,7 @@ namespace Tizen.NUI.Components } else { - SetInternalFontFamilyProperty(this, null, value); + InternalFontFamily = value; } NotifyPropertyChanged(); } @@ -291,7 +249,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalTextColorProperty(this) as Color; + return InternalTextColor; } } set @@ -302,7 +260,7 @@ namespace Tizen.NUI.Components } else { - SetInternalTextColorProperty(this, null, value); + InternalTextColor = value; } NotifyPropertyChanged(); } @@ -337,7 +295,7 @@ namespace Tizen.NUI.Components } else { - return (HorizontalAlignment)GetInternalTextAlignmentProperty(this); + return InternalTextAlignment; } } set @@ -348,7 +306,7 @@ namespace Tizen.NUI.Components } else { - SetInternalTextAlignmentProperty(this, null, value); + InternalTextAlignment = value; } NotifyPropertyChanged(); } @@ -395,7 +353,7 @@ namespace Tizen.NUI.Components } else { - return (string)GetInternalMessageProperty(this); + return GetInternalMessage(); } } set @@ -406,11 +364,28 @@ namespace Tizen.NUI.Components } else { - SetInternalMessageProperty(this, null, value); + SetInternalMessage(value); + } + } + } + + private void SetInternalMessage(string newValue) + { + if (newValue != null) + { + strText = newValue; + if (null != textLabel) + { + textLabel.Text = strText; } } } + private string GetInternalMessage() + { + return strText; + } + /// /// Gets or sets text padding in toast. /// @@ -426,7 +401,7 @@ namespace Tizen.NUI.Components } else { - return GetInternalTextPaddingProperty(this) as Extents; + return InternalTextPadding; } } set @@ -437,7 +412,7 @@ namespace Tizen.NUI.Components } else { - SetInternalTextPaddingProperty(this, null, value); + InternalTextPadding = value; } NotifyPropertyChanged(); } @@ -472,7 +447,7 @@ namespace Tizen.NUI.Components } else { - return (uint)GetInternalTextLineHeightProperty(this); + return InternalTextLineHeight; } } set @@ -483,7 +458,7 @@ namespace Tizen.NUI.Components } else { - SetInternalTextLineHeightProperty(this, null, value); + InternalTextLineHeight = value; } NotifyPropertyChanged(); } @@ -505,7 +480,7 @@ namespace Tizen.NUI.Components } else { - return (uint)GetInternalTextLineSpaceProperty(this); + return InternalTextLineSpace; } } set @@ -516,7 +491,7 @@ namespace Tizen.NUI.Components } else { - SetInternalTextLineSpaceProperty(this, null, value); + InternalTextLineSpace = value; } NotifyPropertyChanged(); } @@ -538,7 +513,7 @@ namespace Tizen.NUI.Components } else { - return (uint)GetInternalDurationProperty(this); + return GetInternalDuration(); } } set @@ -549,11 +524,25 @@ namespace Tizen.NUI.Components } else { - SetInternalDurationProperty(this, null, value); + SetInternalDuration(value); } } } + private void SetInternalDuration(uint newValue) + { + if (timer == null) + { + timer = new Timer(duration); + } + timer.Interval = newValue; + } + + private uint GetInternalDuration() + { + return timer == null ? duration : timer.Interval; + } + /// [EditorBrowsable(EditorBrowsableState.Never)] public override void OnInitialize() diff --git a/src/Tizen.NUI.Components/Controls/ToastBindableProperty.cs b/src/Tizen.NUI.Components/Controls/ToastBindableProperty.cs index 0c1056968..a647e097c 100755 --- a/src/Tizen.NUI.Components/Controls/ToastBindableProperty.cs +++ b/src/Tizen.NUI.Components/Controls/ToastBindableProperty.cs @@ -5,6 +5,40 @@ namespace Tizen.NUI.Components { public partial class Toast { + /// 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 MessageProperty = null; + internal static void SetInternalMessageProperty(BindableObject bindable, object oldValue, object newValue) + { + if (newValue != null) + { + var instance = (Toast)bindable; + instance.SetInternalMessage((string)newValue); + } + } + internal static object GetInternalMessageProperty(BindableObject bindable) + { + var instance = (Toast)bindable; + return instance.GetInternalMessage(); + } + + /// 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 DurationProperty = null; + internal static void SetInternalDurationProperty(BindableObject bindable, object oldValue, object newValue) + { + if (newValue != null) + { + var instance = (Toast)bindable; + instance.SetInternalDuration((uint)newValue); + } + } + internal static object GetInternalDurationProperty(BindableObject bindable) + { + var instance = (Toast)bindable; + return instance.GetInternalDuration(); + } + /// /// TextArrayProperty /// @@ -12,9 +46,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty TextArrayProperty = null; internal static void SetInternalTextArrayProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Toast)bindable; if (newValue != null) { + var instance = (Toast)bindable; instance.InternalTextArray = newValue as string[]; } } @@ -31,9 +65,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty PointSizeProperty = null; internal static void SetInternalPointSizeProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Toast)bindable; if (newValue != null) { + var instance = (Toast)bindable; instance.InternalPointSize = (float)newValue; } } @@ -50,9 +84,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty FontFamilyProperty = null; internal static void SetInternalFontFamilyProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Toast)bindable; if (newValue != null) { + var instance = (Toast)bindable; instance.InternalFontFamily = newValue as string; } } @@ -69,9 +103,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty TextColorProperty = null; internal static void SetInternalTextColorProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Toast)bindable; if (newValue != null) { + var instance = (Toast)bindable; instance.InternalTextColor = newValue as Color; } } @@ -88,9 +122,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty TextAlignmentProperty = null; internal static void SetInternalTextAlignmentProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Toast)bindable; if (newValue != null) { + var instance = (Toast)bindable; instance.InternalTextAlignment = (HorizontalAlignment)newValue; } } @@ -107,9 +141,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty TextPaddingProperty = null; internal static void SetInternalTextPaddingProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Toast)bindable; if (newValue != null) { + var instance = (Toast)bindable; instance.InternalTextPadding = newValue as Extents; } } @@ -126,9 +160,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty TextLineHeightProperty = null; internal static void SetInternalTextLineHeightProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Toast)bindable; if (newValue != null) { + var instance = (Toast)bindable; instance.InternalTextLineHeight = (uint)newValue; } } @@ -145,9 +179,9 @@ namespace Tizen.NUI.Components public static readonly BindableProperty TextLineSpaceProperty = null; internal static void SetInternalTextLineSpaceProperty(BindableObject bindable, object oldValue, object newValue) { - var instance = (Toast)bindable; if (newValue != null) { + var instance = (Toast)bindable; instance.InternalTextLineSpace = (uint)newValue; } }