[英]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
知道為什么嗎?
選項卡控件的文檔不是最新的。 在版本 2.0.0中,所有選項卡控件 styles 都已移至Controls.TabControl.xaml
資源字典,該字典已包含在Controls.xaml
中。
請參閱 GitHub 上的相關更改: (GH-3587) All TabControl styles 在一個資源字典中
為了使用不同的 styles,您必須將TabControl
替換為MahApps等效項。
<mah:MetroAnimatedTabControl>
<mah:MetroAnimatedSingleRowTabControl>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.