summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r--Xamarin.Forms.Platform.Android/AppCompat/PickerRenderer.cs7
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/PickerRenderer.cs7
2 files changed, 8 insertions, 6 deletions
diff --git a/Xamarin.Forms.Platform.Android/AppCompat/PickerRenderer.cs b/Xamarin.Forms.Platform.Android/AppCompat/PickerRenderer.cs
index 6650d9e6..9587d0ad 100644
--- a/Xamarin.Forms.Platform.Android/AppCompat/PickerRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/AppCompat/PickerRenderer.cs
@@ -6,6 +6,7 @@ using Android.Content.Res;
using Android.Text;
using Android.Widget;
using Object = Java.Lang.Object;
+using System.Collections.Specialized;
namespace Xamarin.Forms.Platform.Android.AppCompat
{
@@ -31,7 +32,7 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
{
_disposed = true;
- ((ObservableList<string>)Element.Items).CollectionChanged -= RowsCollectionChanged;
+ ((INotifyCollectionChanged)Element.Items).CollectionChanged -= RowsCollectionChanged;
}
base.Dispose(disposing);
@@ -40,11 +41,11 @@ namespace Xamarin.Forms.Platform.Android.AppCompat
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)
{
- ((ObservableList<string>)e.NewElement.Items).CollectionChanged += RowsCollectionChanged;
+ ((INotifyCollectionChanged)e.NewElement.Items).CollectionChanged += RowsCollectionChanged;
if (Control == null)
{
EditText textField = CreateNativeControl();
diff --git a/Xamarin.Forms.Platform.Android/Renderers/PickerRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/PickerRenderer.cs
index b6d81718..edfe9e7b 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/PickerRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/PickerRenderer.cs
@@ -9,6 +9,7 @@ using ADatePicker = Android.Widget.DatePicker;
using ATimePicker = Android.Widget.TimePicker;
using Object = Java.Lang.Object;
using Orientation = Android.Widget.Orientation;
+using System.Collections.Specialized;
namespace Xamarin.Forms.Platform.Android
{
@@ -30,7 +31,7 @@ namespace Xamarin.Forms.Platform.Android
if (disposing && !_isDisposed)
{
_isDisposed = true;
- ((ObservableList<string>)Element.Items).CollectionChanged -= RowsCollectionChanged;
+ ((INotifyCollectionChanged)Element.Items).CollectionChanged -= RowsCollectionChanged;
}
base.Dispose(disposing);
@@ -44,11 +45,11 @@ namespace Xamarin.Forms.Platform.Android
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)
{
- ((ObservableList<string>)e.NewElement.Items).CollectionChanged += RowsCollectionChanged;
+ ((INotifyCollectionChanged)e.NewElement.Items).CollectionChanged += RowsCollectionChanged;
if (Control == null)
{
var textField = CreateNativeControl();