我正在学习 xaml 中的数据绑定(bind),这个 xmlns 问题阻止了我。我的 cs 代码在命名空间“Ping”中。这是我的 MainWindow.xaml:
<Window x:Class="Ping.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:custom="clr-namespace:WPFDemo;assembly=WPFDemo"
xmlns:local="clr-namespace:Ping"
最后一行在标题中提示。为什么它不起作用?我正在使用“Ping”,这是我获得的唯一命名空间。
谢谢
最佳答案
如 Ping
是您使用的唯一命名空间,您应该删除对 WPFDemo
的引用
关于WPF xmlns : The 'clr-namespace' URI refers to a namespace that is not included in the assembly,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7130143/