Closed ASir-Yiyou closed 4 months ago
This bug is already fixed in the latest version, update your package version.
Doesn't seem to be fixed on my end - my code is essentially the same
Nevermind, I have to replace the ObservableCollection
with a new copy for it to swap
@ASir-Yiyou If this is solved for you, please close this issue.
Describe the bug
When modifying the MenuItemsSource of the NavigationView component, the NavigationView will not re-render
To Reproduce
Use the Demo project to test, the code is as follows: public partial class MainWindowViewModel : ObservableObject { [ObservableProperty] private string _applicationTitle = "WPF UI Gallery";
} The page cannot render the NavigationView options
Expected behavior
Page re-render NavigationView
Screenshots
No response
OS version
Windows
.NET version
.NET8.0-windows
WPF-UI NuGet version
3.0.0
Additional context
Modify OnMenuItemsPropertyChanged Event:The page can be re-rendered NavigationView private static void OnMenuItemsPropertyChanged(DependencyObject? d, DependencyPropertyChangedEventArgs e) { if (d is not NavigationView navigationView || e.NewValue is not IList enumerableNewValue) { return; }
}