官术网_书友最值得收藏!

Collection syntax

Sometimes it's required to define a collection of elements in the XAML. This is done using the Collection syntax to make it more readable. For example, a StackPanel can have multiple elements defined inside the Children property :

    <StackPanel> 
       <StackPanel.Children> 
          <Button Content="1" /> 
          <Button Content="2" /> 
       </StackPanel.Children> 
    </StackPanel> 

The preceding example can also be written as follows, where the parser knows how to create and assign it:

    <StackPanel> 
      <Button Content="1" /> 
      <Button Content="2" /> 
    </StackPanel> 
主站蜘蛛池模板: 常山县| 东兰县| 台南县| 思茅市| 隆尧县| 遂平县| 台中市| 宝清县| 夹江县| 合肥市| 泸水县| 东乡族自治县| 芦山县| 军事| 天祝| 宁化县| 天台县| 台山市| 宜君县| 达州市| 威信县| 托克逊县| 怀柔区| 城固县| 乐业县| 玉溪市| 岳阳县| 樟树市| 金湖县| 万源市| 休宁县| 洮南市| 山阳县| 乐陵市| 衢州市| 海城市| 贡山| 阳西县| 吉林省| 黄龙县| 潜山县|