summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls
diff options
context:
space:
mode:
authorkingces95 <kingces95@users.noreply.github.com>2016-04-18 18:39:23 (GMT)
committerSamantha Houts <samantha@teamredwall.com>2016-04-18 18:39:23 (GMT)
commit0d57b35f21b9499876c65c7be6d11637543605aa (patch)
tree93ac3a3b3dd699d11f6a5dd7a3864bc32b8eee8e /Xamarin.Forms.Controls
parent8f5c5e4e06b1ec5b781a6c20d75a67c8d82234f2 (diff)
downloadxamarin-forms-0d57b35f21b9499876c65c7be6d11637543605aa.zip
xamarin-forms-0d57b35f21b9499876c65c7be6d11637543605aa.tar.gz
xamarin-forms-0d57b35f21b9499876c65c7be6d11637543605aa.tar.bz2
CarouselView Fixes (#101)
* Fix CarouselView.Item * CarouselView formatting * Move ItemsView.Count to IItemsViewController * Remove dead code: CarouselView.IndexOf * CarouselView re-layout subviews on resize. * Add ItemTemplate to resources.xaml on UWP * Docs
Diffstat (limited to 'Xamarin.Forms.Controls')
-rw-r--r--Xamarin.Forms.Controls/GalleryPages/CarouselViewGallery.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/Xamarin.Forms.Controls/GalleryPages/CarouselViewGallery.cs b/Xamarin.Forms.Controls/GalleryPages/CarouselViewGallery.cs
index c5b431d..c2e0ef7 100644
--- a/Xamarin.Forms.Controls/GalleryPages/CarouselViewGallery.cs
+++ b/Xamarin.Forms.Controls/GalleryPages/CarouselViewGallery.cs
@@ -246,14 +246,19 @@ namespace Xamarin.Forms.Controls
_eventLog = CreateValue(string.Empty, "EventLog");
_carouselView.ItemSelected += (s, o) => {
- var selectedItem = ((Item)o.SelectedItem).Id;
- _selectedItem.Text = $"{selectedItem}";
+ var selectedItem = (Item)o.SelectedItem;
+ var selectedItemId = selectedItem.Id;
+ if (selectedItem != _carouselView.Item)
+ throw new Exception("CarouselView.Item != ItemSelected");
+ _selectedItem.Text = $"{selectedItemId}";
OnEvent("i");
};
_carouselView.PositionSelected += (s, o) => {
var selectedPosition = (int)o.SelectedPosition;
- _selectedPosition.Text = $"{selectedPosition}";
+ if (_items[selectedPosition] != _carouselView.Item)
+ throw new Exception("CarouselView.Item != Items[selectedPosition]");
+ _selectedPosition.Text = $"{selectedPosition}";
OnEvent("p");
};