为什么 MahApps 找不到 Controls.AnimatedTabControl.xaml?

Why is MahApps unable to find Controls.AnimatedTabControl.xaml?

我想在我的 WPF 项目中使用 Controls.AnimatedTabControl.xaml

我添加了行:

<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedTabControl.xaml" />

就像文档中写的那样。

我的 app.xaml 现在是:

<Application x:Class="myAPP.App"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         StartupUri="MainWindow.xaml">
<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
            <ResourceDictionary Source="Controls.TabControl.xaml"/>
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedTabControl.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>

VS 显示查找字典资源时遇到错误:

pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedTabControl.xaml

知道为什么吗?

documentation for tab control is not up-to-date. In version 2.0.0, all tab control styles were moved to the Controls.TabControl.xaml resource dictionary that is already included in Controls.xaml.

查看 GitHub 上的相关更改:(GH-3587) All TabControl styles in one resource dictionary

为了使用不同的样式,您必须将 TabControl 替换为 MahApps 等效项。