title: Invalid Cast Exception with FreshEssentials BindablePicker
body: <p>I have used FreshEssentials BindablePicker in other projects fine, but am having a very strange problem with a particular Page/PageModel.</p>
  
  <p>I have stripped the Page and PageModel right down to the following:
  Page:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;ContentPage x:Class="Manager.Pages.Config.RemoteConnectionsPage"
               xmlns="http://xamarin.com/schemas/2014/forms"
               xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
               xmlns:fe="clr-namespace:FreshEssentials;assembly=FreshEssentials"&gt;
      &lt;ContentPage.Content&gt;
          &lt;StackLayout Orientation="Vertical"&gt;
              &lt;Label HorizontalOptions="CenterAndExpand" Text="Main Page" /&gt;
              &lt;fe:BindablePicker DisplayProperty="Name" ItemsSource="{Binding Environments}" /&gt;
          &lt;/StackLayout&gt;
      &lt;/ContentPage.Content&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p>PageModel:</p>
  
  <pre><code>using System.Collections.Generic;
  using FreshMvvm;
  using PropertyChanged;
  
  namespace Manager.PageModels.Config
  {
      [ImplementPropertyChanged]
      public class RemoteConnectionsPageModel : FreshBasePageModel
      {
          public enum Environment
          {
              Live,
              Test,
              Third
          }
  
          public class EnvironmentPickerItem
          {
              public string Name {
                  get {
                      return Env.ToString ();
                  }
              }
  
              public Environment Env {
                  get;
                  set;
              }
          }
          public RemoteConnectionsPageModel ()
          {
              List&lt;EnvironmentPickerItem&gt; _Environments;
              _Environments = new List&lt;EnvironmentPickerItem&gt; ();
              _Environments.Add (new EnvironmentPickerItem () { Env = Environment.Live });
              _Environments.Add (new EnvironmentPickerItem () { Env = Environment.Test });
              _Environments.Add (new EnvironmentPickerItem () { Env = Environment.Third });
              this.Environments = _Environments;
          }
  
          public List&lt;EnvironmentPickerItem&gt; Environments {
              get;
              set;
          }
      }
  }
  </code></pre>
  
  <p>The problem is when I run the application, I get the exception below (full stack trace truncated):</p>
  
  <blockquote>
    <p>System.InvalidCastException: Specified cast is not valid.
      at FreshEssentials.Droid.BindablePickerRendererDroid.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs<code>1[TElement] e) [0x00031] in C:\Users\Michael\Documents\FreshEssentials\src\Droid\Renderers\BindablePickerRendererDroid.cs:46
      at Xamarin.Forms.Platform.Android.VisualElementRenderer</code>1[TElement].SetElement (TElement element) [0x000f4] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:190
      at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:131</p>
  </blockquote>
  
  <p>Looking at the source for the BindablePickerRendererDroid from the FreshEssentials repository, it appears to be the line:</p>
  
  <pre><code>((ObservableCollection&lt;string&gt;)e.NewElement.Items).CollectionChanged += RowsCollectionChanged;
  </code></pre>
  
  <p>in this method.</p>
  
  <pre><code>protected override void OnElementChanged(ElementChangedEventArgs&lt;BindablePicker&gt; e)
          {
              if (e.OldElement != null)
                  ((ObservableCollection&lt;string&gt;)e.OldElement.Items).CollectionChanged -= RowsCollectionChanged;
  
              if (e.NewElement != null)
              {
                  ((ObservableCollection&lt;string&gt;)e.NewElement.Items).CollectionChanged += RowsCollectionChanged;
                  if (Control == null)
                  {
                      var button = new AButton(Context) { Focusable = false, Clickable = true, Tag = this, Text = e.NewElement.Title };
                      button.SetOnClickListener(PickerListener.Instance);
                      SetNativeControl(button);
                  }
                  UpdatePicker();
              }
  
              base.OnElementChanged(e);
          }
  </code></pre>
  
  <p>The strange thing is that taking the above exact code into a brand new project works fine. I have checked versions of FreshEssentials and FreshMVVM, and they're identical between the working and non-working projects.</p>
  
  <p>Anyone come across this, and/or any thoughts?</p>
  
  <p>Full Xamarin Studio and other version info below:</p>
  
  <blockquote>
    <p>=== Xamarin Studio Community ===</p>
    
    <p>Version 6.1.4 (build 1)
    Installation UUID: 462e6ba8-9cb7-4b87-acc8-9dfb0ab2c6f7
    Runtime:
      Mono 4.6.2 (mono-4.6.0-branch/ac9e222) (64-bit)
      GTK+ 2.24.23 (Raleigh theme)</p>
    
    <p>Package version: 406020016</p>
    
    <p>=== NuGet ===</p>
    
    <p>Version: 3.4.3.0</p>
    
    <p>=== Xamarin.Profiler ===</p>
    
    <p>Version: 0.33.2
    Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler</p>
    
    <p>=== Xamarin.Android ===</p>
    
    <p>Version: 7.0.2.42 (Xamarin Studio Community)
    Android SDK: /Users/jameslavery/Library/Developer/Xamarin/android-sdk-macosx
      Supported Android versions:
          2.3   (API level 10)
          4.0.3 (API level 15)
          4.1   (API level 16)
          4.3   (API level 18)
          4.4   (API level 19)
          5.0   (API level 21)
          5.1   (API level 22)
          6.0   (API level 23)</p>
    
    <p>SDK Tools Version: 24.4.1
    SDK Platform Tools Version: 23.1
    SDK Build Tools Version: 23.0.1</p>
    
    <p>Java SDK: /usr
    java version "1.7.0_71"
    Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
    Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)</p>
    
    <p>Android Designer EPL code available here:
    <a href="https://github.com/xamarin/AndroidDesigner.EPL" rel="nofollow noreferrer">https://github.com/xamarin/AndroidDesigner.EPL</a></p>
    
    <p>=== Xamarin Android Player ===</p>
    
    <p>Version: 0.6.5
    Location: /Applications/Xamarin Android Player.app</p>
    
    <p>=== Apple Developer Tools ===</p>
    
    <p>Xcode 8.0 (11246)
    Build 8A218a</p>
    
    <p>=== Xamarin.iOS ===</p>
    
    <p>Version: 10.3.1.8 (Xamarin Studio Community)
    Hash: 7beaef4
    Branch: cycle8-xi
    Build date: 2016-12-20 02:58:14-0500</p>
    
    <p>=== Xamarin.Mac ===</p>
    
    <p>Version: 2.10.0.120 (Xamarin Studio Community)</p>
    
    <p>=== Build Information ===</p>
    
    <p>Release ID: 601040001
    Git revision: e606823f2dd01b4552216c013b597a73bec2068f
    Build date: 2017-01-10 17:28:57-05
    Xamarin addins: c92d0626d347aaa02839689eaac2961d24c9f446
    Build lane: monodevelop-lion-cycle8</p>
    
    <p>=== Operating System ===</p>
    
    <p>Mac OS X 10.11.6
    Darwin Jamess-MacBook-Pro.local 15.6.0 Darwin Kernel Version 15.6.0
        Thu Jun 23 18:25:34 PDT 2016
        root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64</p>
    
    <p>=== Enabled user installed addins ===</p>
    
    <p>StyleCop Support 1.0.1.9
    Gorilla Player 0.9.1.2
    XamlStyler 1.0.2</p>
  </blockquote>