Navigation Menu

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

IsEnabled does not work properly on HamburgerMenuItem #3293

Closed
igorquintaes opened this issue Jul 27, 2018 · 5 comments
Closed

IsEnabled does not work properly on HamburgerMenuItem #3293

igorquintaes opened this issue Jul 27, 2018 · 5 comments
Labels
Milestone

Comments

@igorquintaes
Copy link

Bug Description
Is not possible to enable or disable a HamburgerMenuItem inside a .xaml file.
If a HamburgerMenuItem contains an IsEnabled attribute, does not matter if it is True or False, binded value or not - it always shows as disabled.

To Reproduce
Based on punker76/code-samples:

  1. Open HamburgerMenuApp.V2
  2. Find a HamburgerMenuGlyphItem in MainWindow.xaml
  3. Add IsEnabled="True"

Expected behavior
Menu item should still be enabled.

Environment(please complete the following information):
Based on punker76/code-samples:

  • OS: Win10 1803
  • VS 2017 15.7.3

Based on my own code:

  • MahApps.Metro updated
  • OS: Win10 1803
  • VS 2017 15.7.3
  • .NET Framework 4.5

Repo
Since it can be simulated on punker76/code-samples, i think it is not needed.

Additional context
Based on Issue #2865, and Pull Request #2921 it is expected to work.

@ivanjx
Copy link

ivanjx commented Jul 31, 2018

same here. i changed IsEnabled via C# code but if i disabled a menuitem then i cant enable it again using IsEnabled = true :(

@Anapher
Copy link
Contributor

Anapher commented Aug 17, 2018

I don't think that this is solved as I just cloned the current develop branch and the problem is still there. I'm pretty sure that the problem is caused by this line. In this void, CanExecute is set to true if the Command is null. The problem is, that on creation the Command is null but CanExecute is false which is a wrong state. I will submit a PR that changes this line to private bool canExecute = true;

@Hanebu
Copy link

Hanebu commented Jul 6, 2019

Im currently stuck on that IsEnabled thing. Is there any code example of how to enable and disable a menuitem in a hamburger menu?

@punker76
Copy link
Member

punker76 commented Jul 6, 2019

@Hanebu If you use the v2.0 alpha then this property should work as expected.

@Hanebu
Copy link

Hanebu commented Jul 6, 2019

Awesome, I will test this right now :-) Thanks!

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

No branches or pull requests

5 participants