您好,
我准备使用Microsoft.window.shell.dll修改标题栏的WPF窗口的应用程序,但是当我们改变了系统的主题我的项目的标题栏变成黑色。谁能帮我解决这个问题。
下面是代码
<Window x:Class="Hello.Window1" xml:lang="en-US"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:shell="http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell"
xmlns:Hello="clr-namespace:Hello"
xmlns ="http://schemas.microsoft.com/expression/blend/2006"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:local="clr-namespace:Hellow"
x:Name="Window"
Title="Hello"
MinHeight="100"
MinWidth="200" SizeChanged="Window_SizeChanged"
Height="635" Width="955" Loaded="Window_Loaded"
ResizeMode="CanResize" WindowStartupLocation="CenterScreen" Icon="/Hello;component/graphics/Menu.gif" PreviewKeyDown="Window_PreviewKeyDown" MouseLeftButtonDown="Window_MouseDown"
>
<Window.CommandBindings>
<CommandBinding Command="{x:Static shell:SystemCommands.CloseWindowCommand}"
Executed="_OnSystemCommandCloseWindow"/>
</Window.CommandBindings>
<Window.Resources>
<Style x:Key="GlassStyle" TargetType="{x:Type local:Window1}">
<Setter Property="shell:WindowChrome.WindowChrome">
<Setter.Value>
<shell:WindowChrome GlassFrameThickness="-1" ResizeBorderThickness="6" CaptionHeight="40" CornerRadius="6,0,6,20" />
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:Window1}">
<Grid>
<Border BorderThickness="3" BorderBrush="#3b5998" CornerRadius="8,8,8,8" Background="Transparent">
<ContentPresenter Margin="6,26,6,6" Content="{TemplateBinding Content}"/>
</Border>
<ContentPresenter
Margin="{Binding Source={x:Static shell:SystemParameters2.Current}, Path=WindowNonClientFrameThickness}" Content="{TemplateBinding Content}"/>
<Button shell:WindowChrome.IsHitTestVisibleInChrome="True" VerticalAlignment="Top" HorizontalAlignment="Left" Style="{StaticResource GlassButton}"
Margin="15,5,4,6" Width="40" Height="40"
Padding="8">
<Button.ContextMenu>
<ContextMenu>
<MenuItem Name="create_send_log" Header="Create and send log file" Click="create_send_log_Click" FontFamily="Tahoma" Background="{DynamicResource TitleBorderBrush}" />
<MenuItem Name="logMenu"