Skip to content

fix #1140 "System.ArgumentNullException: 'Value cannot be null. Parameter name: defaultDestinationValue'" #1398

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dosymep
Copy link

@dosymep dosymep commented Mar 29, 2025

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

Issue Number: #1140

Information

I tried to create an example when a crash occurs with the exception System.ArgumentNullException: 'Value cannot be null. Parameter name: defaultDestinationValue', and also to make a fix for this problem.

The example is named Wpf.Ui.Demo.SetResources.Simple, it implements one problem that I encountered, this is when you create a grouping style for a grid with an expander. The problem is that when you open a page with an expander, everything seems to be fine, but after switching to another page, the application crashes.

This problem apparently occurs due to the initialization order. When you use app.resources, this problem does not occur. In the example, I reproduced the situation when the theme resources are not applied at application startup, but are applied when a specific window or page is created.

The example needs to be improved, add another problematic control CardExpander apparently it also has this problem, but I was not able to reproduce it in my tests (there is a fix for this control in this PR).

@dosymep dosymep requested a review from pomianowski as a code owner March 29, 2025 11:50
@github-actions github-actions bot added controls Changes to the appearance or logic of custom controls. styles Topic is related to styles PR Pull request dotnet release labels Mar 29, 2025
@github-actions github-actions bot added the ⭐ top pull request Top pull request. label Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
controls Changes to the appearance or logic of custom controls. dotnet PR Pull request release ⭐ top pull request Top pull request. styles Topic is related to styles
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant