[Xaml] Modify by HQ's feedback
authorFang Xiaohui <xiaohui.fang@samsung.com>
Mon, 23 Aug 2021 06:39:12 +0000 (14:39 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 1 Sep 2021 08:20:01 +0000 (17:20 +0900)
src/Tizen.NUI/src/internal/Xaml/ApplyPropertiesVisitor.cs
src/Tizen.NUI/src/internal/Xaml/VisualState/VisualStateManager.cs
src/Tizen.NUI/src/public/XamlBinding/BindablePropertyConverter.cs
src/Tizen.NUI/src/public/XamlBinding/XamlStyle.cs

index f2ffb5d..0ca6d91 100755 (executable)
@@ -632,21 +632,14 @@ namespace Tizen.NUI.Xaml
 
         static private object GetConvertedValue(Type valueType, object value, Func<MemberInfo> minfoRetriever, XamlServiceProvider serviceProvider)
         {
-            try
-            {
-                object convertedValue = value.ConvertTo(valueType, minfoRetriever, serviceProvider);
-
-                if (convertedValue != null && !valueType.IsInstanceOfType(convertedValue))
-                {
-                    return null;
-                }
+            object convertedValue = value.ConvertTo(valueType, minfoRetriever, serviceProvider);
 
-                return convertedValue;
-            }
-            catch
+            if (convertedValue != null && !valueType.IsInstanceOfType(convertedValue))
             {
-                return null;
+                convertedValue = null;
             }
+
+            return convertedValue;
         }
 
         static bool TryGetProperty(object element, string localName, out object value, HydrationContext context, out Exception exception, out object targetProperty)
index 11d571d..1f0c8d3 100755 (executable)
@@ -35,7 +35,7 @@ namespace Tizen.NUI.Xaml
 
         private static VisualStateGroupList visualStateGroups;
         public static readonly BindableProperty VisualStateGroupsProperty =
-            BindableProperty.CreateAttached("VisualStateGroups", typeof(VisualStateGroupList), typeof(/*VisualElement*/BaseHandle),
+            BindableProperty.CreateAttached("VisualStateGroups", typeof(VisualStateGroupList), typeof(BaseHandle),
                 defaultValue: null, propertyChanged: VisualStateGroupsPropertyChanged,
                 defaultValueCreator: (BindableObject obj)=>
                 {
@@ -49,20 +49,20 @@ namespace Tizen.NUI.Xaml
 
         static void VisualStateGroupsPropertyChanged(BindableObject bindable, object oldValue, object newValue)
         {
-            GoToState((/*VisualElement*/BaseHandle)bindable, CommonStates.Normal);
+            GoToState((BaseHandle)bindable, CommonStates.Normal);
         }
 
-        public static IList<VisualStateGroup> GetVisualStateGroups(/*VisualElement*/BaseHandle visualElement)
+        public static IList<VisualStateGroup> GetVisualStateGroups(BaseHandle visualElement)
         {
             return (IList<VisualStateGroup>)visualElement.GetValue(VisualStateGroupsProperty);
         }
 
-        public static void SetVisualStateGroups(/*VisualElement*/BaseHandle visualElement, VisualStateGroupList value)
+        public static void SetVisualStateGroups(BaseHandle visualElement, VisualStateGroupList value)
         {
             visualElement.SetValue(VisualStateGroupsProperty, value);
         }
 
-        public static bool GoToState(/*VisualElement*/BaseHandle visualElement, string name)
+        public static bool GoToState(BaseHandle visualElement, string name)
         {
             if (!visualElement.IsSet(VisualStateGroupsProperty))
             {
@@ -110,7 +110,7 @@ namespace Tizen.NUI.Xaml
             return false;
         }
 
-        public static bool HasVisualStateGroups(this /*VisualElement*/BaseHandle element)
+        public static bool HasVisualStateGroups(this BaseHandle element)
         {
             return element.IsSet(VisualStateGroupsProperty);
         }
index 58e2d7e..8cbff47 100755 (executable)
@@ -141,7 +141,7 @@ namespace Tizen.NUI.Binding
             var vsTarget = parents[3];
 
             // Are these Visual States directly on a VisualElement?
-            if (vsTarget is /*VisualElement*/BaseHandle)
+            if (vsTarget is BaseHandle)
             {
                 return vsTarget.GetType();
             }
index c8f0fad..6f9b768 100755 (executable)
@@ -6,8 +6,6 @@ using System.ComponentModel;
 
 namespace Tizen.NUI.Binding
 {
-    /// <since_tizen> 6 </since_tizen>
-    /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
     [EditorBrowsable(EditorBrowsableState.Never)]
     [ContentProperty("Setters")]
     public sealed class XamlStyle : IStyle
@@ -27,8 +25,6 @@ namespace Tizen.NUI.Binding
 
         IList<TriggerBase> _triggers;
 
-        /// <since_tizen> 6 </since_tizen>
-        /// 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 XamlStyle([TypeConverter(typeof(TypeTypeConverter))][Parameter("TargetType")] Type targetType)
         {
@@ -39,13 +35,9 @@ namespace Tizen.NUI.Binding
             Setters = new List<Setter>();
         }
 
-        /// <since_tizen> 6 </since_tizen>
-        /// 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 ApplyToDerivedTypes { get; set; }
 
-        /// <since_tizen> 6 </since_tizen>
-        /// 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 XamlStyle BasedOn
         {
@@ -64,8 +56,6 @@ namespace Tizen.NUI.Binding
             }
         }
 
-        /// <since_tizen> 6 </since_tizen>
-        /// 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 BaseResourceKey
         {
@@ -95,19 +85,15 @@ namespace Tizen.NUI.Binding
             get { return _behaviors ?? (_behaviors = new AttachedCollection<Behavior>()); }
         }
 
-        /// 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 CanCascade { 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 string Class { 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 IList<Setter> Setters { get; }
 
-        /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public IList<TriggerBase> Triggers
         {
@@ -122,8 +108,6 @@ namespace Tizen.NUI.Binding
             ApplyCore(bindable, BasedOn ?? GetBasedOnResource(bindable));
         }
 
-        /// <since_tizen> 6 </since_tizen>
-        /// 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 Type TargetType { get; }
 
@@ -184,7 +168,7 @@ namespace Tizen.NUI.Binding
 
         static void OnBasedOnResourceChanged(BindableObject bindable, object oldValue, object newValue)
         {
-            // Style style = (bindable as /*VisualElement*/BaseHandle).Style;
+            // Style style = (bindable as BaseHandle).Style;
             // if (style == null)
             //         return;
             // style.UnApplyCore(bindable, (Style)oldValue);