我是WPF的新手,我的MainWindow.xaml
文件中有一个错误,似乎并不妨碍构建或运行对我来说很奇怪的项目。
在我的MainWindow.xaml
中,我有:
<Window x:Class="MyP"
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:MyProject"
xmlns:controls="clr-namespace:MyProject.View"
mc:Ignorable="d"
Title="MyProject" Height="800" Width="1200">
<Grid>
<controls:LoginView></controls:LoginView>
<controls:Screen1></controls:Screen1>
</Grid>
</Window>
第<controls:LoginView></controls:LoginView>
行显示为绿色的波浪线,将鼠标悬停在该行上时显示:“值不能为空。参数名称:uriString”
我的LoginView.xaml
:
<UserControl x:Class="MyProject.View.LoginView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:MyProject.View"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="1200">
<Grid>...</Grid>
</UserControl
LoginView.xaml.cs
public partial class LoginView : UserControl
{
public LoginView()
{
InitializeComponent();
DataContext = new LoginViewModel();
}
}
有人知道此错误指的是什么以及如何解决该错误吗?