WindowBigCloseStyle.xaml 2.06 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="MaterialDesignIcons.xaml"/>
        <ResourceDictionary Source="Dictionary_MyStyle.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <ControlTemplate x:Key="WindowBigCloseControlTemplate" TargetType="{x:Type Window}">
        <Grid>
            <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Height="120" Width="120">
                <Ellipse Fill="Black" Height="120" Width="120" HorizontalAlignment="Center" VerticalAlignment="Center"/>
            </Grid>
            <Border CornerRadius="3" BorderThickness="5" BorderBrush="Black" Background="White" Margin="0,60,60,0">
                <AdornerDecorator>
                    <ContentPresenter/>
                </AdornerDecorator>
            </Border>
18 19
            <Grid HorizontalAlignment="Right" VerticalAlignment="Top" Margin="5" Height="110" Width="{Binding Height,RelativeSource={RelativeSource Mode=Self}}" >
                <Ellipse Fill="White" Stretch="Fill" />
潘栩锋's avatar
潘栩锋 committed
20
                <Button Name="button_close" Style="{StaticResource Styles.Button.Empty}" Margin="5" BorderThickness="0" >
21 22 23 24
                    <Path Data="{StaticResource Geometry_close-circle}" Fill="Red" Stretch="Fill" />
                </Button>
            </Grid>
            
潘栩锋's avatar
潘栩锋 committed
25 26 27
        </Grid>
    </ControlTemplate>
    <Style x:Key="WindowBigCloseStyle" TargetType="{x:Type Window}">
28
        <Setter Property="Foreground" Value="{StaticResource {x:Static SystemColors.WindowTextBrushKey}}"/>
潘栩锋's avatar
潘栩锋 committed
29 30 31 32 33 34 35 36
        <Setter Property="Background" Value="{x:Null}"/>
        <Setter Property="ResizeMode" Value="NoResize"/>
        <Setter Property="WindowStyle" Value="None"/>
        <Setter Property="AllowsTransparency" Value="True"/>
        <Setter Property="SizeToContent" Value="WidthAndHeight" />
        <Setter Property="Template" Value="{StaticResource WindowBigCloseControlTemplate}" />
    </Style>
</ResourceDictionary>