如何在XAML中为windows metro应用程序创建Accordion控件?
答案 0 :(得分:1)
创建手风琴的技巧之一是使用ZeroProximity.Accordion
。它是Silverlight Toolkit <Accordion>
控件的端口。
您可以通过
将此包添加到项目中软件包管理器控制台:PM> Install-Package ZeroProximity.Accordion
NuGet Package Manager UI
NuGet网站:https://www.nuget.org/packages/ZeroProximity.Accordion/
只需在XAML文件的顶部添加引用:
xmlns:controls="using:ZeroProximity.Controls"
然后您可以使用<controls:...
<controls:Accordion>...</controls:Accordion>
,
<controls:AccordionItem>...</controls:AccordionItem>
等。
这是一个让你入门的简单例子:
<controls:Accordion HorizontalAlignment="Stretch" SelectionMode="ZeroOrOne">
<controls:AccordionItem Header="IPL Teams" FontSize="35">
<controls:AccordionItem.Content>
<StackPanel>
<TextBlock Text="India"></TextBlock>
<TextBlock Text="Australia"></TextBlock>
<TextBlock Text="Bangladesh"></TextBlock>
<TextBlock Text="Pakistan"></TextBlock>
</StackPanel>
</controls:AccordionItem.Content>
</controls:AccordionItem>
<controls:AccordionItem Header="IPL Teams" FontSize="35">
<controls:AccordionItem.Content>
<StackPanel>
<TextBlock Text="India" ></TextBlock>
<TextBlock Text="Australia"></TextBlock>
<TextBlock Text="Bangladesh"></TextBlock>
<TextBlock Text="Pakistan"></TextBlock>
</StackPanel>
</controls:AccordionItem.Content>
</controls:AccordionItem>
</controls:Accordion>
*截至编辑时(2016年12月1日),未找到有关此套餐的官方文档或网站。