CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

IsBusy set to false after OnRefreshed in view model

rated by 0 users
Not Answered This post has 0 verified answers | 4 Replies | 2 Followers

Not Ranked
9 Posts
Marsh posted on Fri, May 18 2012 10:29 AM

Hi,

I am using silverlight CSLA ViewModel. I am facing issue when set IsBusy property after OnRefreshed. I have set IsBusy property to true in override OnRefreshed method. It does not set. Then i have keep log _PropertyChanged event and i found that after completion of override OnRefreshed method, IsBusy property set back to false!!!

So it will does not show busy indicator. Does is there any implementation of isbusy in viewmodebase so it set busy after onrefreshed. or any work around. 

All Replies

Top 10 Contributor
9,282 Posts

OnRefreshed runs after the refresh operation is complete. I think that the IsBusy property is set to false after OnRefreshed is invoked, with the assumption that this is the point at which the refresh operation is totally complete (the refresh is done, and any of your code in OnRefreshed is also done).

Are you starting another asynchronous operation in the OnRefreshed overload?

Rocky

Not Ranked
9 Posts
Marsh replied on Sat, May 19 2012 2:38 AM

Yes, Rocky. I am starting another asynchronous operation in OnRefreshed overload method to fetch look up data and other general setting. So I am setting IsBusy property true in OnRefreshed method. But it set false when OnRefreshed call completed. Is there any way to set Isbusy property?

Thanks.

Top 10 Contributor
9,282 Posts

No, the behavior of the base class is as I described.

If you need your viewmodel to work differently, you should probably just not use the CSLA base class, but instead should create your own.

Rocky

Top 10 Contributor
1,815 Posts

Have you considered to create a readonly object for "Unit of Work" loader that will fetch both lookupdata and business object in the same dataportal call.

This will greatly simplify your code and need only one async operation to complete.
Plus - you need the lookupdata BEFORE you hook up the data object in databinding so having this handled in a "UseCaseFetcher" is preferred foverstarting new async operations in OnRefreshed.

Se this thread too:http://forums.lhotka.net/forums/p/10508/49556.aspx#49556

Jonny Bekkum, Norway CslaContrib Coordinator

Page 1 of 1 (5 items) | RSS

Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems