Wpf Mahapp Metro窗口标题在任务栏中不可见
我正在使用MahApp MetroWindow,它有一个标题模板,如下所示Wpf Mahapp Metro窗口标题在任务栏中不可见,wpf,xaml,taskbar,titlebar,mahapps.metro,Wpf,Xaml,Taskbar,Titlebar,Mahapps.metro,我正在使用MahApp MetroWindow,它有一个标题模板,如下所示 <metro:MetroWindow x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="ht
<metro:MetroWindow x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:metro="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:local="clr-namespace:WpfApplication1">
<metro:MetroWindow.TitleTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="New Title"/>
</Grid>
</DataTemplate>
</metro:MetroWindow.TitleTemplate>
问题在任务栏中,它不显示标题 将Title属性添加到窗口,并对datatemplate执行templatebinding。试试这个
<metro:MetroWindow x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:metro="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:local="clr-namespace:WpfApplication1"
Title="New Title">
<metro:MetroWindow.TitleTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{TemplateBinding Content}"/>
</Grid>
</DataTemplate>
</metro:MetroWindow.TitleTemplate>