-
Notifications
You must be signed in to change notification settings - Fork 717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SamplesApp] NullReferenceException
setting cursors
#15818
Comments
This is a problem on WinUI, which deprecated Window.Current. It will work fine on the uwp tree. To set the cursor on WinUi (and uno), use |
NullReferenceException
setting cursors
The suggestion from @ramezgerges is correct solution. |
The issue was more a reminder to somehow [1] fix SampleApp than how to implement the new code for cursors (which already exists) 😄 [1] maybe just tell which the other test that covers the new code ? not sure how it's being handled for similar cases... |
@spouliot there is a ProtectedCursor sample if I remember correctly. |
Ah sorry, didn't realize |
@ramezgerges yes, I know there is :) @MartinZikmund no, it's implemented/working on macOS :) However anyone trying SampleApp might not know which test to use for cursors (I did not the first time). Having the old test fail makes it look like cursor support is broken or incomplete. Maybe that old test should be |
Current behavior
Debug Output shows
At line 55 of
SetCursor.xaml.cs
the value ofMicrosoft.UI.Xaml.Window.Current.CoreWindow
isnull
which throws the `Expected behavior
No exception.
How to reproduce it (as minimally and precisely as possible)
SetCursor
pageThe cursor does not change (to the selected cursor name) and an exception is logged (see Debug Output).
Workaround
None.
Works on UWP/WinUI
None
Environment
No response
NuGet package version(s)
No response
Affected platforms
Skia (GTK on Linux/macOS/Windows)
IDE
No response
IDE version
No response
Relevant plugins
No response
Anything else we need to know?
No response
The text was updated successfully, but these errors were encountered: