Local search with detail for each letter entered - Xamarin Forms

0

Each letter you type appears a white ball in the middle of the app (by the way it is updating the list), I wish I could not have it.

The error:

The code:

//Pesquisa localmente a cada letra digitada
private void OnTextChanged(object sender, TextChangedEventArgs e)
{
    //Letra Maiúscula
    MainSearchBar.Text = MainSearchBar.Text.ToUpper();

    //Pesquisa a cada dígito
    lstProduto.BeginRefresh();
    if (string.IsNullOrWhiteSpace(e.NewTextValue))
    {
        lstProduto.ItemsSource = produtos;
    }
    else
    {
        lstProduto.ItemsSource = produtos.Where(i => i.DESCRICAO.Contains(e.NewTextValue));
    }
    lstProduto.EndRefresh();
}
    
asked by anonymous 28.06.2018 / 20:45

1 answer

1

In your OnTextChanged method you are activating the IsRefreshing property of your ListView .

Here:

//Pesquisa localmente a cada letra digitada
private void OnTextChanged(object sender, TextChangedEventArgs e)
{
    ...
    lstProduto.BeginRefresh();
    ...
    lstProduto.EndRefresh();
}

In the range of these two calls ( BeginRefresh and EndRefresh ), the Listview component displays the 'busy' indicator.

Just remove these two calls as the indicator will no longer appear.

    
28.06.2018 / 23:43