Skip to content

Commit

Permalink
Add a check for buttons with flyouts and add a test. (microsoft/micro…
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinnara committed Aug 16, 2020
1 parent 779c0bd commit 811e529
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ModernWpf.Controls/CommandBarFlyout/CommandBarFlyout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private void SetSecondaryCommandsToCloseWhenExecuted()
var button = element as AppBarButton;
var toggleButton = element as AppBarToggleButton;

if (button != null)
if (button != null && button.Flyout == null)
{
m_secondaryButtonClickRevokerByElementMap[element] = new RoutedEventHandlerRevoker(
button, ButtonBase.ClickEvent, closeFlyoutFunc);
Expand Down
2 changes: 1 addition & 1 deletion test/ModernWpfTestApp/CommandBarFlyoutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<ui:AppBarButton x:Name="ItalicButton5" AutomationProperties.AutomationId="ItalicButton5" Label="Italic" Icon="Italic" Click="OnElementClicked" />
<ui:AppBarButton x:Name="UnderlineButton5" AutomationProperties.AutomationId="UnderlineButton5" Label="Underline" Icon="Underline" Click="OnElementClicked" />
<muxc:CommandBarFlyout.SecondaryCommands>
<ui:AppBarButton Label="Proofing">
<ui:AppBarButton x:Name="ProofingButton" AutomationProperties.AutomationId="ProofingButton" Label="Proofing" Click="OnElementClicked">
<ui:AppBarButton.Flyout>
<ui:MenuFlyout>
<MenuItem Header="talk" />
Expand Down

0 comments on commit 811e529

Please sign in to comment.