From 35c9ff2ec4be2c6678087bb108e7cd3c1c1a310b Mon Sep 17 00:00:00 2001 From: Xianbing Teng Date: Tue, 11 Jun 2019 10:24:12 +0800 Subject: [PATCH] [NUI] Add inherit binding context support (#880) --- src/Tizen.NUI.Xaml/src/public/Forms/BaseComponents/View.cs | 1 + src/Tizen.NUI.Xaml/src/public/XamlBinding/ContentPage.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/Tizen.NUI.Xaml/src/public/Forms/BaseComponents/View.cs b/src/Tizen.NUI.Xaml/src/public/Forms/BaseComponents/View.cs index 49723da..8fd63ab 100755 --- a/src/Tizen.NUI.Xaml/src/public/Forms/BaseComponents/View.cs +++ b/src/Tizen.NUI.Xaml/src/public/Forms/BaseComponents/View.cs @@ -976,6 +976,7 @@ namespace Tizen.NUI.Xaml.Forms.BaseComponents }; ChildAdded(this, e); } + BindableObject.SetInheritedBindingContext(child, this?.BindingContext); } /// diff --git a/src/Tizen.NUI.Xaml/src/public/XamlBinding/ContentPage.cs b/src/Tizen.NUI.Xaml/src/public/XamlBinding/ContentPage.cs index 3fa1665..6f5d388 100755 --- a/src/Tizen.NUI.Xaml/src/public/XamlBinding/ContentPage.cs +++ b/src/Tizen.NUI.Xaml/src/public/XamlBinding/ContentPage.cs @@ -45,6 +45,11 @@ namespace Tizen.NUI.Xaml { self.Root.Add((View)newValue); } + var newElement = (Element)newValue; + if (newElement != null) + { + BindableObject.SetInheritedBindingContext(newElement, bindable.BindingContext); + } }); /// -- 2.7.4