How to set DataLoadMode to work

4 posts, 0 answers
  1. Adiel
    Adiel avatar
    60 posts
    Member since:
    Jun 2012

    Posted 17 Jun 2009 Link to this post

    Hi
    I have an async data source in my ViewModel class.
    I want to force the grid to show it's animation.
    I set that DataLoadMode property to Asynchronous but it's not working (the grid don't know that there is background operation)
    How can I make it work?
    (In silverlight it was IsBusy state but here it's readonly )
    Thanks
    Adiel
  2. Allan
    Allan avatar
    24 posts
    Member since:
    Jun 2009

    Posted 17 Jun 2009 Link to this post

    Aidel

    That is not how it is designed to work from what I have seen.

    The animation will show whilst the ItemsSource is being populated - so if your read operation assigns the return value into the ItemsSource, you will see the behavior you want. Be warned that if you are loading a large amount of data, the animation will only run whilst ItemsSource is being populated - it will freeze when the grid is being drawn, as the UI thread cannot handle both tasks at once. WPF still has the same limitation as WinForms, in that all UI operations happen on the same UI thread (if I'm incorrect here, someone feel free to correct me).
  3. UI for WPF is Visual Studio 2017 Ready
  4. Allan
    Allan avatar
    24 posts
    Member since:
    Jun 2009

    Posted 17 Jun 2009 Link to this post

    Aidel

    This article explains what I was talking about

    http://weblogs.asp.net/cschittko/archive/2008/05/14/wpf-ui-update-from-background-threads.aspx

    You may want to look into using a BackgroundWorker control and a progress bar ... may serve your purposes better.
  5. Adiel
    Adiel avatar
    60 posts
    Member since:
    Jun 2012

    Posted 18 Jun 2009 Link to this post

    Thanks guys.
    I'll look at some solution and let every one know if I'll found something interesting
    Adiel
Back to Top