tags:

views:

295

answers:

0

I want to show the wait cursor before my WPF application, composed using CAL, fully loads.

In the constructor of the main window, I have the following code:

 public MainWindow([Dependency] IUnityContainer container)
        {                                                            

            InitializeComponent();

            Cursor = System.Windows.Input.Cursors.Wait;
            Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;
            ForceCursor = true;

            //this.Cursor = System.Windows.Input.Cursors.AppStarting;

            // event subscriptions            

            PresenterBase.EventAggregate.GetEvent<ModulesLoadedEvent>().Subscribe(OnModulesLoaded);                                                               
        }

After all modules have been loaded, the following handler is invoked:

 private void OnModulesLoaded(EventArgs e)
        {
            allModulesLoaded = true;
            Mouse.OverrideCursor = null;
            Cursor = System.Windows.Input.Cursors.Arrow;

        }    

Problem is, I do not see this wait cursor. What I am missing here? FWIW, I got a hint from this post

http://stackoverflow.com/questions/2078766/showing-the-wait-cursor

TIA.