2011-03-28 19 views

回答

0

您可以通過添加這個命名空間上面設置你的控制要包括在默認的xmlns:

[assembly: XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "MyControls.MarkupExtensions")] 
namespace MyControls.MarkupExtensions 
{ 
... 
} 

這只是將它們添加到內置控件的XMLNS而不是取代它。這樣做時,您必須小心,不要踩在任何內置控件的名稱上。

+0

我有以下錯誤:錯誤1在程序集'GenericTemplate'中出現無效的XmlnsDeclaration。 XmlnsDeclaration引用不在程序集中的名稱空間'http://schemas.telerik.com/2008/xaml/presentation'。 – Poma 2011-03-28 23:35:28

+0

請嘗試使用我的示例中的默認Microsoft,或者在您的項目中將一個引用添加到聲明xml名稱空間的Telerik程序集中。 – 2011-03-29 00:25:22

+0

包括在內。我使用'xmlns:t =「http://schemas.telerik.com/2008/xaml/presentation」'。是的,我已經試過它與微軟彙編:'[assembly:XmlnsDefinition(「http://schemas.microsoft.com/winfx/2006/xaml/presentation」,「http://schemas.telerik.com/2008/xaml/presentation「)]' – Poma 2011-03-29 00:41:26

相關問題