I am trying to change my mouse cursor to 'waiting' in my View (MainPage.xaml) while an operation in the viewmodel is running. This is a Universal Windows Project
I have found this: Change cursor in Windows Store Apps
Based on this solution I have created a property 'cursor' of Windows.UI.Core.Cursortype in my ViewModel:
cursor = CoreCursorType.Wait;
In the View this is being processed:
Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(mv.cursor, 0);
When the code is being used in the constructor of page, the updated cursor is visible. However when I handle the 'PropertyChanged' event, it is not.
The code has no errors, has been processed, and the Windows.UI.Core.CoreCursor is updated. However, this change is not visible on screen.
I have also tried these other options:
Changing the cursor in WPF sometimes works, sometimes doesn't display Hourglass when application is busy
These options do not work because:
- I am using a page, it does not have a Cursor property
- There is no Mouse object
How can I update the cursor? A binding to the viewmodel would be my preferred solution.
Update: Upon further investigation. The cursor is changed when I am viewing my application on my developing machine. (x64) It is not changed when I am viewing my application on my Raspberry Pi (ARM).
Update: I have found a solution for binding the cursor by a dependency property: Setting a custom property within a WPF/Silverlight page