[Xaml] Add flag of binded object
authorFang Xiaohui <xiaohui.fang@samsung.com>
Fri, 16 Jul 2021 05:44:36 +0000 (13:44 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 19 Jul 2021 09:01:03 +0000 (18:01 +0900)
src/Tizen.NUI/src/internal/EXaml/Operation/CreateInstance.cs
src/Tizen.NUI/src/internal/EXaml/Operation/SetBindalbeProperty.cs
src/Tizen.NUI/src/internal/EXaml/Operation/SetProperty.cs
src/Tizen.NUI/src/public/XamlBinding/BindableObject.cs
src/Tizen.NUI/src/public/XamlBinding/Binding.cs

index 72b07cf..5add780 100755 (executable)
@@ -72,9 +72,9 @@ namespace Tizen.NUI.EXaml
                             paramList[i] = globalDataList.GatheredInstances[instance.Index];
                         }
 
-                        if (paramList[i] is ResourcePathExtension resourcePath)
+                        if (paramList[i] is IMarkupExtension markupExtension)
                         {
-                            paramList[i] = resourcePath.ProvideValue(null);
+                            paramList[i] = markupExtension.ProvideValue(null);
                         }
                     }
 
index 322713c..ea15c97 100755 (executable)
@@ -51,9 +51,9 @@ namespace Tizen.NUI.EXaml
                     value = globalDataList.GatheredInstances[valueIndex];
                 }
 
-                if (value is ResourcePathExtension resourcePath)
+                if (value is IMarkupExtension markupExtension)
                 {
-                    value = resourcePath.ProvideValue(null);
+                    value = markupExtension.ProvideValue(null);
                 }
 
                 instance.SetValue(property, value);
index 3c23429..a7086c4 100755 (executable)
@@ -68,9 +68,9 @@ namespace Tizen.NUI.EXaml
                 }
             }
 
-            if (value is ResourcePathExtension resourcePath)
+            if (value is IMarkupExtension markupExtension)
             {
-                value = resourcePath.ProvideValue(null);
+                value = markupExtension.ProvideValue(null);
             }
 
             property.SetMethod.Invoke(instance, new object[] { value });
index 8b71c24..60a89d8 100755 (executable)
@@ -46,7 +46,7 @@ namespace Tizen.NUI.Binding
 
                     if (newValue is BindableObject targetBindableObject)
                     {
-                        targetBindableObject.IsCreateByXaml = true;
+                        targetBindableObject.IsBinded = true;
                     }
                 }
             }),
@@ -256,7 +256,7 @@ namespace Tizen.NUI.Binding
         [EditorBrowsable(EditorBrowsableState.Never)]
         public void SetValue(BindableProperty property, object value)
         {
-            if (true == isCreateByXaml)
+            if (true == IsBinded)
             {
                 SetValue(property, value, false, true);
             }
@@ -578,7 +578,7 @@ namespace Tizen.NUI.Binding
             if (fromStyle && !CanBeSetFromStyle(targetProperty))
                 return;
 
-            IsCreateByXaml = true;
+            IsBinded = true;
 
             var context = GetOrCreateContext(targetProperty);
             if (fromStyle)
@@ -752,6 +752,12 @@ namespace Tizen.NUI.Binding
             }
         }
 
+        internal bool IsBinded
+        {
+            get;
+            set;
+        } = false;
+
         static void BindingContextPropertyBindingChanging(BindableObject bindable, BindingBase oldBindingBase, BindingBase newBindingBase)
         {
             object context = bindable.inheritedContext;
index e532187..f657be2 100755 (executable)
@@ -116,7 +116,7 @@ namespace Tizen.NUI.Binding
 
                 if (source is BindableObject bindableObject)
                 {
-                    bindableObject.IsCreateByXaml = true;
+                    bindableObject.IsBinded = true;
                 }
             }
         }