-
-
Notifications
You must be signed in to change notification settings - Fork 885
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
System.ArgumentNullException: 'Value cannot be null. Parameter name: defaultDestinationValue' when removing items of ObserableCollection<Model>
bound from ViewModel class to ItemsControl
in Window
with ItemTemplate
templated with CardExpander
after expanding any CardExpander
.
To Reproduce
Situation:
MainWindow
(pureWindow
descendant, noFluentWindow
) withResources
<ui:ThemesDictionary Theme="Light" />
and<ui:ControlsDictionary />
.MainWindow
with simpleViewModel
class asDataContext
.ViewModel
class withObservableCollection<Model> Items
property bound toItemsControl
havingItemTemplate
asCardExpander
.
Steps:
- In runtime, fill the
Items
with someModel
items (button [Reload Items] callingItems = new ObservableCollection<Model>(list)
). - Expand any
CardExpander
. - Remove any item/all items/assign new instance of
ObservableCollection
toItems
property (buttons [Delete], [Remove All Items] or [Reload Items] callingItems.Remove(item)
,Items.Clear()
or code from step 1).
=> exception will be thrown
Description:
- If you use default WPF style (no WPF-UI resources in MainWindow.xaml), everything will work.
- If you use WPF-UI resources in MainWindow.xaml, exception is thrown.
- If you do not expand a card (skip step 2), all will work with or without WPF-UI resources.
Expected behavior
No exception thrown. Removing items from ObservableCollection
or assigning new instance should have no such impact.
Screenshots
No response
OS version
Windows 10 Pro 22H2 19045.4529
.NET version
4.7.2
WPF-UI NuGet version
3.0.4
Additional context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working