spiegelp / MaterialDesignExtensions

Material Design Extensions is based on Material Design in XAML Toolkit to provide additional controls and features for WPF apps
https://spiegelp.github.io/MaterialDesignExtensions/
MIT License
762 stars 122 forks source link

No refresh when the same viewModel is used in a List<INavigationItem> #173

Open jebissey opened 2 years ago

jebissey commented 2 years ago

Hi, To reproduce the issue, just modify and add these lines in MaterialDesignExtensionsDemo/MainWindow.xaml.cs:

new FirstLevelNavigationItem() { Label = "Oversized number spinner (2)", NavigationItemSelectedCallback = item => new OversizedNumberSpinnerViewModel(2) }, new FirstLevelNavigationItem() { Label = "Oversized number spinner (3)", NavigationItemSelectedCallback = item => new OversizedNumberSpinnerViewModel(3) },

And modify MaterialDesignExtensionsDemo/ViewModel/OversizedNumberSpinnerViewModel.cs:

public OversizedNumberSpinnerViewModel(int value) : base() { m_value = value; m_min = 0; m_max = 4; }

So we could think we only have to do this

Value = value;

But it is the same result, display doesn't reflect the change despite of the constructor call.