[NUI] Add inherit binding context support (#894)
authorXianbing Teng <xb.teng@samsung.com>
Fri, 21 Jun 2019 01:39:14 +0000 (09:39 +0800)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Fri, 21 Jun 2019 01:39:14 +0000 (10:39 +0900)
* [NUI] Add inherit binding context support

* Add inherit binding context for layer

src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/Layer.cs
src/Tizen.NUI/src/public/XamlBinding/ContentPage.cs

index feed447..96c8d7a 100755 (executable)
@@ -4030,6 +4030,7 @@ namespace Tizen.NUI.BaseComponents
                     };
                     ChildAdded(this, e);
                 }
+                BindableObject.SetInheritedBindingContext(child, this?.BindingContext);
             }
         }
 
index 93f698e..c0e1654 100755 (executable)
@@ -287,6 +287,7 @@ namespace Tizen.NUI
                 if (NDalicPINVOKE.SWIGPendingException.Pending)
                     throw NDalicPINVOKE.SWIGPendingException.Retrieve();
                 Children.Add(child);
+                BindableObject.SetInheritedBindingContext(child, this?.BindingContext);
             }
         }
 
index 63891ff..85c202b 100755 (executable)
@@ -47,6 +47,11 @@ namespace Tizen.NUI
             {
                 self.Root.Add((View)newValue);
             }
+            var newElement = (Element)newValue;
+            if (newElement != null)
+            {
+                BindableObject.SetInheritedBindingContext(newElement, bindable.BindingContext);
+            }
         });
 
         /// <summary>