I'm using the BusyAnimation for WPF and have bound IsRunning to my BusinessListBase's IsBusy property as suggested. It works wonderfully.
I have a public method on my BusinessListBase that recalculates all the child objects data which can take about 10 - 15 seconds. I'd love to set the IsBusy property when this runs so that my BusyAnimation executes.
I have tried executing a second BusyAnimation but it does not seem to be firing...at least it's not displaying.
Is there anyway to mark the list as busy?
.NET collections don't normally implement INotifyPropertyChanged, and the CSLA collection types don't either.
That means there's no notification mechanism by which data binding (hence BusyAnimation) would know that an IsBusy property has changed.
It is probably better to follow an MVVM design pattern, where the UI is bound to a viewmodel, which exposes the collection as a Model property (so you can bind to it as well). Then you can put an IsBusy property on the viewmodel, which is fine since your viewmodel can implement INotifyPropertyChanged.
This is all particularly easy if you use the ViewModel<T> base class in Csla.Xaml, since it provides support for most/all of this.
One other thng - this whole busy animation stuff will only work as expected if that long-running task is running on a background thread (using BackgroundWorker or something). Otherwise you'll block the UI thread and nothing will actually happen.
I knew you were going to suggest MVVM. I suspected the reasons you mentioned and I'm glad to have them confirmed.
Copyright (c) Marimer LLC