WPF xmlns: The 'clr-namespace' URI refers

2019-02-20 16:45发布

问题:

I am learning data binding in xaml and this xmlns problem is stopping me. My cs code is in namespace "Ping". Here is my 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"

The last line complains as in the title. Why is it not working? I am using "Ping" and it's the only namespace I got.

Thanks

回答1:

If Ping is the only namespace you're using, you should remove the reference to WPFDemo