C# Can';t在ControlTemplate中引用控件
我有一个ResourceDictionary,其中包含一个ControlTemplate,我在其中引用来自另一个程序集的对象C# Can';t在ControlTemplate中引用控件,c#,wpf,controls,controltemplate,C#,Wpf,Controls,Controltemplate,我有一个ResourceDictionary,其中包含一个ControlTemplate,我在其中引用来自另一个程序集的对象 <ResourceDictionary xmlns:gauge="clr-namespace:ActiproSoftware.Products.Gauge;assembly=ActiproSoftware.Gauge.Wpf351"> <ControlTemplate x:Key="Gauge270Template">
<ResourceDictionary
xmlns:gauge="clr-namespace:ActiproSoftware.Products.Gauge;assembly=ActiproSoftware.Gauge.Wpf351">
<ControlTemplate x:Key="Gauge270Template">
<gauge:CircularGauge/>
</ControlTemplate>
</ResourceDictionary>
p.S.仪表组件已生成,我可以从应用程序的其他部分引用它确保两个组件都不针对项目属性的“生成”部分中的客户配置文件。可能引用仪表控件的程序集设置为目标.Net Framework 4.0客户端配置文件(VS 2010的默认设置)(您也可以在生成错误的警告部分看到此问题)我无法重现此问题。您的代码看起来也不错,很难说问题出在哪里。当您键入intellisence时,intellisence是否在ResourceDictionary中工作?向我显示仪表,但它不显示仪表本身的任何对象。
Error 1 The type 'gauge:CircularGauge' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.