diff options
author | Samantha Houts <samantha.houts@xamarin.com> | 2016-03-30 14:43:50 -0700 |
---|---|---|
committer | Samantha Houts <samantha.houts@xamarin.com> | 2016-04-01 11:14:27 -0700 |
commit | bba74db5dcf425c2d45a8128da15f5f616b78677 (patch) | |
tree | 907ecba85fc04b16907ed3d29aab691414d8dc6a /Xamarin.Forms.Platform.WinRT | |
parent | 39787d31aa4c5d2d3d13b9656cb929e03fc88e04 (diff) | |
download | xamarin-forms-bba74db5dcf425c2d45a8128da15f5f616b78677.tar.gz xamarin-forms-bba74db5dcf425c2d45a8128da15f5f616b78677.tar.bz2 xamarin-forms-bba74db5dcf425c2d45a8128da15f5f616b78677.zip |
[W] Setting CurrentPage in CarouselPage ctor works
Diffstat (limited to 'Xamarin.Forms.Platform.WinRT')
-rw-r--r-- | Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs b/Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs index 8b5e52b5..97733cf6 100644 --- a/Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs +++ b/Xamarin.Forms.Platform.WinRT/CarouselPageRenderer.cs @@ -92,8 +92,12 @@ namespace Xamarin.Forms.Platform.WinRT _tracker.Element = newPage; + // Adding Items triggers the SelectionChanged event, + // which will reset the CurrentPage unless we tell it to ignore. + _fromUpdate = true; for (var i = 0; i < newPage.Children.Count; i++) Items.Add(newPage.Children[i]); + _fromUpdate = false; ((INotifyCollectionChanged)newPage.Children).CollectionChanged += OnChildrenChanged; newPage.PropertyChanged += OnElementPropertyChanged; |