summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2017-03-22 17:09:41 +0100
committerSamantha Houts <samantha@teamredwall.com>2017-03-22 09:09:41 -0700
commit8cc913794d1c58bb1961a676387016e6df31b81a (patch)
tree2ec4420c5c190cdb3c6296f5af2d9b84c824e3df /Xamarin.Forms.Core
parentc65a9a8c57d93b0eff38fd8b06223f6a04688c59 (diff)
downloadxamarin-forms-8cc913794d1c58bb1961a676387016e6df31b81a.tar.gz
xamarin-forms-8cc913794d1c58bb1961a676387016e6df31b81a.tar.bz2
xamarin-forms-8cc913794d1c58bb1961a676387016e6df31b81a.zip
[C] Make sure all children are parented (#831)
* unit test * [C] make sure all children are properly parented
Diffstat (limited to 'Xamarin.Forms.Core')
-rw-r--r--Xamarin.Forms.Core/Layout.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/Layout.cs b/Xamarin.Forms.Core/Layout.cs
index 87a3453b..f5b71f3b 100644
--- a/Xamarin.Forms.Core/Layout.cs
+++ b/Xamarin.Forms.Core/Layout.cs
@@ -70,6 +70,10 @@ namespace Xamarin.Forms
protected Layout()
{
+ //if things were added in base ctor (through implicit styles), the items added aren't properly parented
+ if (InternalChildren.Count > 0)
+ InternalChildrenOnCollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, InternalChildren));
+
InternalChildren.CollectionChanged += InternalChildrenOnCollectionChanged;
}