Skip to content
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

Proposal: Support for setting the cursor for a XAML UI Element #2734

Closed
JaiganeshKumaran opened this issue Jun 23, 2020 · 2 comments
Closed
Labels
duplicate This issue or pull request already exists feature proposal New feature proposal

Comments

@JaiganeshKumaran
Copy link
Contributor

JaiganeshKumaran commented Jun 23, 2020

Proposal: Support for declaring the cursor for a XAML UI Element

Summary

In WPF, you can easily change the cursor of an element. However, in WinUI you have to subscribe to the OnPointerEntered and OnPointerExited events and change the shown cursor accordingly using WinRT APIs in a UWP CoreWindow or Win32 APIs in a Desktop HWND or use the XAML extensions from Windows Community Toolkit. WinUI should offer a built-in way to change the cursor.

Rationale

Many developers who are familiar with WPF expect a straightforward way to change the cursor of any element. Although devs can use Windows Community Toolkit, I believe that WinUI should offer it built-in. This will also allow C++ devs to change the cursor within XAML markup. It will also be better if we could define custom cursor in XAML without code-behind (Refer this link).

Scope

Capability Priority
This proposal will allow developers to set the mouse cursor for a UI Element using XAML markup Must
This proposal will allow developers to set the mouse cursor for a UI Element from code-behind without pointer events Must
This proposal will allow developers to define and use custom cursors in markup without code-behind Could

Important Notes

UIElement should have a Cursor property of CoreCursor. It should also work with WinUI Desktop Apps.

@JaiganeshKumaran JaiganeshKumaran added the feature proposal New feature proposal label Jun 23, 2020
@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Jun 23, 2020
@Felix-Dev
Copy link
Contributor

Felix-Dev commented Jun 23, 2020

This should be integrated into proposal #506 which mentions custom cursors and in point 4) the addition of a Cursor API.

@ranjeshj ranjeshj added duplicate This issue or pull request already exists and removed needs-triage Issue needs to be triaged by the area owners labels Jun 24, 2020
@ranjeshj
Copy link
Contributor

Lets track it through #506. @JaiganeshKumaran please feel free to add information to that proposal if needed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists feature proposal New feature proposal
Projects
None yet
Development

No branches or pull requests

4 participants