Skip to content
An example app to show one way in which to create a multi-select ListView in Xamarin.Forms.
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.


An example app to show one way in which to create a multi-select ListView in Xamarin.Forms.

More info here:

This app has some new types, such as the selectable item:

public class SelectableItem : BindableObject
    public static readonly BindableProperty DataProperty;
    public static readonly BindableProperty IsSelectedProperty;

    public SelectableItem(object data);
    public SelectableItem(object data, bool isSelected);

    public object Data { get; set; }
    public bool IsSelected { get; set; }
public class SelectableItem<T> : SelectableItem
    public SelectableItem(T data);
    public SelectableItem(T data, bool isSelected);

    public new T Data { get; set; }

There is also a selectable collection, with some convenience members:

public class SelectableObservableCollection<T> : ObservableCollection<SelectableItem<T>>
    public SelectableObservableCollection();
    public SelectableObservableCollection(IEnumerable<T> collection);
    public SelectableObservableCollection(IEnumerable<SelectableItem<T>> collection);

    public IEnumerable<T> SelectedItems { get; }
    public IEnumerable<T> UnselectedItems { get; }

    public void Add(T item, bool selected = false);
    public void Insert(int index, T item, bool selected = false);
    public bool IsSelected(T item);
    public bool Contains(T item);
    public int IndexOf(T item);
    public bool Remove(T item);

These types can be used like any other collection:

public partial class MainPage : ContentPage
    public MainPage()

        Items = new SelectableObservableCollection<string>();

        Items.Add("Hello World");
        Items.Add("Testing 1. 2. 3.");
        Items.Add("Xamarin.Forms", true); // this one is selected

        BindingContext = this;

    public SelectableObservableCollection<string> Items { get; }

But, they make any list support multi-select:

<ListView ItemsSource="{Binding Items}"

                <!-- set the selected indicator (optional) -->
                    <BoxView Color="Red" WidthRequest="12" HeightRequest="12" />

                <!-- set the content (optional) -->
                    <Label Text="{Binding}" />

You can’t perform that action at this time.