【发布时间】:2018-11-10 04:43:51
【问题描述】:
我知道这是一个反复出现的错误,但我似乎无法绕过它。 Intellisense 确实识别出我的自定义控件的名称并建议添加正确的 using: 指令,但不仅 XAML 设计器找不到控件的名称,而且我也无法通过编译。
自定义控件是一个公共类,定义为
namespace MyApp.CustomControls
{
public class CustomTextBox : TexBox
{
...
}
}
在我的MainPage.xaml
<Page ...
xmlns:customControls="using:MyApp.CustomControls">
...
<customControls:CustomTextBox/>
...
</Page>
这不会在设计中呈现或编译。 This answer 和下面的不适合我。
错误信息:
Error XDG0008 The name "CustomTextBox" does not exist in the namespace "using:MyApp.CustomControls".
【问题讨论】:
-
从您链接的链接中,尝试使用
clr-namespace而不是using -
也不工作。据我所知,
using是 UWP 中使用的语法。 -
对,你链接了 wpf
-
这是为了证明我已经完成了我的研究并且没有任何工作,并避免
duplicate标志指向一个过时的问题 -
你能提供确切的错误信息吗?
标签: c# visual-studio-2017 uwp-xaml