Property elements cannot be in the middle of of an element's content
如题,出现这个错误Property elements cannot be in the middle of of an element's content. They must be before or after the content ,
在Silverlight的设计器中,代码设计如下:
1 <!--菜单条--> 2 <Grid HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,100" Height="80"> 3 <!--边界--> 4 <Border Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" Grid.ColumnSpan="4" Opacity="0.4" Background="Wheat" 5 Width="800" Height="80" CornerRadius="5"/> 6 7 <Grid.RowDefinitions> 8 <RowDefinition Height="50"/> 9 10 <RowDefinition /> 11 </Grid.RowDefinitions> 12 <Grid.ColumnDefinitions> 13 <ColumnDefinition /> 14 <ColumnDefinition /> 15 <ColumnDefinition /> 16 <ColumnDefinition /> 17 </Grid.ColumnDefinitions> 18 19 <!--地图服务--> 20 <Image x:Name="imgGIS" Grid.Row="0" Grid.Column="3" 21 VerticalAlignment="Center" Width="50" Margin="5" MouseLeftButtonUp="imgGIS_MouseLeftButtonUp" 22 ToolTipService.ToolTip="转向地图服务" Source="/Main;component/Icons/MapService.png" /> 23 24 <TextBlock Grid.Row="1" Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center" 25 Foreground="White" FontFamily="Microsoft YaHei" FontSize="18" >地图服务</TextBlock> 26 </Grid>
在定义Image地方会出现该错误。错误的原因是:将Border的定义插在了
<Grid.ColumnDefinitions>或<Grid.RowDefinitions>
之前定义。将Border的定义在
<Grid.ColumnDefinitions>或<Grid.RowDefinitions>
之后,问题就可以解决。

浙公网安备 33010602011771号