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

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> 
主站蜘蛛池模板: 大安市| 昌邑市| 平武县| 东方市| 焦作市| 朔州市| 通渭县| 阜南县| 合作市| 奉贤区| 屯昌县| 西宁市| 永清县| 枞阳县| 永仁县| 阿拉善盟| 白水县| 红原县| 新巴尔虎左旗| 黄石市| 鸡泽县| 凤阳县| 邵武市| 都匀市| 雅安市| 墨竹工卡县| 香河县| 阿克| 峨眉山市| 山阴县| 南郑县| 射洪县| 五寨县| 大庆市| 琼中| 延边| 延边| 平武县| 鹤岗市| 平塘县| 黄山市|