简体   繁体   中英

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

I would like to use the Controls.AnimatedTabControl.xaml in my WPF project.

I added the line:

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

Like it's written in the documentation.

My app.xaml is now:

<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 shows me that an error has been encountered when seeking for the dictionary resource:

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

Any idea why?

The 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 .

See the related change on GitHub: (GH-3587) All TabControl styles in one resource dictionary

In order to use the different styles, you have to replace your TabControl with the MahApps equivalent.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM