DialogHost is deprecated but setting DialogHostEx throws because DialogHost is not set
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
There seems to be an issue where DialogHost of a content dialog is deprecated, but the new solution of DialogHostEx does not work when I replace it.
To Reproduce
dialog.DialogHost = Presenter;
See deprecation warning
However
ContentDialogService dialogService = new();
dialog.DialogHostEx = dialogService.GetDialogHostEx();
returns a runtime error.
Expected behavior
Either the deprecation warning to go away, or the new way of setting DialogHostEx to work without crash.
Screenshots
No response
OS version
Windows 11 26100.1.arm64
.NET version
net10
WPF-UI NuGet version
4.2.0
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using the shown DialogHost and DialogHostEx snippets with WPF-UI 4.2.0 on net10, recording the runtime exception. Then inspect the DialogHost and DialogHostEx implementation and related usage to determine why replacing the deprecated property fails. Done means DialogHostEx can be assigned without a crash, or the deprecation guidance is corrected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100