Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Can';t在ControlTemplate中引用控件_C#_Wpf_Controls_Controltemplate - Fatal编程技术网

C# Can';t在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,其中包含一个ControlTemplate,我在其中引用来自另一个程序集的对象

<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.