Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
- <Style x:Key="Windows95CaptionButton" TargetType="{x:Type Button}">
- <Setter Property="Background" Value="#C3C3C3" />
- <Setter Property="Height" Value="14" />
- <Setter Property="Width" Value="16" />
- <Setter Property="Margin" Value="2,0,0,0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Border BorderThickness="0,0,1,1"
- BorderBrush="Black"
- Background="{TemplateBinding Background}"
- Name="PART_BlackOutline">
- <Grid>
- <Border HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- BorderThickness="1,1,0,0"
- BorderBrush="White"
- Background="Transparent"
- x:Name="PART_WhiteHighlight"/>
- <Border HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- Margin="1,1,0,0"
- BorderThickness="0,0,1,1"
- BorderBrush="#828282"
- x:Name="PART_DarkerHighlight" />
- <ContentPresenter Content="{TemplateBinding Content}"
- HorizontalAlignment="Center"
- VerticalAlignment="Center" />
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="PART_BlackOutline" Property="BorderBrush" Value="White" />
- <Setter TargetName="PART_DarkerHighlight" Property="BorderBrush" Value="#DFDFDF" />
- <Setter TargetName="PART_WhiteHighlight" Property="BorderBrush" Value="Black" />
- <Setter Property="Background" Value="#C0C0C0" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style TargetType="Window" x:Key="test">
- <Setter Property="Background" Value="#C3C3C3" />
- <Setter Property="WindowChrome.WindowChrome">
- <Setter.Value>
- <WindowChrome CaptionHeight="0"
- CornerRadius="0"
- GlassFrameThickness="-1"
- ResizeBorderThickness="4"
- UseAeroCaptionButtons="False" />
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Window">
- <Border x:Name="PART_MainBorder"
- Background="{TemplateBinding Background}"
- BorderBrush="Black"
- BorderThickness="0,0,1,1">
- <Grid>
- <Border HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- Margin="1"
- BorderThickness="1,1,0,0"
- BorderBrush="White"
- Background="Transparent" />
- <Border HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- Margin="1,1,0,0"
- BorderThickness="0,0,1,1"
- BorderBrush="#828282"
- Background="Transparent" />
- <Border HorizontalAlignment="Stretch"
- VerticalAlignment="Top"
- Margin="3,3,3,0"
- BorderThickness="0"
- BorderBrush="Transparent"
- Background="#000082"
- Height="18"
- x:Name="PART_TitleBar">
- <Grid>
- <Image HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Margin="3,0,0,0"
- Source="{TemplateBinding Icon}"
- RenderOptions.BitmapScalingMode="NearestNeighbor"
- Width="16"
- Height="16"
- x:Name="PART_Icon"/>
- <TextBlock HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Margin="25,0,0,0"
- FontFamily="Arial"
- Text="{TemplateBinding Title}"
- Foreground="White"
- FontWeight="SemiBold"
- TextOptions.TextFormattingMode="Display"
- TextOptions.TextRenderingMode="Aliased"
- TextOptions.TextHintingMode="Fixed" />
- <StackPanel Orientation="Horizontal"
- VerticalAlignment="Center"
- HorizontalAlignment="Right"
- Margin="0,0,2,0">
- <Button Style="{StaticResource Windows95CaptionButton}"
- x:Name="PART_MinimizeButton">
- <Button.Content>
- <Image Height="14"
- Width="16"
- SnapsToDevicePixels="True"
- Source="../Images/close.png" />
- </Button.Content>
- </Button>
- <Button Style="{StaticResource Windows95CaptionButton}" Margin="0"
- x:Name="PART_MaximizeButton">
- <Button.Content>
- <Image Height="14"
- Width="16"
- SnapsToDevicePixels="True"
- Source="../Images/close.png" />
- </Button.Content>
- </Button>
- <Button Style="{StaticResource Windows95CaptionButton}"
- x:Name="PART_CloseButton">
- <Button.Content>
- <Image Height="14"
- Width="16"
- SnapsToDevicePixels="True"
- Source="../Images/close.png" />
- </Button.Content>
- </Button>
- </StackPanel>
- </Grid>
- </Border>
- <ContentPresenter Margin="3,22,2,2"
- Content="{TemplateBinding Content}" />
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="ResizeMode" Value="CanMinimize">
- <Setter TargetName="PART_MaximizeButton" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <Trigger Property="ResizeMode" Value="NoResize">
- <Setter TargetName="PART_MaximizeButton" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="PART_MinimizeButton" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <Trigger Property="WindowState" Value="Maximized">
- <Setter TargetName="PART_TitleBar" Property="Margin" Value="10,10,9,0" />
- </Trigger>
- <Trigger Property="IsActive" Value="False">
- <Setter TargetName="PART_TitleBar" Property="Background" Value="#808080" />
- </Trigger>
- <Trigger Property="Icon" Value="{x:Null}">
- <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
Advertisement
Add Comment
Please, Sign In to add comment