c# – 可延迟内容xaml

此代码提示XamlParseException:

‘Set property ‘System.Windows.ResourceDictionary.DeferrableContent’
threw an exception.’ Line number ’15’ and line position ’14’
.

<UserControl  x:Class="MyView.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:d="http://schemas.microsoft.com/expression/blend/2008" 
         xmlns:bv="clr-namespace:MyModel.FaultLibrary;assembly=Controller"
         xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"       
         xmlns:i18n="http://wpflocalizeextension.codeplex.com"
         i18n:LocalizeDictionary.DesignCulture="en"
         i18n:ResxLocalizationProvider.DefaultAssembly="MyView"
         i18n:ResxLocalizationProvider.DefaultDictionary="I18n"
         xmlns:gif="http://wpfanimatedgif.codeplex.com"
         mc:Ignorable="d" 
         d:DesignHeight="448" d:DesignWidth="955" FontFamily="Arial"
         TextOptions.TextFormattingMode="Display"
         SnapsToDevicePixels="True"
         UseLayoutRounding="True">

innerException:

Item has already been added. Key in dictionary: ‘DataTemplateKey(MyModel.FaultLibrary.TestPoint)’ Key being added: ‘DataTemplateKey(MyModel.FaultLibrary.TestPoint)’

我不知道为什么……

感谢帮助.

最佳答案 似乎有一些样式/模板似乎具有相同的键,否则,某些元素具有多个样式集.检查您的资源和资源库.

点赞