How do I display wait cursor during a WPF application's startup? How do I display wait cursor during a WPF application's startup? wpf wpf

How do I display wait cursor during a WPF application's startup?


This should work

Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;

Use System.Windows.Input not System.Windows.Forms.


If you have a task that takes a significant amount of time, and it is running on a non-GUI thread, (which is a good idea) you can use this code to change the application cursor:

Application.Current.Dispatcher.Invoke(() =>{    Mouse.OverrideCursor = Cursors.Wait;});

When the busy process completes, use this:

Application.Current.Dispatcher.Invoke(() =>{    Mouse.OverrideCursor = null;});


        Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait;        InitializeComponent();        ...        Mouse.OverrideCursor = null;