Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/syncfusionexamples/xamarin-forms-listview-selected-item-binding

This repository contains sample about how to bind Xamarrin.Forms ListView SelectedItem in MVVM?
https://github.com/syncfusionexamples/xamarin-forms-listview-selected-item-binding

listview xamarin xamarin-forms xamarin-listview

Last synced: 27 days ago
JSON representation

This repository contains sample about how to bind Xamarrin.Forms ListView SelectedItem in MVVM?

Awesome Lists containing this project

README

        

# Binding SelectedItem in Listview

ListView support to select the items through binding the [SelectedItem](https://help.syncfusion.com/cr/cref_files/xamarin/Syncfusion.SfListView.XForms~Syncfusion.ListView.XForms.SfListView~SelectedItem.html) property from view model by implementing the `INotifyPropertyChanged` interface that gives the call back notification to UI.

```

```
```
//ViewModel.cs
public class BookInfoRepository : INotifyPropertyChanged
{
private object selectedItem;
public object SelectedItem
{
get { return this.selectedItem; }
set
{
this.selectedItem = value;
this.OnPropertyChanged("SelectedItem");
}
}
public BookInfoRepository()
{
SelectedItem = BookInfoCollection[2];
}
}
```
To know more about MVVM in ListView, please refer our documentation [here](https://help.syncfusion.com/xamarin/sflistview/mvvm)