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

Syntax error in DropDownButton.cs #1755

Open
Byff70 opened this issue Jul 19, 2023 · 1 comment
Open

Syntax error in DropDownButton.cs #1755

Byff70 opened this issue Jul 19, 2023 · 1 comment

Comments

@Byff70
Copy link

Byff70 commented Jul 19, 2023

This line in the GetContextMenu event handler:

if( child is FrameworkElement children && children.ContextMenu != null && children.ContextMenu.IsOpen )

will not compile. I'm not sure what "children" is supposed to represent, as there is no matching declaration in the module, nor is it an argument passed to the event handler. When I remove the first "children" from the line, the syntax error goes away, but I'm still left with a "name does not exist in this context" issue for "children." I'm not sure enough of the intent of this code to fix the problem without asking for advice.

@Byff70
Copy link
Author

Byff70 commented Jul 19, 2023

Just to get the code to compile, I've kludged this:

if( child is FrameworkElement children && children.ContextMenu != null && children.ContextMenu.IsOpen ) { return children.ContextMenu; }

to this:

if (child is FrameworkElement) { return ((FrameworkElement)child).ContextMenu; }

Will soon find out how badly this munges the original intent...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant