参考型号无法找到名为public类型 [英] Type reference cannot find public type named

查看:271
本文介绍了参考型号无法找到名为public类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到类似的错误类型引用无法找到名为符号公共型在XAML。我怎样才能解决这个问题。 ,符号类在同一个程序集

I am getting error like "Type reference cannot find public type named 'Sign'" in xaml. how can i resolve it. the Sign class is in the same assembly.

<DataTemplate DataType="{x:Type local:Sign}">
    <Expander Padding="4"
              IsExpanded="{Binding RelativeSource={
                    RelativeSource Mode=FindAncestor, AncestorType={
                       x:Type ListBoxItem}}, Path=IsSelected}">
        <Expander.Header>
            <TextBlock Text="{Binding Name}" ... />
        </Expander.Header>
        <DockPanel LastChildFill="True">
            <Border DockPanel.Dock="Left" CornerRadius="16" BorderBrush="WhiteSmoke" Background="AliceBlue" BorderThickness="5" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Image Source="{Binding Icon}" Width="90" Height="90" Stretch="Fill" />
            </Border>
            ...
        </DockPanel>                
    </Expander>



推荐答案

如果该类型驻留在为XAML要修改的同一总成,省略了CLR的命名空间的组装环节,当您导入的命名空间。

If the type resides in the same assembly as the XAML you are modifying, omit the assembly segment of the clr-namespace when you import the namespace.

< STRONG> DO

xmlns:local="clr-namespace:NamespaceContainingSignClass"

不要

xmlns:local="clr-namespace:NamespaceContainingSignClass;assembly=AssemblyContainingSignClassAndXAML"

这篇关于参考型号无法找到名为public类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆