The UI runs in the main thread, so you can't access the UI from a different thread. So you have a flag that the Spinner
is bound to using data binding, say is called
. Then you communicate to the UI via the flag. Secondly, as OriginalGriff mentioned, you then offload the long-running task to a different thread. You will need to read up on Data Binding (WPF | Microsoft Docs)
] if you are unfamiliar.