Skip to content

Commit

Permalink
CommandBarFlyoutCommandBar should honor the "Show animations in Windo…
Browse files Browse the repository at this point in the history
…ws" setting on open and close (#5096)

XAML's VisualStateManager handles the honoring of most animations, but in the case of CommandBarFlyout, we have open and close animations that we play manually external to the VisualStateManager. In that case, we should check for animations being enabled before reporting that they exist and having them be played.

This is a purely visual change that relies on a system setting being set that we don't have test infrastructure for, so I haven't added any automated testing here, but I manually verified that the open/close animation no longer plays when that setting is turned off, and then resumes playing when it's turned back on.
  • Loading branch information
llongley authored May 28, 2021
1 parent a6e4341 commit a51bc73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dev/CommandBarFlyout/CommandBarFlyoutCommandBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ void CommandBarFlyoutCommandBar::DetachEventHandlers()

bool CommandBarFlyoutCommandBar::HasOpenAnimation()
{
return static_cast<bool>(m_openingStoryboard);
return static_cast<bool>(m_openingStoryboard) && SharedHelpers::IsAnimationsEnabled();
}

void CommandBarFlyoutCommandBar::PlayOpenAnimation()
Expand All @@ -442,7 +442,7 @@ void CommandBarFlyoutCommandBar::PlayOpenAnimation()

bool CommandBarFlyoutCommandBar::HasCloseAnimation()
{
return static_cast<bool>(m_closingStoryboard);
return static_cast<bool>(m_closingStoryboard) && SharedHelpers::IsAnimationsEnabled();
}

void CommandBarFlyoutCommandBar::PlayCloseAnimation(
Expand Down

0 comments on commit a51bc73

Please sign in to comment.