WPF WindowChrome form shadow effect from the definition of the title bar settings

About to GlassFrameThickness value is set to "0,0,0,1", then you can get the shadow effect, the shadow effect as the system default (test system is Win10)

Reference Links: https://stackoverflow.com/questions/5897495/shell-integration-library-windowchrome-with-drop-shadow

In MSDN did not find instructions

Note: Discovery will ResizeMode write directly on Window tag attributes rather than Style.Setter assign values ​​in the test, when the value NoResize, the form will no shadow effect

xmlns:shell="clr-namespace:System.Windows.Shell;assembly=PresentationFramework"
<Window.Style> <Style TargetType="Window"> <Setter Property="UseLayoutRounding" Value="True"/> <Setter Property="ResizeMode" Value="NoResize"/> <Setter Property="shell:WindowChrome.WindowChrome"> <Setter.Value> <shell:WindowChrome CaptionHeight="80" GlassFrameThickness="0,0,0,1" ResizeBorderThickness="5" /> </Setter.Value> </Setter> <Style.Triggers> <DataTrigger Binding="{Binding DataContext.IsHomePage, RelativeSource={RelativeSource Self}}" Value="false"> <Setter Property="ResizeMode" Value="CanResize"/> </DataTrigger> </Style.Triggers> </Style> </Window.Style>

 

Guess you like

Origin www.cnblogs.com/maoyuanwai/p/12329204.html