ContextMenuOpening event is not sent when button is disabled
Hi,
In WPF, we get ContextMenuOpening event on both the button and the grid.
However, in NoesisGUI, the event is not fired (it is fired if the button IsEnabled="True").
What we are trying to do is to find a trigger for displaying ContextMenu on the disabled button. Do you know any good workaround ?
Thanks.
In WPF, we get ContextMenuOpening event on both the button and the grid.
However, in NoesisGUI, the event is not fired (it is fired if the button IsEnabled="True").
Code: Select all
<Grid ContextMenuOpening="Grid_ContextMenuOpening">
<Button Name="testDisabledButton" IsEnabled="False" Content="Disabled Button" ContextMenuOpening="testDisabledButton_ContextMenuOpening">
<Button.ContextMenu>
<ContextMenu>
<MenuItem Header="Test 1"/>
<MenuItem Header="Test 2"/>
</ContextMenu>
</Button.ContextMenu>
</Button>
</Grid>
Thanks.
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: ContextMenuOpening event is not sent when button is disabled
Hi, it is a bug in our code that ignores disabled elements when raising ContextMenuOpening.
Could you please report it in our bugtracker and we will fix it as soon as possible?
Unfortunately I can't think of a valid way to workaround it.
Could you please report it in our bugtracker and we will fix it as soon as possible?
Unfortunately I can't think of a valid way to workaround it.
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: ContextMenuOpening event is not sent when button is disabled
Just want to make notice that as soon as we fix this bug you will be able to use ContextMenuService.ShowOnDisabled attached property if you want to show the context menu on your disabled button, you won't need to register a handler on the ContextMenuOpening event (unless you want to do other things).
Code: Select all
<Button Name="testDisabledButton" IsEnabled="False" Content="Disabled Button" ContextMenuService.ShowOnDisabled="True">
<Button.ContextMenu>
<ContextMenu>
<MenuItem Header="Test 1"/>
<MenuItem Header="Test 2"/>
</ContextMenu>
</Button.ContextMenu>
</Button>
Re: ContextMenuOpening event is not sent when button is disabled
Ok, thanks.
I filed the issue here: https://www.noesisengine.com/bugs/view.php?id=1382
I filed the issue here: https://www.noesisengine.com/bugs/view.php?id=1382
Ok, that sounds great !Just want to make notice that as soon as we fix this bug you will be able to use ContextMenuService.ShowOnDisabled attached property if you want to show the context menu on your disabled button, you won't need to register a handler on the ContextMenuOpening event (unless you want to do other things).
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: ContextMenuOpening event is not sent when button is disabled
Thanks for the report.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 12 guests