Wpf 为什么我的xaml只显示一个普通的窗口,里面什么都没有
我是WPF、Xaml的新手,也是C#初学者!我一直在做这个,我不知道为什么下面的xaml只显示一个普通窗口。没有按钮,没有标题,没有内容。我将感谢你的指导。如果问我为什么要使用MediaChecker,我会按照Stack Overflow的以下帖子中的一个例子来做: 提前谢谢Wpf 为什么我的xaml只显示一个普通的窗口,里面什么都没有,wpf,windows,visual-studio-2010,xaml,Wpf,Windows,Visual Studio 2010,Xaml,我是WPF、Xaml的新手,也是C#初学者!我一直在做这个,我不知道为什么下面的xaml只显示一个普通窗口。没有按钮,没有标题,没有内容。我将感谢你的指导。如果问我为什么要使用MediaChecker,我会按照Stack Overflow的以下帖子中的一个例子来做: 提前谢谢 <Window x:Class="MediaCheckerWPF.AboutBox" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/present
<Window x:Class="MediaCheckerWPF.AboutBox"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="About Media Checker" Height="300" Width="400" ResizeMode="NoResize"
ShowInTaskbar="False">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="28" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Name:"/>
<Label Grid.Row="1" Grid.Column="0" Content="E-Mail:"/>
<Label Grid.Row="2" Grid.Column="0" Content="Comment:"/>
<Button Grid.Column="1" Grid.Row="0" HorizontalAlignment="Right"
MinWidth="80" Margin="3" Content="START" />
<Button Grid.Column="1" Grid.Row="3" HorizontalAlignment="Right"
MinWidth="80" Margin="3" Content="STOP" />
</Grid>
</Window>
检查App.xaml中的StartupUri
<Application x:Class="GabeTexFilestImport.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
您拥有的XAML渲染效果很好。如果你得到的是一个空白窗口,那么我怀疑这与其他事情有关,比如启动一个不同的窗口
仔细检查App.xaml中的
标记的属性中是否启动了正确的窗口
<Application x:Class="MediaCheckerWPF.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="AboutBox.xaml">
<Application.Resources>
</Application.Resources>
</Application>
我注意到,如果系统非常慢,也会发生这种情况。比如说,您正在达到最大内存消耗,这会降低系统的速度。在这种情况下,我看到xaml窗口出现,但完全是空白的,没有控件,没有最小值、最大值、关闭按钮,没有标题。您使用的xaml渲染效果很好。如果你得到的是一个空白窗口,那么我怀疑这与其他事情有关,比如没有启动正确的窗口;谢谢你的回答,问题是:没有启动正确的窗口。然而,我找不到办法投票支持你的帮助。我想你必须选择答案,然后我才能给出我的反馈。再次感谢。很高兴这帮了你:)我在下面的回答中为你扩展了我的评论