Screen transition when tapping ListView

TS44 81 Reputation points
2020-12-01T22:58:30.953+00:00

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
    {
    }

}
Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,296 questions
0 comments No comments
{count} votes

Accepted answer
  1. JessieZhang-MSFT 7,706 Reputation points Microsoft Vendor
    2020-12-02T01:50:11.26+00:00

    Hello,

    Welcome to our Microsoft Q&A platform!

    You can disabled the listview when you navigate between pages, 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;  
         }  
    

    Best Regards,

    Jessie Zhang

    ---
    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful