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

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> 
主站蜘蛛池模板: 明光市| 绥棱县| 嘉兴市| 阿巴嘎旗| 新源县| 白银市| 太原市| 古丈县| 观塘区| 新泰市| 福清市| 重庆市| 金平| 腾冲县| 台中市| 内江市| 镇远县| 江油市| 昭通市| 牡丹江市| 襄汾县| 芜湖市| 昭通市| 商城县| 招远市| 阿巴嘎旗| 如皋市| 开化县| 抚松县| 金华市| 铜川市| 苍溪县| 三亚市| 资讯 | 泸定县| 双柏县| 秦皇岛市| 哈尔滨市| 孟津县| 正安县| 周至县|