C# &引用;物业;没有定义吗?
我试图按照本教程介绍用户设置: 我定义了一个名称为选中的设置,类型为int,作用域为user。在App.xaml中,我有:C# &引用;物业;没有定义吗?,c#,wpf,C#,Wpf,我试图按照本教程介绍用户设置: 我定义了一个名称为选中的设置,类型为int,作用域为user。在App.xaml中,我有: <Application.Resources> <properties:Selected x:Key="Selected"/> </Application.Resources> 编辑: 解决了的! 您需要确保在某个地方定义了属性名称空间,如链接的示例所示: <Application x:Class="S
<Application.Resources>
<properties:Selected x:Key="Selected"/>
</Application.Resources>
编辑:
解决了的!
您需要确保在某个地方定义了属性名称空间,如链接的示例所示:
<Application x:Class="SampleApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:properties="clr-namespace:SampleApp.Properties"
Exit="OnExit"
StartupUri="MainWindow.xaml">
<Application.Resources>
<properties:Settings x:Key="Settings" />
</Application.Resources>
</Application>
注意这行:xmlns:properties=“clr namespace:SampleApp.properties”
在该错误消失之前,您可能需要重新编译。App.xaml的其余部分是什么样子的?该错误表明应用程序标记中没有类似xmlns:properties=“clr namespace:SampleApp.properties”的命名空间声明。