属性"内容"设置不止一次

pen*_*ate 9 silverlight xaml

我有以下XAML代码,在指向第16行的错误后抛出错误.

属性"内容"设置不止一次

有什么想法吗?

1       <Grid x:Name="LayoutRoot" Width="970" Height="460" Background="White">  
2           <Grid.RowDefinitions>  
3               <RowDefinition Height="*"/>
4               <RowDefinition Height="80"/>
5           </Grid.RowDefinitions>
6           <Border Margin="3" BorderBrush="#FF464646" BorderThickness="1" CornerRadius="5" Grid.Row="0">
7               <Border.Background>
8                   <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
9                       <GradientStop Color="#FF5B5A5A" Offset="0.02"/>
10                      <GradientStop Color="#FF3B3B3B" Offset="0.213"/>
11                      <GradientStop Color="#FF535151" Offset="0.807"/>
12                  </LinearGradientBrush>
13              </Border.Background>
14   
15               <Liquid:Viewer Content="Viewer">
16                   <Image Source="Images/planet.jpg" Opacity="0.8" Stretch="Fill" />
17               </Liquid:Viewer>
18   
19           </Border>
20          <Border Margin="3" BorderThickness="1" CornerRadius="5" Grid.Row="1">
21              <Border.Background>
Run Code Online (Sandbox Code Playgroud)

Bry*_*son 8

Content属性通常映射到<X></X>标签之间的任何内容,例如

<Control>
    This stuff is set to the Content property
</Control>
Run Code Online (Sandbox Code Playgroud)

但它也可以设置为普通属性,例如

<Control Content="This stuff is set to the Content property" />
Run Code Online (Sandbox Code Playgroud)

在您的示例中,您通过在第15行上设置Content属性(如普通属性)并再次在第16行之间设置标签来执行这两项操作.我猜你会想要摆脱第15行的Content ="Viewer"来获得你想要的输出.