Share via

How to skip loading details pane while navigating in a ListView?

MG Bhadurudeen 631 Reputation points
2021-01-01T05:31:26.267+00:00

Hello,

Sorry for my wordings, I have expressed my requirement in the way I know.

I have a listview on the left side to show the id&names of all records, as shown in the image, and a details pane on the right to show the details of the selected record. When I click on the left side NamesListView, it takes almost 1 second to load and display a record, since it has many fields-bindings in the details pane. That's not an issue I am asking.

What I need is, When I navigate in the NamesListView to view records by press the keyboard's down keys continuously, it takes the same 1 second to go to the next listview item, even if I don't need/view that record.

For example, there are 10 items in the listview, If I go to the (bottom most)10th item from the (topmost)1st item, it takes 10 seconds to reach the bottom. Actually, I don't want to view the 1 to 9 records. I want to view the 10th record only.

Please note, I don't want the user to press an Enter to show a record, as we do in Windows Explorer. In my app, I am using the selection_changed, to view the record details.

52607-pass-copy.png

Developer technologies | Universal Windows Platform (UWP)

1 answer

Sort by: Most helpful
  1. Yan Gu - MSFT 2,681 Reputation points
    2021-01-05T06:34:31.197+00:00

    Hello,

    Welcome to Microsoft Q&A Case.

    You could try to add a flag between the loading process which rendering the detailed pane, and cancel or return the loading process when the selection changed in ListView.
    There is a simple code you could refer to:

    bool flag = false;  
    
    private async void listView_SelectionChanged(object sender, SelectionChangedEventArgs e)  
    {  
        if(flag==false)  
        {  
            flag = true;  
        }  
        else if(flag==true)  
        {  
            flag = false;  
            return;  
        }  
        RenderUi();  
    }  
    

    You could try another more complex flag to do the job, and you could try to put the return code(or other way to cancel the loading process) in the proper location as needed.


    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.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.