I am creating custom WPF Window using WindowChrome. I have my own style defined but title bar presents problem. If I set Background of my main Grid in template to Transparent then the whole window uses system accent colors and Maximize/Minimize/Close buttons are visible.
When I set any other background Maximize/Minimize/Close buttons get covered. I thought I just make my own, but those buttons are still clickable.
Is there any way to either show them or disable completely?
I can set CaptionHeight to 0 and create mi own title bar, but I don't want to reimplement drag and other default features.
My Style is below:
<Window.Style>
<Style TargetType="{x:Type Window}">
<Setter Property="shell:WindowChrome.WindowChrome">
<Setter.Value>
<shell:WindowChrome GlassFrameThickness="-1"
ResizeBorderThickness="4"
CaptionHeight="36"/>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:ConfigurationWindow}" >
<Grid>
<Rectangle Fill="Blue" VerticalAlignment="Top" Width="{TemplateBinding Width}"
Height="35" ></Rectangle>
<!-- This is the ContentPresenter that displays the window content. -->
<Border Margin="0,40,0,5" >
<ContentPresenter Content="{TemplateBinding Content}"/>
</Border>
<!--This is the transparent white rectangle that goes behind the window content.-->
<Border Margin="1,40,1,5" BorderBrush="Gray" BorderThickness="0,1,0,1"
Grid.ZIndex="-1">
<Rectangle Fill="White" Opacity="0.5" />
</Border>
<!-- Window Title -->
<TextBlock VerticalAlignment="Top" TextAlignment="Center"
Padding="0,3,0,8"
Text="{Binding RelativeSource=
{RelativeSource TemplatedParent}, Path=Title}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Style>