對於我使用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