ContentDialog not visible if background is set to transparent
Open
Nobody has claimed this yet.
bug
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When you have a FluentWindow object and set AllowTransparency to true and background to transparent and show a ContentDialog this ContentDialog won't be visible
To Reproduce
Code:
FluentWindow window = new();
window.Content = new ContentPresenter();
window.AllowsTransparency = true;
window.Background = Brushes.Transparent;
ContentDialog contentDialog = new((ContentPresenter)window.Content);
contentDialog.Title = "Save hashes to ... file(s)?";
contentDialog.PrimaryButtonText = "Multiple";
contentDialog.SecondaryButtonText = "Single";
window.Width = 0;
window.Height = 0;
window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
try
{
window.Show();
}
catch (InvalidOperationException)
{
// Ignore
}
window.Focus();
window.Activate();
contentDialog.ShowAsync().ContinueWith((task) =>
{
// ...
}
Expected behavior
The content dialog shows in front of a transparent window.
Screenshots
No response
OS version
26040.1000
.NET version
.NET 8
WPF-UI NuGet version
3.0.0-preview.13
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
Start by reproducing the issue with FluentWindow, AllowTransparency, a transparent Background, and ContentDialog.ShowAsync using the code in the report. Trace how the dialog is displayed when the window is transparent; done means the ContentDialog is visible in front of the transparent window without breaking the reported setup.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100