代码改变世界

The property 'Content' is set more than once.

2011-12-25 10:49  一一九九  阅读(765)  评论(0编辑  收藏  举报

当采用如下的一段代码的时候,会出现报错“

Error    1    The property 'Content' is set more than once.  ”

   1:          <Label Content="First Name" Target="{Binding ElementName=firstname}" Grid.Column="0" Grid.Row="0">
   2:              <Border BorderBrush="Blue" BorderThickness="2.0" CornerRadius="3" Padding="2">
   3:                  <AccessText>_First Name</AccessText>                
   4:              </Border>
   5:          </Label>
 
 
看了一下是因为在<Label>的属性中定义了Content节点导致的,猜是因为定义了Content节点,所以<Label>不能再包含子节点了。