Browse Source

Fix display of unsupported transparency levels.

Only make the window brush transparent when we requested a transparent window and were given one, otherwise we display a transparent brush for e.g. `None` because `None` is not available when using composition.
pull/11509/head
Steven Kirk 3 years ago
parent
commit
4954228f14
  1. 3
      samples/ControlCatalog/MainView.xaml.cs

3
samples/ControlCatalog/MainView.xaml.cs

@ -85,7 +85,8 @@ namespace ControlCatalog
var topLevel = (TopLevel)this.GetVisualRoot()!;
topLevel.TransparencyLevelHint = new[] { selected };
if (selected != WindowTransparencyLevel.None)
if (topLevel.ActualTransparencyLevel != WindowTransparencyLevel.None &&
topLevel.ActualTransparencyLevel == selected)
{
var transparentBrush = new ImmutableSolidColorBrush(Colors.White, 0);
var semiTransparentBrush = new ImmutableSolidColorBrush(Colors.Gray, 0.2);

Loading…
Cancel
Save