Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 窗口中的UserControl无法使用WPF_C#_Wpf_User Controls - Fatal编程技术网

C# 窗口中的UserControl无法使用WPF

C# 窗口中的UserControl无法使用WPF,c#,wpf,user-controls,C#,Wpf,User Controls,我试图在窗口中放置一个UserControl,因为一个奇怪的原因它不工作。即使在重建和清理项目之后 <Window xmlns:Header="JWKBouwWPF.Controls.Header" x:Class="JWKBouwWPF.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/wi

我试图在窗口中放置一个UserControl,因为一个奇怪的原因它不工作。即使在重建和清理项目之后

<Window xmlns:Header="JWKBouwWPF.Controls.Header" x:Class="JWKBouwWPF.MainWindow" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:JWKBouwWPF"
    mc:Ignorable="d"
    Title="MainWindow" WindowState="Maximized">

这是我的代码,因为它声明通过执行


我重建了它几次,删除并重新添加了UserControl,但都没有效果。

您的命名空间映射缺少
clr namespace
标记。将
xmlns:Header=“jwkbouwpf.Controls.Header”
替换为
xmlns:Header=“clr namespace:jwkbouwpf.Controls.Header”