I have an issue on my ListView in my xamarin.forms application where I use MVVM pattern. I hope you could help me. Here is my xaml:
First of all change your delete button XAML.
<Button Grid.Column="1"
Text ="-"
Command="{Binding Path=BindingContext.DeleteVolumeCommand, Source={x:Reference MissingVolumeListView}}"
CommandParameter="{Binding .}" />
The command needs to have its binding context changed to the view model via the listview name.
The command parameter however can just pass the current binding which is the list view item.
In your view model you cannot reference any controls via name. Instead use the list that the list view has its ItemsSource bound to - Volumes.
You can remove the item directly.
_deleteVolumeCommand = new Command((e) =>
{
var item = (e as Volume);
Volumes.Remove(item);
});
Remember to also call notify property changed if Volumes is not an ObservableCollection.