@@ -664,7 +664,6 @@ void NavigationView::OnApplyTemplate()
664
664
UpdatePaneTabFocusNavigation ();
665
665
UpdateBackAndCloseButtonsVisibility ();
666
666
UpdateSingleSelectionFollowsFocusTemplateSetting ();
667
- UpdateNavigationViewUseSystemVisual ();
668
667
UpdatePaneVisibility ();
669
668
UpdateVisualState ();
670
669
UpdatePaneTitleMargins ();
@@ -1185,11 +1184,6 @@ void NavigationView::OnRepeaterElementPrepared(const winrt::ItemsRepeater& ir, c
1185
1184
}();
1186
1185
winrt::get_self<NavigationViewItem>(nvi)->PropagateDepthToChildren (childDepth);
1187
1186
1188
- if (ir != m_topNavRepeaterOverflowView.get ())
1189
- {
1190
- nvibImpl->UseSystemFocusVisuals (ShouldShowFocusVisual ());
1191
- }
1192
-
1193
1187
// Register for item events
1194
1188
auto nviRevokers = winrt::make_self<NavigationViewItemRevokers>();
1195
1189
nviRevokers->tappedRevoker = nvi.Tapped (winrt::auto_revoke, { this , &NavigationView::OnNavigationViewItemTapped });
@@ -3165,45 +3159,6 @@ void NavigationView::UpdateLeftNavigationOnlyVisualState(bool useTransitions)
3165
3159
winrt::VisualStateManager::GoToState (*this , isToggleButtonVisible ? L" TogglePaneButtonVisible" : L" TogglePaneButtonCollapsed" , false /* useTransitions*/ );
3166
3160
}
3167
3161
3168
- void NavigationView::UpdateNavigationViewUseSystemVisual ()
3169
- {
3170
- if (SharedHelpers::IsRS1OrHigher () && !ShouldPreserveNavigationViewRS4Behavior () && m_appliedTemplate)
3171
- {
3172
- PropagateShowFocusVisualToAllNavigationViewItemsInRepeater (m_leftNavRepeater.get (), ShouldShowFocusVisual ());
3173
- PropagateShowFocusVisualToAllNavigationViewItemsInRepeater (m_leftNavFooterMenuRepeater.get (), ShouldShowFocusVisual ());
3174
- PropagateShowFocusVisualToAllNavigationViewItemsInRepeater (m_topNavRepeater.get (), ShouldShowFocusVisual ());
3175
- PropagateShowFocusVisualToAllNavigationViewItemsInRepeater (m_topNavFooterMenuRepeater.get (), ShouldShowFocusVisual ());
3176
- }
3177
- }
3178
-
3179
- bool NavigationView::ShouldShowFocusVisual ()
3180
- {
3181
- return SelectionFollowsFocus () == winrt::NavigationViewSelectionFollowsFocus::Disabled;
3182
- }
3183
-
3184
- void NavigationView::PropagateShowFocusVisualToAllNavigationViewItemsInRepeater (winrt::ItemsRepeater const & ir, bool showFocusVisual)
3185
- {
3186
- if (ir)
3187
- {
3188
- if (auto itemsSourceView = ir.ItemsSourceView ())
3189
- {
3190
- const auto numberOfItems = itemsSourceView.Count ();
3191
- for (int i = 0 ; i < numberOfItems; i++)
3192
- {
3193
- if (auto nvib = ir.TryGetElement (i))
3194
- {
3195
- if (auto nvi = nvib.try_as <winrt::NavigationViewItem>())
3196
- {
3197
- auto nviImpl = winrt::get_self<NavigationViewItem>(nvi);
3198
- nviImpl->UseSystemFocusVisuals (showFocusVisual);
3199
- }
3200
- }
3201
-
3202
- }
3203
- }
3204
- }
3205
- }
3206
-
3207
3162
void NavigationView::InvalidateTopNavPrimaryLayout ()
3208
3163
{
3209
3164
if (m_appliedTemplate && IsTopNavigationView ())
@@ -3793,7 +3748,6 @@ void NavigationView::OnPropertyChanged(const winrt::DependencyPropertyChangedEve
3793
3748
else if (property == s_SelectionFollowsFocusProperty)
3794
3749
{
3795
3750
UpdateSingleSelectionFollowsFocusTemplateSetting ();
3796
- UpdateNavigationViewUseSystemVisual ();
3797
3751
}
3798
3752
else if (property == s_IsPaneToggleButtonVisibleProperty)
3799
3753
{
0 commit comments