Good day,
Following the instruction in your "Getting Started" section, after just updating the UI for WPF modules, I created a simple MenuItem under my Menu to test it out.
The code is rather simple:
private void Loadingtest(object sender, RoutedEventArgs e)
{
var dataContext = (SplashScreenDataContext)RadSplashScreenManager.SplashScreenDataContext;
dataContext.ImagePath = "";
dataContext.Content = "Loading";
dataContext.Footer = "Please wait, this might take several minutes";
dataContext.MouseCursor = Cursors.Wait;
dataContext.IsProgressBarVisible = true;
dataContext.IsIndeterminate = true;
if (!RadSplashScreenManager.IsSplashScreenActive) {
RadSplashScreenManager.Show();
Thread.Sleep(7000);
RadSplashScreenManager.Close();
}
Problem is whenever I click that menuitem it performs the 7 second wait and then flashes the loading screen for a moment before closing it again.
Tried it as well in WindowLoaded event as well as a Rendered event, both do the same things.
Tried to do Dispatcher.Invoke, Dispatcher.BeginInvoke as well as a new Tread with a run. All goes the same way. Both in Debug and Release modes. Also, trying to do something like changing the title in between throws an exception about the running thread not being able to access it, as if the whole execution were moved to a new thread after the SplashScreenManager.Show();
Example of the one that causes an error:
private void Loadingtest(object sender, RoutedEventArgs e)
{
var dataContext = (SplashScreenDataContext)RadSplashScreenManager.SplashScreenDataContext;
dataContext.ImagePath = "";
dataContext.Content = "Loading";
dataContext.Footer = "Please wait, this might take several minutes";
dataContext.MouseCursor = Cursors.Wait;
dataContext.IsProgressBarVisible = true;
dataContext.IsIndeterminate = true;
if (!RadSplashScreenManager.IsSplashScreenActive) {
RadSplashScreenManager.Show();
this.Title = "Title Test";
Thread.Sleep(7000);
RadSplashScreenManager.Close();
}
Thanks a bunch!