自动生成的XAML代码错误?

时间:2014-07-28 14:00:11

标签: c# wpf xaml

我已经创建了一个新的WPF项目,我做的就是添加 WindowStartupLocation WindowStyle 允许透明度。然后我删除了自动生成的网格

所以这就是结果:

<Window x:Class="test.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="test" Height="768" Width="1024"
        WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True">
</Window>

然而我得到了错误:

Character sequence '</' was not expected at this location.

这是为什么? XAML有什么问题?

1 个答案:

答案 0 :(得分:3)

XAML没有任何问题。只需重建程序,关闭所有xaml视图并重新打开。这应该可以解决问题。

PS:对于此事,Window或任何ContentControl允许空内容。

相关问题