Forum Xamarin.Forms

Screen transition when tapping ListView

When I tap ListView, another screen is displayed.
If you tap continuously, multiple screens will open.
Please tell me the solution.

private async void List_ItemTapped(Object sender, ItemTappedEventArgs e)
{
    try
    {

        await PopupNavigation.Instance.PushAsync(new DataPage());

    }
    catch
    {
    }

}

Best Answer

  • LeonLuLeonLu Member, Xamarin Team Xamurai
    Accepted Answer

    You can disabled the listview when navigate page, after that, you can enable your listview.

    private async void ListView_ItemTapped(object sender, ItemTappedEventArgs e)
            {
                ListView listView=sender as ListView;
                listView.IsEnabled = false;
                await Navigation.PushAsync(new Page1());
                listView.IsEnabled = true;
         }
    
    

Answers

  • LeonLuLeonLu Member, Xamarin Team Xamurai
    Accepted Answer

    You can disabled the listview when navigate page, after that, you can enable your listview.

    private async void ListView_ItemTapped(object sender, ItemTappedEventArgs e)
            {
                ListView listView=sender as ListView;
                listView.IsEnabled = false;
                await Navigation.PushAsync(new Page1());
                listView.IsEnabled = true;
         }
    
    

Sign In or Register to comment.