diff options
author | E.Z. Hart <hartez@gmail.com> | 2016-12-06 10:23:22 -0700 |
---|---|---|
committer | E.Z. Hart <hartez@gmail.com> | 2016-12-06 10:23:22 -0700 |
commit | 3d090a33d4c1fb071ccb2ec822ef7fc94ec3f89a (patch) | |
tree | 53db5464acf3da77d576e08a273388637fa60090 | |
parent | 20e2e12dce2f81b92e8682f128cd81e08469f485 (diff) | |
download | xamarin-forms-3d090a33d4c1fb071ccb2ec822ef7fc94ec3f89a.tar.gz xamarin-forms-3d090a33d4c1fb071ccb2ec822ef7fc94ec3f89a.tar.bz2 xamarin-forms-3d090a33d4c1fb071ccb2ec822ef7fc94ec3f89a.zip |
Possible fix for race condition in 21177 UI test
-rw-r--r-- | Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs b/Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs index 5654fa39..706553e3 100644 --- a/Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs +++ b/Xamarin.Forms.ControlGallery.iOS/CustomRenderers.cs @@ -471,6 +471,8 @@ namespace Xamarin.Forms.ControlGallery.iOS Element.InvokeItemSelected(indexPath.Row); } + CollectionViewController _controller; + protected override void OnElementChanged(ElementChangedEventArgs<Bugzilla21177.CollectionView> e) { if (e.NewElement != null) @@ -482,8 +484,8 @@ namespace Xamarin.Forms.ControlGallery.iOS MinimumInteritemSpacing = 5, // minimum spacing between cells MinimumLineSpacing = 5 // minimum spacing between rows if ScrollDirection is Vertical or between columns if Horizontal }; - var collectionView = new CollectionViewController(flowLayout, ItemSelected); - SetNativeControl(collectionView.CollectionView); + _controller = new CollectionViewController(flowLayout, ItemSelected); + SetNativeControl(_controller.CollectionView); } base.OnElementChanged(e); |