Choose Skin

How to implement Auto Search in Xamarin Forms Application

Manish Kumar

This Example Demonstrate how to create suggestion List While typing any keyword in search bar in Xamarin.Forms Application.


First Create a Search Bar in Xaml file and also add a list to bind the search data.

<StackLayout Margin="0,0,0,0">
        <SearchBar Placeholder="Search Squads" x:Name="MainSearchBar" TextChanged="SearchBar_TextChanged" /> 
        <ListView x:Name="NamesListView" HasUnevenRows="true" >
                        <Label Text="{Binding .}" TextColor="Navy" FontSize="40" />


Now Add Code in Xaml.cs file :

using System;
using System.Collections.Generic;
using LetsHang.Models;
using LetsHang.Services;
using Xamarin.Forms;
using LetsHang.ViewModels;
using System.Linq;

namespace LetsHang.Views
    public partial class SquadsPage : ContentPage

        List<string> names = new List<string>
            "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"

        public SquadsPage()
            NamesListView.ItemsSource = names;
            BindingContext = new SquadViewModel();

        void SearchBar_TextChanged(object sender, Xamarin.Forms.TextChangedEventArgs e)
            var Keyword = MainSearchBar.Text;
            NamesListView.ItemsSource = names.Where(name =>


Replace The List and the Link Query According to Your Need in the project.