For our application, we need to display the busy indicator during navigation since some controls taking time to load. Normally for long running operation i will create a separate task and will trigger busy indicator in UI Thread but in this case I couldn't do that.
Once the busy indicator started to spin, it got disturbed by Frame.Source or Frame.Navigate which also executes in ui thread. so busy indictor hidden away .
The below is the piece of code i have used for navigation. This is executed as separate task .
public virtual void NavigateTo(string pageKey, object parameter)
{
Frame frame = null;
Action actionToExecuteOnUIContext = () =>
{
frame = GetDescendantFromName(Application.Current.MainWindow, "ContentFrame") as Frame;
if (frame != null)
{
frame.LoadCompleted -= frame_LoadCompleted;
frame.LoadCompleted += frame_LoadCompleted;
frame.Source = _pagesByKey[pageKey];
frame.DataContext = parameter;
}
};
Application.Current.Dispatcher.BeginInvoke(actionToExecuteOnUIContext, DispatcherPriority.Normal);
}
}
Any way to fix this or an alternative
WPF & RadBusyIndicator & .Net 4.5