Skip to content

Commit

Permalink
Fix NavigationViewItem attempting to go to a non existant reveal stat…
Browse files Browse the repository at this point in the history
…e. (#6317)

Tested by changing the MuxControlsTestApp FocusVisualKind to reveal, noting the broken visualization. Implementing the fix and noting the fix.
  • Loading branch information
StephenLPeters authored Nov 16, 2021
1 parent f904131 commit 2562ac6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions dev/NavigationView/NavigationViewItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ void NavigationViewItem::UpdateVisualStateForNavigationViewPositionChange()
case NavigationViewRepeaterPosition::LeftFooter:
if (SharedHelpers::IsRS4OrHigher() && winrt::Application::Current().FocusVisualKind() == winrt::FocusVisualKind::Reveal)
{
// OnLeftNavigationReveal is introduced in RS6.
// Will fallback to stateName for the customer who re-template rs5 NavigationViewItem
// OnLeftNavigationReveal is introduced in RS6 and only in the V1 style.
// Fallback to OnLeftNavigation for other styles.
if (winrt::VisualStateManager::GoToState(*this, c_OnLeftNavigationReveal, false /*useTransitions*/))
{
handled = true;
Expand All @@ -369,13 +369,15 @@ void NavigationViewItem::UpdateVisualStateForNavigationViewPositionChange()
break;
case NavigationViewRepeaterPosition::TopPrimary:
case NavigationViewRepeaterPosition::TopFooter:
stateName = c_OnTopNavigationPrimary;
if (SharedHelpers::IsRS4OrHigher() && winrt::Application::Current().FocusVisualKind() == winrt::FocusVisualKind::Reveal)
{
stateName = c_OnTopNavigationPrimaryReveal;
}
else
{
stateName = c_OnTopNavigationPrimary;
// OnTopNavigationPrimaryReveal is introduced in RS6 and only in the V1 style.
// Fallback to c_OnTopNavigationPrimary for other styles.
if (winrt::VisualStateManager::GoToState(*this, c_OnTopNavigationPrimaryReveal, false /*useTransitions*/))
{
handled = true;
}
}
break;
case NavigationViewRepeaterPosition::TopOverflow:
Expand Down

0 comments on commit 2562ac6

Please sign in to comment.