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

Supported MouseAction.None in xaml #8842 #8871

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

MauNguyenVan
Copy link
Contributor

@MauNguyenVan MauNguyenVan commented Mar 5, 2024

Fixes Xaml Unsupported MouseAction.None value #8842

Microsoft Reviewers: Open in CodeFlow

@MauNguyenVan MauNguyenVan requested a review from a team as a code owner March 5, 2024 18:14
@dotnet-policy-service dotnet-policy-service bot added PR metadata: Label to tag PRs, to facilitate with triage Community Contribution A label for all community Contributions labels Mar 5, 2024
@MauNguyenVan
Copy link
Contributor Author

Hello team.
I have created a PR. It is finished, please review my code changed

@dipeshmsft
Copy link
Member

@MauNguyenVan, the team is currently occupied with Win11 theming changes. Once we have bandwidth, we will get to your PR.

@Kuldeep-MS
Copy link
Contributor

ccing @miloush

@miloush
Copy link
Contributor

miloush commented Apr 29, 2024

Yeah I don't have anything against the code change, the use case seems a bit weak because the gesture will never match anything and the desired outcome can already be achieved by omitting the attribute.

A slight design concern is that the conversion does not roundtrip. None will produce empty string (for compatibility reasons), but converting empty string back throws. Perhaps an empty string should be added as another case yielding None.

If we don't know the reason why the None value was given such a special treatment, then we don't have a good reason not to accept this change.

@MauNguyenVan
Copy link
Contributor Author

You see. String.Empty has already proceeded before.
So, IMO it's always compatibility

string mouseActionToken = ((string)source).Trim();
mouseActionToken = mouseActionToken.ToUpper(CultureInfo.InvariantCulture);
if (mouseActionToken == String.Empty)
return MouseAction.None;
MouseAction mouseAction = MouseAction.None;
switch (mouseActionToken)
{
case "NONE" : mouseAction = MouseAction.None; break;
case "LEFTCLICK" : mouseAction = MouseAction.LeftClick; break;

Copy link
Contributor

@anjali-wpf anjali-wpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@anjali-wpf
Copy link
Contributor

@MauNguyenVan - Thanks for your contribution.

@anjali-wpf anjali-wpf merged commit fd32311 into dotnet:main Jun 24, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage Queue for test pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants