lepoco / wpfui

WPF UI provides the Fluent experience in your known and loved WPF framework. Intuitive design, themes, navigation and new immersive controls. All natively and effortlessly.
https://wpfui.lepo.co
MIT License
7.47k stars 725 forks source link

Fixed menu item add when item added to the ObservableCollection #1092

Closed crippledfaith closed 3 months ago

crippledfaith commented 4 months ago

Pull request type

Please check the type of change your PR introduces:

What is the current behavior?

When MenuItemsSource or FooterMenuItemsSource in MVVM binding to ObservableCollection the Item added to the collection dose not update in the UI.

Issue Number: N/A

What is the new behavior?

        [ObservableProperty]
        private ObservableCollection<object> _broserNavigationViewItem = new ObservableCollection<object>();

         BroserNavigationViewItem.Add(new NavigationViewItem()
         {
             Content = content,
             Icon = new SymbolIcon { Symbol = icon },
             TargetPageType = targetPageType,
             TargetPageTag = name,
             Template = NavigationService.GetNavigationControl().ItemTemplate
         });

NavigationView item will add the Item

Other information