I'm using MVVM with property "IsBusy", set the DataContext to this property and change it when needed.
The problem is that in some cases the BusyIndicator (BI) is not visible.
Here is how the BI configured:
<telerik:RadBusyIndicator x:Name="CashierBusyIndicator" IsBusy="{Binding IsBusy}" > <Style TargetType="telerik:RadBusyIndicator">The view model seems like that:
public class CashierStationMainWindowModel : INotifyPropertyChanged { private bool _IsBusy; public bool IsBusy { get { return _IsBusy; } set { _IsBusy = value; OnPropertyChanged("IsBusy"); } } #region INotifyPropertyChanged implementation public event PropertyChangedEventHandler PropertyChanged; private void OnPropertyChanged(string propertyName = "") { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } #endregion }The method that change the BI is:
protected void EnableDisableBusyIndicatorAsync(bool enable) {CashierStationMainWindow.GetInstance().CashierStationWindowModel.IsBusy = enable; }
Simple not working example, this block is a button press implementation:
EnableDisableBusyIndicatorAsync(true);System.Threading.Thread.Sleep(5000);EnableDisableBusyIndicatorAsync(false);Some more info:
* The BI located at RadWindow object.
* The not working block run from a RadPage located inside the RadWindow
* Other RadPages call the EnableDisableBusyIndicatorAsync method and it works fine.
Thanks in advanced,
Eliran