-
-
Notifications
You must be signed in to change notification settings - Fork 796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArgumentNullException when removing items from ObservableCollection bound to ItemsControl with CardExpander items #1140
Comments
Thank you for providing the complete sample code; I think this will be helpful in fixing this bug. |
I observed that you were utilizing the |
Is it unsupported in WPF to put style resources into The situation is: all our WPF windows/user controls are in libraries. The libraries are used from win32 (non .NET) code => there is no Is there any better solution I am not aware of? Thanks much for your help. |
Sorry, I'm not quite knowledgeable about this aspect either. |
Thanks for your response. I was trying the same with some other styles placed directly in Window's resources - as is perfectly common in WPF - and everything worked. How can this unexpected behaviour of WPF-UI resources be fixed? |
Hello. Any news about this issue? Thanks much. |
The problem occurs due to animating the |
Thanks for the response. Is the solution part of some planned future version? |
@bujma I can make a PR if @pomianowski agrees to that approach with MinHeight |
I cannot say if it is the correct solution, but it will be fine to have it fixed in the near future, thanks much. |
Describe the bug
System.ArgumentNullException: 'Value cannot be null. Parameter name: defaultDestinationValue' when removing items of
ObserableCollection<Model>
bound from ViewModel class toItemsControl
inWindow
withItemTemplate
templated withCardExpander
after expanding anyCardExpander
.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:
Items
with someModel
items (button [Reload Items] callingItems = new ObservableCollection<Model>(list)
).CardExpander
.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:
ErrorProof.zip
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
The text was updated successfully, but these errors were encountered: