-
Notifications
You must be signed in to change notification settings - Fork 693
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
Use CommandBarFlyout in page resource, throw Value does not fall within the expected range #10170
Comments
I'm surprised if (sender is Grid) even works. Use the CommandBarFlyout in the GridView's ContextFlyout property instead of in the Page resources. Try it out and see if it works. |
@XFEstudio I was able to reproduce the error you were seeing with your CommandBarFlyout code in your page resources. I'm not sure why, but the issue happens by setting the placement mode of your flyout to Auto specifically. Remove that, or change it to another placement value, and your flyout will show. On a side note, when I was testing with the GridView RightTapped event. My sender was a GridView and not a Grid, but if your code was still executing before, maybe it's not important. |
@Skittles2519 Thanks, it work! I wonder what caused this problem and whether it is a bug. |
Describe the bug
The commandBarFlyout.ShowAt() function throw an Exception: Value does not fall within the expected range.
The CommandBarFlyout Control is defined in page resources:
Here's the invoke event:
This event is binding to the GridView's RightTapped event.
I have tried to set the XamlRoot in CommandBarFlyout, but it doesn't work.
Steps to reproduce the bug
Defined the CommandBarFlyItem in page resources, and binding the GridView's RightTapped event.
The right click anywhere in gridView control, then the exception throw.
Expected behavior
No response
Screenshots
NuGet package version
WinUI 3 - Windows App SDK 1.6.2: 1.6.241106002
Windows version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: