Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Load your data asynchronous. Present something nice on the GUI for the user while loading. The following code can help you with this:</p> <pre><code>BackgroundWorker bgWorker = new BackgroundWorker() { WorkerReportsProgress=true}; bgWorker.DoWork += (s, e) =&gt; { // Load here your file/s // Use bgWorker.ReportProgress(); to report the current progress }; bgWorker.ProgressChanged+=(s,e)=&gt;{ // Here you will be informed about progress and here it is save to change/show progress. // You can access from here savely a ProgressBars or another control. }; bgWorker.RunWorkerCompleted += (s, e) =&gt; { // Here you will be informed if the job is done. // Use this event to unlock your gui }; bgWorker.RunWorkerAsync(); </code></pre> <p>The app is not faster but it seems to be much faster because the GUI is immediately visible and responsive. Maybe you also can show the user a part of the loaded data while loading the rest. Use the <code>ProgressChanged</code>-event for doing this.</p> <p><strong>Update</strong></p> <p>I'm not sure if I understand your problem right. If your problem is not the time data needs to be loaded, then something is odd in your application. WPF is IMO very fast. Control-creation does not takes a lot of time. I visualize much bigger lists as you mention in some milliseconds. </p> <p>Try to look if you have something in your UI that hinders the DataGrid to virtualize the Items. Maybe you have a proplem there. To analyse WPF apps, I can recommend you the <a href="http://msdn.microsoft.com/en-us/library/aa969767.aspx">WPF Profiling Tools</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload