3

I have the MainAppWindow XAML like this:

<local:MyWindow
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
... 
xmlns:local="clr-namespace:MyNamespace" 
xmlns:System="clr-namespace:System;assembly=mscorlib"
x:Class="MyNamespace.MainAppWindow"
x:Name="MyWindow"
....
AllowsTransparency="True">

end I get this weird exception:enter image description here

Notice some important things:

  • In the Watch window the WindowStyle is ThreedBorderWindow
  • MainAppWindow.AllowTransparency has been XAML-defined as True.

Is this a WPF bug? What is the cause? Is there a solution? Does somebody know a workaround?

H.B.
  • 166,899
  • 29
  • 327
  • 400
sergiol
  • 4,122
  • 4
  • 47
  • 81
  • If you can't decipher the screen shot the text of the exception thrown is _WindowStyle.None is the only valid value for WindowStyle when AllowsTransparency is true._ – Martin Liversage Aug 29 '12 at 10:46

1 Answers1

2

Doesn't it exactly tell you the requirements? Change the WindowStyle to None, that is just the way it is.

H.B.
  • 166,899
  • 29
  • 327
  • 400