diff --git a/src/Uno.UI.FluentTheme.v2/Resources/Version2/PriorityDefault/NavigationView.xaml b/src/Uno.UI.FluentTheme.v2/Resources/Version2/PriorityDefault/NavigationView.xaml
index 67bdd6f02b8e..626a5251f757 100644
--- a/src/Uno.UI.FluentTheme.v2/Resources/Version2/PriorityDefault/NavigationView.xaml
+++ b/src/Uno.UI.FluentTheme.v2/Resources/Version2/PriorityDefault/NavigationView.xaml
@@ -1,4 +1,5 @@
+
diff --git a/src/Uno.UI.FluentTheme.v2/Resources/Version2/PriorityDefault/NavigationView_rs1_themeresources.xaml b/src/Uno.UI.FluentTheme.v2/Resources/Version2/PriorityDefault/NavigationView_rs1_themeresources.xaml
index dbcd25b36b31..4bd4d2dcc84d 100644
--- a/src/Uno.UI.FluentTheme.v2/Resources/Version2/PriorityDefault/NavigationView_rs1_themeresources.xaml
+++ b/src/Uno.UI.FluentTheme.v2/Resources/Version2/PriorityDefault/NavigationView_rs1_themeresources.xaml
@@ -1,5 +1,5 @@
-
+
+
+
@@ -701,11 +703,13 @@
+
+
@@ -784,6 +788,7 @@
AutomationProperties.AccessibilityView="Raw"/>
+
+
@@ -1108,11 +1115,13 @@
+
+
@@ -1169,6 +1178,7 @@
Height="12"
RenderTransformOrigin="0.5, 0.5"
x:Name="ExpandCollapseChevronIcon"
+ Foreground="{ThemeResource NavigationViewItemForeground}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
AutomationProperties.AccessibilityView="Raw"
@@ -1419,6 +1429,7 @@
VerticalAlignment="Center"
AutomationProperties.AccessibilityView="Raw"/>
-
+
\ No newline at end of file
diff --git a/src/Uno.UI/Microsoft/UI/Xaml/Controls/NavigationView/NavigationViewItem.Header.cs b/src/Uno.UI/Microsoft/UI/Xaml/Controls/NavigationView/NavigationViewItem.Header.cs
index 833512fd0433..5b992edc27ad 100644
--- a/src/Uno.UI/Microsoft/UI/Xaml/Controls/NavigationView/NavigationViewItem.Header.cs
+++ b/src/Uno.UI/Microsoft/UI/Xaml/Controls/NavigationView/NavigationViewItem.Header.cs
@@ -1,60 +1,60 @@
-// MUX reference NavigationViewItem.h, commit fd22d7f
+// MUX reference NavigationViewItem.h, commit d3fef08fd
using Microsoft.UI.Xaml.Controls.Primitives;
using Uno.Disposables;
-using Windows.ApplicationModel.Core;
-using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
-namespace Microsoft.UI.Xaml.Controls
+namespace Microsoft.UI.Xaml.Controls;
+
+public partial class NavigationViewItem
{
- public partial class NavigationViewItem
- {
- internal SerialDisposable EventRevoker { get; } = new SerialDisposable();
-
- internal ItemsRepeater GetRepeater() => m_repeater;
-
- private readonly SerialDisposable m_splitViewIsPaneOpenChangedRevoker = new SerialDisposable();
- private readonly SerialDisposable m_splitViewDisplayModeChangedRevoker = new SerialDisposable();
- private readonly SerialDisposable m_splitViewCompactPaneLengthChangedRevoker = new SerialDisposable();
-
- private readonly SerialDisposable m_presenterPointerPressedRevoker = new SerialDisposable();
- private readonly SerialDisposable m_presenterPointerEnteredRevoker = new SerialDisposable();
- private readonly SerialDisposable m_presenterPointerMovedRevoker = new SerialDisposable();
- private readonly SerialDisposable m_presenterPointerReleasedRevoker = new SerialDisposable();
- private readonly SerialDisposable m_presenterPointerExitedRevoker = new SerialDisposable();
- private readonly SerialDisposable m_presenterPointerCanceledRevoker = new SerialDisposable();
- private readonly SerialDisposable m_presenterPointerCaptureLostRevoker = new SerialDisposable();
-
- private readonly SerialDisposable m_repeaterElementPreparedRevoker = new SerialDisposable();
- private readonly SerialDisposable m_repeaterElementClearingRevoker = new SerialDisposable();
- private readonly SerialDisposable m_itemsSourceViewCollectionChangedRevoker = new SerialDisposable();
-
- private readonly SerialDisposable m_flyoutClosingRevoker = new SerialDisposable();
- private readonly SerialDisposable m_isEnabledChangedRevoker = new SerialDisposable();
-
- private ToolTip m_toolTip = null;
- private NavigationViewItemHelper backing_m_helper = null;
- private NavigationViewItemHelper m_helper => backing_m_helper ??= new NavigationViewItemHelper(this);
-
- private NavigationViewItemPresenter m_navigationViewItemPresenter = null;
- private object m_suggestedToolTipContent = null;
- private ItemsRepeater m_repeater = null;
- private Grid m_flyoutContentGrid = null;
- private Grid m_rootGrid = null;
-
- private bool m_isClosedCompact = false;
-
- private bool m_appliedTemplate = false;
- private bool m_hasKeyboardFocus = false;
-
- // Visual state tracking
- private Pointer m_capturedPointer = null;
- private uint m_trackedPointerId = 0;
- private bool m_isPressed = false;
- private bool m_isPointerOver = false;
-
- private bool m_isRepeaterParentedToFlyout = false;
- }
+ internal SerialDisposable EventRevoker { get; } = new();
+
+ internal ItemsRepeater GetRepeater() => m_repeater;
+
+ private readonly SerialDisposable m_splitViewIsPaneOpenChangedRevoker = new();
+ private readonly SerialDisposable m_splitViewDisplayModeChangedRevoker = new();
+ private readonly SerialDisposable m_splitViewCompactPaneLengthChangedRevoker = new();
+
+ private readonly SerialDisposable m_presenterPointerPressedRevoker = new();
+ private readonly SerialDisposable m_presenterPointerEnteredRevoker = new();
+ private readonly SerialDisposable m_presenterPointerMovedRevoker = new();
+ private readonly SerialDisposable m_presenterPointerReleasedRevoker = new();
+ private readonly SerialDisposable m_presenterPointerExitedRevoker = new();
+ private readonly SerialDisposable m_presenterPointerCanceledRevoker = new();
+ private readonly SerialDisposable m_presenterPointerCaptureLostRevoker = new();
+
+ private readonly SerialDisposable m_repeaterElementPreparedRevoker = new();
+ private readonly SerialDisposable m_repeaterElementClearingRevoker = new();
+ private readonly SerialDisposable m_itemsSourceViewCollectionChangedRevoker = new();
+ private readonly SerialDisposable m_menuItemsVectorChangedRevoker = new();
+
+ private readonly SerialDisposable m_flyoutClosingRevoker = new();
+ private readonly SerialDisposable m_isEnabledChangedRevoker = new();
+
+ private ToolTip m_toolTip;
+ private NavigationViewItemHelper backing_m_helper;
+ private NavigationViewItemHelper m_helper => backing_m_helper ??= new(this);
+
+ private NavigationViewItemPresenter m_navigationViewItemPresenter;
+ private object m_suggestedToolTipContent;
+ private ItemsRepeater m_repeater;
+ private Grid m_flyoutContentGrid;
+ private Grid m_rootGrid;
+
+ private bool m_isClosedCompact;
+
+ private bool m_appliedTemplate;
+ private bool m_hasKeyboardFocus;
+
+ // Visual state tracking
+ private Pointer m_capturedPointer;
+ private uint m_trackedPointerId;
+ private bool m_isPressed;
+ private bool m_isPointerOver;
+
+ private bool m_isRepeaterParentedToFlyout;
+ // used to bypass all Chevron visual state logic in order to keep it unloaded
+ private bool m_hasHadChildren;
}
diff --git a/src/Uno.UI/Microsoft/UI/Xaml/Controls/NavigationView/NavigationViewItem.cs b/src/Uno.UI/Microsoft/UI/Xaml/Controls/NavigationView/NavigationViewItem.cs
index 5084fe34d9c2..6376b5c8d11f 100644
--- a/src/Uno.UI/Microsoft/UI/Xaml/Controls/NavigationView/NavigationViewItem.cs
+++ b/src/Uno.UI/Microsoft/UI/Xaml/Controls/NavigationView/NavigationViewItem.cs
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
-// MUX reference NavigationViewItem.cpp, commit 2562ac6
+// MUX reference NavigationViewItem.cpp, commit d3fef08
#if __ANDROID__
// For performance considerations, we prefer to delay pressed and over state in order to avoid
@@ -9,14 +9,12 @@
#define UNO_USE_DEFERRED_VISUAL_STATES
#endif
-using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using Microsoft.UI.Xaml.Controls.Primitives;
using Uno.Disposables;
using Uno.UI.Helpers.WinUI;
-using Windows.Foundation;
-using Windows.System;
+using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Automation.Peers;
@@ -31,610 +29,655 @@
#if HAS_UNO_WINUI
using Microsoft.UI.Input;
#else
-using Windows.UI.Input;
-using Windows.Devices.Input;
#endif
-namespace Microsoft.UI.Xaml.Controls
+namespace Microsoft.UI.Xaml.Controls;
+
+public partial class NavigationViewItem : NavigationViewItemBase
{
- public partial class NavigationViewItem : NavigationViewItemBase
- {
- private const string c_navigationViewItemPresenterName = "NavigationViewItemPresenter";
- private const string c_repeater = "NavigationViewItemMenuItemsHost";
- private const string c_rootGrid = "NVIRootGrid";
- private const string c_flyoutContentGrid = "FlyoutContentGrid";
-
- // Visual States
- private const string c_pressedSelected = "PressedSelected";
- private const string c_pointerOverSelected = "PointerOverSelected";
- private const string c_selected = "Selected";
- private const string c_pressed = "Pressed";
- private const string c_pointerOver = "PointerOver";
- private const string c_disabled = "Disabled";
- private const string c_enabled = "Enabled";
- private const string c_normal = "Normal";
- private const string c_chevronHidden = "ChevronHidden";
- private const string c_chevronVisibleOpen = "ChevronVisibleOpen";
- private const string c_chevronVisibleClosed = "ChevronVisibleClosed";
-
- private const string c_normalChevronHidden = "NormalChevronHidden";
- private const string c_normalChevronVisibleOpen = "NormalChevronVisibleOpen";
- private const string c_normalChevronVisibleClosed = "NormalChevronVisibleClosed";
- private const string c_pointerOverChevronHidden = "PointerOverChevronHidden";
- private const string c_pointerOverChevronVisibleOpen = "PointerOverChevronVisibleOpen";
- private const string c_pointerOverChevronVisibleClosed = "PointerOverChevronVisibleClosed";
- private const string c_pressedChevronHidden = "PressedChevronHidden";
- private const string c_pressedChevronVisibleOpen = "PressedChevronVisibleOpen";
- private const string c_pressedChevronVisibleClosed = "PressedChevronVisibleClosed";
-
- public NavigationViewItem()
- {
- DefaultStyleKey = typeof(NavigationViewItem);
- SetValue(MenuItemsProperty, new List