Areo Glass Effect和windowStyle设置为none,AllowTransparency导致寡妇调整大小无法正常工作
将Areo Glass主题添加到我的窗口并将WindowState设置为None后,窗口不会正确调整大小.我可以按照我想要的那样大,但是当缩小尺寸时,玻璃效果会保持相同的宽度和高度.
例如,我单击最大化.窗口扩展到全屏大小.但是当恢复我的窗户恢复而不是玻璃效果.
我真正想要的只是模糊效果.我不关心玻璃,但这似乎是我可以获得透明模糊的唯一方法.
我怎样才能解决这个问题?
XAML
<Window x:Class="WpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525" AllowsTransparency="True" WindowStyle="None" ResizeMode="CanResizeWithGrip" Background="Transparent">
<Border BorderThickness="1" Margin="0,35,0,0" BorderBrush="Orange">
<Grid Background="#0CFFA500">
<DockPanel VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="35" Background="#4effffff">
<DockPanel.Resources>
<Style x:Key="WindowIconStyle" TargetType="{x:Type Button}">
<Setter Property="FontSize" Value="16" />
<Setter Property="Foreground" Value="#444" />
<Setter Property="Height" Value="30"></Setter>
<Setter Property="Width" Value="30"></Setter>
<Setter Property="FontFamily" Value="Webdings"></Setter>
<Setter Property="Background" Value="#ff0000"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border BorderBrush="Transparent" BorderThickness="0.5,0,0.5,0">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#77abff" /> …Run Code Online (Sandbox Code Playgroud)