当我尝试使用 Name="id"
和/或 x:name="id"
时,我会收到编译器错误:
The Type 'MyName' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
当我没有指定这个时,我的控件运行得很好。有什么建议吗?
当我尝试使用 Name="id"
和/或 x:name="id"
时,我会收到编译器错误:
The Type 'MyName' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
当我没有指定这个时,我的控件运行得很好。有什么建议吗?
x:Name
,尽管只写Name
通常(但不总是)也可以工作。x:Class
是否与代码后台文件的名称(和命名空间!)匹配?我知道某些版本的Blend和VS没有正确插入默认命名空间,当然,如果您已将其从默认值更改,则需要确保还更改了其他文件。我之前遇到过这个问题,认为这是编译器的一个错误。最终,我只是在我的 XAML 中放置了一个命名的 ContentControl
并从代码后台将用户控件放入其中。希望有人能分享一个实际的解决方法。