对于我使用XAML的项目。我已将屏幕划分为不同的部分。当我添加一个按钮的时候,我收到一个错误。XAML特性元素
错误:
'property elements cannot be in the middle of an element's content'
我使用的按钮,其误差已发现代码:
<Button x:Name="cntButton" Content="Connect" Grid.Column="1" Grid.Row="2" Click="cntButton_Click" />
有谁知道问题是什么,我怎么也得解决它?
的其余代码:
<Window x:Class="Pesten.View.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Image Grid.RowSpan="4" Grid.ColumnSpan="3" Stretch="Fill" Source="pestenbg.jpg" VerticalAlignment="Top" HorizontalAlignment="Center"/>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="4*"/>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="4*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="5*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="2*"/>
</Grid.RowDefinitions>
<Button x:Name="cntButton" Content="Connect" Grid.Column="1" Grid.Row="2" Click="cntButton_Click" />
</Grid>
</Window>
,你能否告诉XAML文件的休息吗? – BenjaminPaul
Button元素本身看起来不错。你可以发布更多的XAML吗?也许整个呢?的 –
可能重复[WPF错误:属性元素不能在元素内容的中间。他们必须在内容之前或之后](http://stackoverflow.com/questions/26524787/wpf-error-property-elements-cannot-be-in-the-middle-of-an-elements-content-th) – Dzyann