我刚刚使用以下教程编辑了我的自定义控件以提供 uri 命名空间:http: //blogs.msdn.com/b/knom/archive/2007/11/02/wpf-tired-of-xmlns- clr-命名空间.aspx
[assembly: XmlnsDefinition("http://schemas.mycompany.de/wpf/CustomControls", "MyCompany.MyApp.CustomControls")]
namespace MyCompany.MyApp.CustomControls
{
// CODE HERE
}
并像这样使用它:
<my:ProgressIndicator Grid.Row="2" Height="6" ProgressColor="#23A4D3" />
现在它说
The tag 'ProgressIndicator' does not exist in XML namespace 'http://schemas.mycompany.de/wpf/CustomControls'. Line 111 Position 18.
为什么会这样?我错过了什么?