[NUI] SetProperty first then SetValue (#1639)
authorzhouleonlei <56956725+zhouleonlei@users.noreply.github.com>
Fri, 29 May 2020 06:33:41 +0000 (14:33 +0800)
committerGitHub <noreply@github.com>
Fri, 29 May 2020 06:33:41 +0000 (14:33 +0800)
src/Tizen.NUI/src/internal/Xaml/ApplyPropertiesVisitor.cs

index 4c5ce06..8c6f27d 100755 (executable)
@@ -345,14 +345,15 @@ namespace Tizen.NUI.Xaml
             if (xpe == null && TrySetBinding(xamlelement, property, localName, value, lineInfo, out xpe))
                 return;
 
-            //If it's a BindableProberty, SetValue
-            if (xpe == null && TrySetValue(xamlelement, property, attached, value, lineInfo, serviceProvider, out xpe))
-                return;
-
+            //Call TrySetProperty first and then TrySetValue to keep the code logic consistent whether it is through xaml or code.
             //If we can assign that value to a normal property, let's do it
             if (xpe == null && TrySetProperty(xamlelement, localName, value, lineInfo, serviceProvider, context, out xpe))
                 return;
 
+            //If it's a BindableProberty, SetValue
+            if (xpe == null && TrySetValue(xamlelement, property, attached, value, lineInfo, serviceProvider, out xpe))
+                return;
+
             //If it's an already initialized property, add to it
             if (xpe == null && TryAddToProperty(xamlelement, propertyName, value, xKey, lineInfo, serviceProvider, context, out xpe))
                 return;