diff options
author | Stephane Delcroix <stephane@delcroix.org> | 2016-11-09 15:15:12 +0100 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-11-16 12:03:13 -0800 |
commit | e5af21fdc32972d4355af86349d446a2bb6a5b02 (patch) | |
tree | 50cde95dcc90832977f5c4caf23eee6cca087601 /Xamarin.Forms.Platform.iOS/Renderers | |
parent | 693cc75068fed11c2760a1e8ef2b05310359bbea (diff) | |
download | xamarin-forms-e5af21fdc32972d4355af86349d446a2bb6a5b02.tar.gz xamarin-forms-e5af21fdc32972d4355af86349d446a2bb6a5b02.tar.bz2 xamarin-forms-e5af21fdc32972d4355af86349d446a2bb6a5b02.zip |
[C] Use a Binding for ItemsSource object selection
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/Renderers')
-rw-r--r-- | Xamarin.Forms.Platform.iOS/Renderers/PickerRenderer.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/PickerRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/PickerRenderer.cs index d0cc4ece..5a7fa22d 100644 --- a/Xamarin.Forms.Platform.iOS/Renderers/PickerRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Renderers/PickerRenderer.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Specialized; using System.ComponentModel; using UIKit; using RectangleF = CoreGraphics.CGRect; @@ -15,7 +16,7 @@ namespace Xamarin.Forms.Platform.iOS protected override void OnElementChanged(ElementChangedEventArgs<Picker> e) { if (e.OldElement != null) - ((ObservableList<string>)e.OldElement.Items).CollectionChanged -= RowsCollectionChanged; + ((INotifyCollectionChanged)e.OldElement.Items).CollectionChanged -= RowsCollectionChanged; if (e.NewElement != null) { @@ -55,7 +56,7 @@ namespace Xamarin.Forms.Platform.iOS UpdatePicker(); UpdateTextColor(); - ((ObservableList<string>)e.NewElement.Items).CollectionChanged += RowsCollectionChanged; + ((INotifyCollectionChanged)e.NewElement.Items).CollectionChanged += RowsCollectionChanged; } base.OnElementChanged(e); |