[英]Why is MahApps unable to find Controls.AnimatedTabControl.xaml?
I would like to use the Controls.AnimatedTabControl.xaml
in my WPF project.我想在我的 WPF 项目中使用
Controls.AnimatedTabControl.xaml
。
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:我的 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 shows me that an error has been encountered when seeking for the dictionary resource: VS 告诉我在寻找字典资源时遇到了错误:
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
.在版本 2.0.0中,所有选项卡控件 styles 都已移至
Controls.TabControl.xaml
资源字典,该字典已包含在Controls.xaml
中。
See the related change on GitHub: (GH-3587) All TabControl styles in one resource dictionary请参阅 GitHub 上的相关更改: (GH-3587) All TabControl styles 在一个资源字典中
In order to use the different styles, you have to replace your TabControl
with the MahApps equivalent.为了使用不同的 styles,您必须将
TabControl
替换为MahApps等效项。
<mah:MetroAnimatedTabControl>
<mah:MetroAnimatedTabControl>
<mah:MetroAnimatedSingleRowTabControl>
<mah:MetroAnimatedSingleRowTabControl>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.