Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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?
- Host: GitHub
- URL: https://github.com/syncfusionexamples/xamarin-forms-listview-selected-item-binding
- Owner: SyncfusionExamples
- Created: 2019-08-02T05:55:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-15T13:42:52.000Z (11 months ago)
- Last Synced: 2024-04-14T12:07:22.414Z (9 months ago)
- Topics: listview, xamarin, xamarin-forms, xamarin-listview
- Language: C#
- Homepage:
- Size: 497 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)