123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:prism="http://prismlibrary.com/">
- <Style x:Key="WindowStyle" TargetType="{x:Type Window}">
- <Setter Property="WindowChrome.WindowChrome">
- <Setter.Value>
- <WindowChrome
- CaptionHeight="32"
- CornerRadius="0"
- GlassFrameThickness="0"
- ResizeBorderThickness="5"
- UseAeroCaptionButtons="False" />
- <!-- GlassFrameThickness="-1" win11上显示异常 -->
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Window}">
- <Border
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}">
- <AdornerDecorator>
- <ContentPresenter x:Name="win_content" />
- </AdornerDecorator>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="WindowState" Value="Maximized">
- <!-- 调整边框 -->
- <Setter TargetName="win_content" Property="Margin" Value="5,5,5,5" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="WindowWithCorderStyle" TargetType="{x:Type Window}">
- <Setter Property="WindowChrome.WindowChrome">
- <Setter.Value>
- <WindowChrome
- CaptionHeight="48"
- CornerRadius="15"
- GlassFrameThickness="-1"
- ResizeBorderThickness="5"
- UseAeroCaptionButtons="False" />
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Window}">
- <Border
- Margin="20"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="8"
- Effect="{StaticResource shadow.black-2-2}">
- <Grid>
- <!-- esc关闭窗体按钮 -->
- <Button
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Background="Transparent"
- IsCancel="True" />
- <AdornerDecorator>
- <ContentPresenter x:Name="win_content" />
- </AdornerDecorator>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="WindowState" Value="Maximized">
- <!-- 调整边框 -->
- <Setter TargetName="win_content" Property="Margin" Value="5,5,5,5" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="WindowNoCorderStyle" TargetType="{x:Type Window}">
- <Setter Property="WindowChrome.WindowChrome">
- <Setter.Value>
- <WindowChrome
- CaptionHeight="48"
- CornerRadius="0"
- GlassFrameThickness="-1"
- ResizeBorderThickness="5"
- UseAeroCaptionButtons="False" />
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Window}">
- <Border
- Margin="20"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="0">
- <Grid>
- <!-- esc关闭窗体按钮 -->
- <Button
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Background="Transparent"
- IsCancel="True" />
- <AdornerDecorator>
- <ContentPresenter x:Name="win_content" />
- </AdornerDecorator>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="WindowState" Value="Maximized">
- <!-- 调整边框 -->
- <Setter TargetName="win_content" Property="Margin" Value="5,5,5,5" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- 弹窗的窗体样式 -->
- <Style
- x:Key="DialogWindowStyle"
- BasedOn="{StaticResource WindowNoCorderStyle}"
- TargetType="{x:Type Window}">
- <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterOwner" />
- <Setter Property="SizeToContent" Value="WidthAndHeight" />
- <Setter Property="ShowInTaskbar" Value="False" />
- <Setter Property="ResizeMode" Value="NoResize" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="BorderBrush">
- <Setter.Value>
- <SolidColorBrush Opacity="0.3" Color="Gray" />
- </Setter.Value>
- </Setter>
- <Setter Property="Background" Value="Transparent" />
- </Style>
- <Style
- x:Key="Caption16DialogWindowStyle"
- BasedOn="{StaticResource DialogWindowStyle}"
- TargetType="{x:Type Window}">
- <Setter Property="WindowChrome.WindowChrome">
- <Setter.Value>
- <WindowChrome
- CaptionHeight="16"
- CornerRadius="15"
- GlassFrameThickness="-1"
- ResizeBorderThickness="5"
- UseAeroCaptionButtons="False" />
- </Setter.Value>
- </Setter>
- </Style>
- <Style
- x:Key="InfoDialogWindowStyle"
- BasedOn="{StaticResource WindowWithCorderStyle}"
- TargetType="{x:Type Window}">
- <Setter Property="WindowStyle" Value="ThreeDBorderWindow" />
- <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterOwner" />
- <Setter Property="SizeToContent" Value="WidthAndHeight" />
- <Setter Property="ShowInTaskbar" Value="True" />
- <Setter Property="ResizeMode" Value="NoResize" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="BorderBrush">
- <Setter.Value>
- <SolidColorBrush Opacity="0.3" Color="Gray" />
- </Setter.Value>
- </Setter>
- <Setter Property="Background" Value="Transparent" />
- </Style>
- <Style
- x:Key="stlWindowEx"
- BasedOn="{StaticResource DialogWindowStyle}"
- TargetType="{x:Type Window}">
- <Setter Property="ResizeMode" Value="CanResize" />
- </Style>
- </ResourceDictionary>
|