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

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> 
主站蜘蛛池模板: 常宁市| 新宁县| 调兵山市| 景德镇市| 衡东县| 石棉县| 民乐县| 子洲县| 桂平市| 宜君县| 都江堰市| 英山县| 治县。| 延庆县| 鄯善县| 贵港市| 张家口市| 宁远县| 安远县| 翼城县| 兴安县| 台南县| 东莞市| 奉贤区| 应城市| 巴林右旗| 渭南市| 龙井市| 舞阳县| 塔城市| 泰和县| 子洲县| 武川县| 农安县| 三门县| 衡阳县| 金沙县| 黔西县| 台南市| 云和县| 晋江市|