CSLA Silverlight BusyAnimation - Leaves "dead spot" if Visibility is not set to collapsed

CSLA Silverlight BusyAnimation - Leaves "dead spot" if Visibility is not set to collapsed

Old forum URL: forums.lhotka.net/forums/t/7632.aspx


Jaans posted on Tuesday, September 15, 2009

I'm using the BusyAnimation control with great delight throughout my Silverlight applications - it really works well, and looks professional too.

My greatest appreciation is the fact that it can be scaled to any size without loosing "image quality".

I do however have a "bug" issue with the control:
Typically I "overlay" my BusyAnimation control over other controls to centre the control relative to the window. Then when the BusyAnimation control is not doing it's thing (i.e. when it's bound IsBusy property is false) it leaves an invisible "dead spot" on the UI.

While there is nothing showing visually, you cannot click "through" to the control underneath the BusyAnimation. Mouse overs, etc. are all non-responsive.

My solution is simple, but it keeps tripping me up. In addition to binding the IsBusy property of the BusyAnimation control, I also need to remember to bind the Visibility property of the BusyAnimation control (using a VisibilityConverter to the IsBusy property of the CslaDataProvider).

My suggestion is to have the Visibility base its value on the IsBusy property directly. The idea is that when IsBusy is false, then the Visibility is collapsed also, and made visible when IsBusy is true.

I cannot foresee a scenario where you might want the BusyAnimation control to "exist" when its not performing any animation magic.

If there is a scenario that calls for the reservation of the space that a BusyAnimation control might take up when IsBusy is true, perhaps we can add a property to the control that either reserves the space when it's not busy, or makes the visibility collapsed when it's not busy. A "mode" of sorts, in the same way that ASP.NET Validators makes use of the Display property (with a value of Static or Dynamic).

What do you think?

Many thanks

cds replied on Tuesday, September 15, 2009

I agree - I've experienced the same weird problem.

Jaans replied on Wednesday, September 30, 2009

Hi Rocky

Any chance of this making it onto the wish/bug list?

Thanks!

RockfordLhotka replied on Wednesday, September 30, 2009

I'll add it to the wish list, but I am not real excited about the idea. The reason being that the longer I spend building XAML controls the more I realize that anything I do automatically is a limit on UI flexibility.

Having one property affect another limits flexibility. Having one control manipulate another limits flexibility.

At the same time, and this is why I'm adding it to the wish list, I do agree that having controls "just work" is a nice feature. The problem is that if I make them "just work" for me, they almost certainly "just don't work" for someone else...

RockfordLhotka replied on Wednesday, September 30, 2009

I should say that I also often put the animation over the other controls on my form. But I do it in a Canvas. So really the Canvas is over the other controls, and the BusyAnimation is centered on the Canvas.

This way I set visibility on the Canvas, and IsBusy on BusyAnimation.

Using the Canvas is nice because it overlays all the controls, making them inaccessible while the async operation is running, and allows me to size BusyAnimation to one size, rather than trying to stretch it over the whole form (which can get really huge).

Copyright (c) Marimer LLC