WindowStyle.xaml 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  3. <Style x:Key="WindowStyle" TargetType="{x:Type Window}">
  4. <Setter Property="WindowChrome.WindowChrome">
  5. <Setter.Value>
  6. <WindowChrome
  7. CaptionHeight="32"
  8. CornerRadius="0"
  9. GlassFrameThickness="0"
  10. ResizeBorderThickness="5"
  11. UseAeroCaptionButtons="False" />
  12. </Setter.Value>
  13. </Setter>
  14. <Setter Property="Template">
  15. <Setter.Value>
  16. <ControlTemplate TargetType="{x:Type Window}">
  17. <Border
  18. Background="{TemplateBinding Background}"
  19. BorderBrush="{TemplateBinding BorderBrush}"
  20. BorderThickness="{TemplateBinding BorderThickness}">
  21. <AdornerDecorator>
  22. <ContentPresenter x:Name="win_content" />
  23. </AdornerDecorator>
  24. </Border>
  25. <ControlTemplate.Triggers>
  26. <Trigger Property="WindowState" Value="Maximized">
  27. <Setter TargetName="win_content" Property="Margin" Value="5,5,5,5" />
  28. </Trigger>
  29. </ControlTemplate.Triggers>
  30. </ControlTemplate>
  31. </Setter.Value>
  32. </Setter>
  33. </Style>
  34. </ResourceDictionary>