开发者

Can't reference a control inside ControlTemplate

开发者 https://www.devze.com 2023-01-30 22:12 出处:网络
I have a ResourceDictionary which contains a ControlTemplate where I reference object from another assembly.

I have a ResourceDictionary which contains a ControlTemplate where I reference object from another assembly.

<ResourceDictionary
    xmlns:gauge="clr-namespace:ActiproSoftware.Products.Gauge;assembly=ActiproSoftware.Gauge.Wpf351">

    <ControlTemplate x:Key="Gauge270Template">
     开发者_JAVA百科   <gauge:CircularGauge/>
    </ControlTemplate>
</ResourceDictionary>

Which gives me the following error:

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.

P.S. gauge assembly is built and I am able to reference it from other parts of the application


Make sure both assemblies do not target the Client Profile in the Build section of Project Properties. Probably the assembly that has the reference to the Gauge control is set to target .Net Framework 4.0 Client Profile (default from VS 2010) (You can also see this problem in the Warnings section of your build-errors)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号