2013-03-15 93 views
4

此代碼提示的XamlParseException:可延遲內容XAML

'設置屬性 'System.Windows.ResourceDictionary.DeferrableContent' 引發了異常。'行號「15」和線位置「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:

項目已添加。重點在詞典: 'DataTemplateKey(MyModel.FaultLibrary.TestPoint)' 鍵被添加: 'DataTemplateKey(MyModel.FaultLibrary.TestPoint)'

我不知道爲什麼......

感謝您的幫助。

+2

見http://blog.saraf.me/2011/02/set-property-threw-exception.html – 2013-03-15 14:55:19

+0

和** **的InnerException? – paul 2013-03-15 15:01:57

+0

我已經嘗試重建我的解決方案,但它不爲我工作,我沒有找到任何重複。 – Shuyuntake 2013-03-15 15:06:24

回答

2

似乎有一些樣式/模板,似乎有相同的密鑰,否則,某些元素有多種樣式設置。檢查您的資源和資源庫。