From 5a9c30af9e32aa74d1a4cd9f445fbdef4d4ba48d Mon Sep 17 00:00:00 2001 From: Fang Xiaohui Date: Wed, 25 Aug 2021 10:24:56 +0800 Subject: [PATCH] [Xaml] Remove underline in member's name --- .../src/internal/XamlBinding/MergedStyle.cs | 52 +++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Tizen.NUI/src/internal/XamlBinding/MergedStyle.cs b/src/Tizen.NUI/src/internal/XamlBinding/MergedStyle.cs index f4c0671..3085f68 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/MergedStyle.cs +++ b/src/Tizen.NUI/src/internal/XamlBinding/MergedStyle.cs @@ -11,19 +11,19 @@ namespace Tizen.NUI.Binding { ////If the base type is one of these, stop registering dynamic resources further ////The last one (typeof(Element)) is a safety guard as we might be creating VisualElement directly in internal code - static readonly IList s_stopAtTypes = new List { typeof(View), typeof(Element) }; + static readonly IList stopAtTypes = new List { typeof(View), typeof(Element) }; - IList _classStyleProperties; + IList classStyleProperties; - readonly List _implicitStyles = new List(); + readonly List implicitStyles = new List(); - IList _classStyles; + IList classStyles; - IStyle _implicitStyle; + IStyle implicitStyle; - IStyle _style; + IStyle style; - IList _styleClass; + IList styleClass; public MergedStyle(Type targetType, BindableObject target) { @@ -35,32 +35,32 @@ namespace Tizen.NUI.Binding public IStyle Style { - get { return _style; } + get { return style; } set { SetStyle(ImplicitStyle, ClassStyles, value); } } public IList StyleClass { - get { return _styleClass; } + get { return styleClass; } set { - if (_styleClass == value) + if (styleClass == value) return; - if (_styleClass != null && _classStyles != null) - foreach (var classStyleProperty in _classStyleProperties) + if (styleClass != null && classStyles != null) + foreach (var classStyleProperty in classStyleProperties) Target.RemoveDynamicResource(classStyleProperty); - _styleClass = value; + styleClass = value; - if (_styleClass != null) + if (styleClass != null) { - _classStyleProperties = new List(); - foreach (var styleClass in _styleClass) + classStyleProperties = new List(); + foreach (var styleClass in styleClass) { var classStyleProperty = BindableProperty.Create("ClassStyle", typeof(IList), typeof(View), default(IList), propertyChanged: (bindable, oldvalue, newvalue) => ((View)bindable).MergedStyle.OnClassStyleChanged()); - _classStyleProperties.Add(classStyleProperty); + classStyleProperties.Add(classStyleProperty); Target.OnSetDynamicResource(classStyleProperty, Tizen.NUI.Binding.XamlStyle.StyleClassPrefix + styleClass); } } @@ -71,13 +71,13 @@ namespace Tizen.NUI.Binding IList ClassStyles { - get { return _classStyles; } + get { return classStyles; } set { SetStyle(ImplicitStyle, value, Style); } } IStyle ImplicitStyle { - get { return _implicitStyle; } + get { return implicitStyle; } set { SetStyle(value, ClassStyles, Style); } } @@ -103,13 +103,13 @@ namespace Tizen.NUI.Binding void OnClassStyleChanged() { - ClassStyles = _classStyleProperties.Select(p => (Target.GetValue(p) as IList)?.FirstOrDefault(s => s.CanBeAppliedTo(TargetType))).ToList(); + ClassStyles = classStyleProperties.Select(p => (Target.GetValue(p) as IList)?.FirstOrDefault(s => s.CanBeAppliedTo(TargetType))).ToList(); } void OnImplicitStyleChanged() { var first = true; - foreach (BindableProperty implicitStyleProperty in _implicitStyles) + foreach (BindableProperty implicitStyleProperty in implicitStyles) { var implicitStyle = (XamlStyle)Target.GetValue(implicitStyleProperty); if (implicitStyle != null) @@ -135,10 +135,10 @@ namespace Tizen.NUI.Binding { BindableProperty implicitStyleProperty = BindableProperty.Create(nameof(ImplicitStyle), typeof(XamlStyle), typeof(View), default(XamlStyle), propertyChanged: (bindable, oldvalue, newvalue) => OnImplicitStyleChanged()); - _implicitStyles.Add(implicitStyleProperty); + implicitStyles.Add(implicitStyleProperty); Target.SetDynamicResource(implicitStyleProperty, type.FullName); type = type.GetTypeInfo().BaseType; - if (s_stopAtTypes.Contains(type)) + if (stopAtTypes.Contains(type)) return; } } @@ -157,9 +157,9 @@ namespace Tizen.NUI.Binding if (shouldReApplyImplicitStyle) ImplicitStyle?.UnApply(Target); - _implicitStyle = implicitStyle; - _classStyles = classStyles; - _style = style; + this.implicitStyle = implicitStyle; + this.classStyles = classStyles; + this.style = style; if (shouldReApplyImplicitStyle) ImplicitStyle?.Apply(Target); -- 2.7.4