This project has moved and is read-only. For the latest updates, please go here.

Controls not all (always) enabled after Busy Indicator

Feb 10, 2012 at 3:56 PM

I am using a Busy Indicator in a large, multi-page app that retrieves data using async wcf calls.  The busy indicator is on the main page and is bound to a value that is only changed by the comm code.  When an async call is started, the IsBusy bound property goes to true.  When the async call completes, the bound value goes to false.

This all works great - most of the time and in most cases.  However, when tested against a dataset that was a little larger (hence several seconds longer request times) - some of the controls are not re-enabled when the busy panel goes away.  If you mouse over them one at a time, they pick up their correct enabled state.  Both standard buttons and a custom built drop down control are displaying this behavior.  In the button case, the IsEnabled property is bound to an MVVM property that is set correctly.

The customer with the large dataset is complaining and I have not been able to find any workaround apart from disabling the busy indicator.  If I change the code to never set the IsBusy bound variable to true, all items are always correctly enabled.  But then the customer has no indication a data request is happening and the controls are touchable when they should not be.

Feb 28, 2014 at 9:01 AM
Edited Feb 28, 2014 at 12:45 PM
I have the same problem with this control. Some TabItems in my TabPanel remain disabled after setting IsBusy=false. It applies only to the controls that are presently visible.

I had to ad a GotFocus handler on all TabControls
    private void tabDetails_GotFocus(object sender, RoutedEventArgs e)
        //Hack BusyIndicator bug
            TabControl t = sender as TabControl;
            IEnumerable<TabItem> lti = CTools.FindVisualChildren<TabItem>(t);
            foreach (TabItem ti in lti)
                ti.IsEnabled = true;
        catch { }
Items get enabled as soon as they got focus.
Feb 28, 2014 at 2:25 PM

In v2.1 of the Toolkit, there is a property named BusyIndicator.FocusAferBusy. Before setting BusyIndicator.IsBusy to true, you could try to set the control you want to have the focus when BusyIndicator.IsBusy becomes false to this property.
Mar 1, 2014 at 4:54 PM
Edited Mar 1, 2014 at 4:56 PM
Thanks, I have 2.1 and this is not problem of focus I think, multiple (but not all) controls simply get disabled and not re-enabled. When I use WPF Inspector I can see IsEnabled = false. I will try to make up some example to reproduce the behavior.