简体   繁体   English

自定义控件Windows Phone应用程序

[英]Custom control Windows phone application

I am trying to create my custom control, but I am still getting error: The name "CustomCircleControl" does not exist in the namespace "using:App8" 我正在尝试创建我的自定义控件,但是仍然出现错误:名称空间“ using:App8”中不存在名称“ CustomCircleControl”

My app namespace is App8 and class CustomCircleControl exists in it. 我的应用程序名称空间是App8,其中存在类CustomCircleControl。 Errors appears in file Generic.xaml, but I do not understand why. 错误出现在文件Generic.xaml中,但我不明白为什么。

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App8">

<Style TargetType="local:CustomCircleControl"> -- This line is marked by visual studio as error (The name "CustomCircleControl" does not exist in the namespace), but intelisence knows class CustomCircleControl.

Thank you for any help :-) 感谢您的任何帮助 :-)

You are declaring the namespace incorrectly. 您在错误地声明名称空间。

The correct way to declare a namespace in XAML is the following: 在XAML中声明名称空间的正确方法如下:

xmlns:MyNamespace="clr-namespace:Your.Namespace.Here"

So in your case, it'll look like this: 因此,在您的情况下,它将如下所示:

xmlns:local="clr-namespace:App8"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM