title: Xamarin Forms Switch Toggled event doesn't bind with viewmodel
body: <p>I have a Forms XAML Page and in there I have a listview, and each element has a Switch (xamarin default). I can bind the data from the items to the listview, but I cannot subscrive the Switch event "Toggled", as it causes the item not to show. I also tried with ICommand and Command, as it is instructed to do with buttons, but the result is the same, nothing shown. How can I handle the switch toggle from the my viewmodel?</p>
  
  <h2>View</h2>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
               xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
               x:Class="TouristicWallet.Views.WalletManagementPage"
               xmlns:vm="clr-namespace:TouristicWallet.ViewModels"
               xmlns:converters="clr-namespace:TouristicWallet.Converters"
               &gt;
  
    &lt;ContentPage.BindingContext&gt;
      &lt;vm:WalletManagementViewModel x:Name="ViewModel"/&gt;
    &lt;/ContentPage.BindingContext&gt;
  
    &lt;ContentPage.Resources&gt;
      &lt;ResourceDictionary&gt;
        &lt;converters:CurrencyIdToCodeConverter x:Key="idToCodeConverter"/&gt;
      &lt;/ResourceDictionary&gt;
    &lt;/ContentPage.Resources&gt;
  
    &lt;StackLayout&gt;
      &lt;ListView x:Name="MyCurrencies" ItemsSource="{Binding Currencies, Mode=OneWay}"&gt;
        &lt;ListView.ItemTemplate&gt;
          &lt;DataTemplate&gt;
            &lt;ViewCell&gt;
              &lt;StackLayout Orientation="Horizontal"&gt;
                &lt;Label Text="{Binding Currency.Initials, Mode=OneWay}" /&gt;
                &lt;Switch IsToggled="{Binding IsOwned, Mode=TwoWay}"
                        Toggled="{Binding Toggled}"
                        /&gt;
              &lt;/StackLayout&gt;
            &lt;/ViewCell&gt;
          &lt;/DataTemplate&gt;
        &lt;/ListView.ItemTemplate&gt;
      &lt;/ListView&gt;
  
    &lt;/StackLayout&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  
  <h2>ViewModel</h2>
  
  <pre><code>public class WalletManagementViewModel : ViewModelBase
  {
  
      private readonly List&lt;OwnedCurrencyWrapper&gt; _currencies = new List&lt;OwnedCurrencyWrapper&gt;();
      public List&lt;OwnedCurrencyWrapper&gt; Currencies { get { return _currencies; } }
  
      public WalletManagementViewModel()
      {
          CurrencyDataAccess cda = new CurrencyDataAccess();
          foreach (var item in cda.GetCurrencies())
          {
              Currencies.Add(new OwnedCurrencyWrapper(item));
          }
  
          OnPropertyChanged(nameof(Currencies));
      }
  
      public class OwnedCurrencyWrapper
      {
          public Currency Currency { get; private set; }
          public Boolean IsOwned { get; set; }
          public ICommand Toggled { get; set; }
  
  
          public OwnedCurrencyWrapper(Currency currency)
          {
              Currency = currency;
              WalletDataAccess wda = WalletDataAccess.Instance;
              IsOwned = wda.IsOwned(Currency.Id);
  
              Toggled = new Command(() =&gt; Update());
          }
  
          public void Update()
          {
              WalletDataAccess wda = WalletDataAccess.Instance;
              if (IsOwned) wda.RemoveOwnedCurrency(Currency.Id);
              else wda.OwnCurrency(Currency.Id);
  
          }
  
          public void Toggled_handler(object sender, ToggledEventArgs e)
          {
              Update();
          }
      }
  }
  </code></pre>
  
  <p>I am not using any mvvm framework</p>