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

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> 
主站蜘蛛池模板: 嘉善县| 巫山县| 蓝田县| 阿拉善左旗| 和田县| 洛隆县| 新和县| 池州市| 仙桃市| 伊金霍洛旗| 贵德县| 双牌县| 香港 | 綦江县| 渝中区| 塔河县| 凭祥市| 绵阳市| 新巴尔虎左旗| 乃东县| 张家川| 延川县| 宁强县| 简阳市| 八宿县| 合山市| 田阳县| 萨迦县| 定日县| 建始县| 土默特左旗| 周宁县| 称多县| 娄底市| 高淳县| 运城市| 湖口县| 通州区| 板桥市| 丹巴县| 乌拉特后旗|