Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF exception WindowStyle.None

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?

like image 653
sergiol Avatar asked Jun 22 '26 18:06

sergiol


1 Answers

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

like image 154
H.B. Avatar answered Jun 24 '26 16:06

H.B.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!