<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->
<UserControl
x:Class="System.Windows.Controls.Samples.AccordionUsage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:layoutToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
xmlns:layoutToolkitPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Layout.Toolkit">
<StackPanel>
<ContentControl
Content="Hardcoded items - text"
Style="{StaticResource Header}" />
<layoutToolkit:Accordion
HorizontalAlignment="Stretch">
<layoutToolkit:AccordionItem
Header="Hello"
Content="World" />
<layoutToolkit:AccordionItem
Header="foo"
Content="bar" />
<layoutToolkit:AccordionItem
Header="mini"
Content="me" />
</layoutToolkit:Accordion>
<ContentControl
Content="Hardcoded items - UI Elements"
Style="{StaticResource Header}" />
<layoutToolkit:Accordion
HorizontalAlignment="Stretch">
<layoutToolkit:AccordionItem>
<layoutToolkit:AccordionItem.Header>
<TextBlock
Text="Image" />
</layoutToolkit:AccordionItem.Header>
<layoutToolkit:AccordionItem.Content>
<Image
Source="/Silverlight.png" />
</layoutToolkit:AccordionItem.Content>
</layoutToolkit:AccordionItem >
<layoutToolkit:AccordionItem>
<layoutToolkit:AccordionItem.Header>
<TextBlock
Text="Button" />
</layoutToolkit:AccordionItem.Header>
<layoutToolkit:AccordionItem.Content>
<Button
Content="button as content"
Margin="10" />
</layoutToolkit:AccordionItem.Content>
</layoutToolkit:AccordionItem>
</layoutToolkit:Accordion>
<ContentControl
Content="Orientation left"
Style="{StaticResource Header}" />
<layoutToolkit:Accordion
ExpandDirection="Left"
Height="150">
<layoutToolkit:AccordionItem
Header="Hello"
Content="World" />
<layoutToolkit:AccordionItem
Header="foo"
Content="bar" />
<layoutToolkit:AccordionItem
Header="mini"
Content="me" />
</layoutToolkit:Accordion>
<ContentControl
Content="One item selected"
Style="{StaticResource Header}" />
<layoutToolkit:Accordion
HorizontalAlignment="Stretch">
<layoutToolkit:AccordionItem
Header="Hello"
Content="World" />
<layoutToolkit:AccordionItem
Header="foo"
Content="bar" />
<layoutToolkit:AccordionItem
Header="mini"
Content="me"
IsSelected="True" />
</layoutToolkit:Accordion>
<ContentControl
Content="Allowing multiple items"
Style="{StaticResource Header}" />
<layoutToolkit:Accordion
HorizontalAlignment="Stretch"
SelectionMode="ZeroOrMore">
<layoutToolkit:AccordionItem
Header="Hello"
Content="World"
IsSelected="True" />
<layoutToolkit:AccordionItem
Header="foo"
Content="bar"
IsSelected="True" />
<layoutToolkit:AccordionItem
Header="mini"
Content="me" />
</layoutToolkit:Accordion>
<ContentControl
Content="Require one open accordion"
Style="{StaticResource Header}" />
<layoutToolkit:Accordion
HorizontalAlignment="Stretch"
SelectionMode="OneOrMore">
<layoutToolkit:AccordionItem
Header="Hello"
Content="World"
IsSelected="True" />
<layoutToolkit:AccordionItem
Header="foo"
Content="bar" />
<layoutToolkit:AccordionItem
Header="mini"
Content="me" />
</layoutToolkit:Accordion>
<ContentControl
Content="Sequential animation"
Style="{StaticResource Header}" />
<layoutToolkit:Accordion
HorizontalAlignment="Stretch"
SelectionSequence="CollapseBeforeExpand">
<layoutToolkit:AccordionItem
Header="Hello"
Content="World" />
<layoutToolkit:AccordionItem
Header="foo"
Content="bar" />
<layoutToolkit:AccordionItem
Header="mini"
Content="me" />
</layoutToolkit:Accordion>
<ContentControl
Content="Generated content"
Style="{StaticResource Header}" />
<layoutToolkit:Accordion
HorizontalAlignment="Stretch"
x:Name="accordionGeneratedContent">
<layoutToolkit:Accordion.ContentTemplate>
<DataTemplate>
<TextBlock
Text="{Binding Key}" />
</DataTemplate>
</layoutToolkit:Accordion.ContentTemplate >
<layoutToolkit:Accordion.ItemTemplate>
<DataTemplate>
<TextBlock
Text="{Binding Value}" />
</DataTemplate>
</layoutToolkit:Accordion.ItemTemplate>
</layoutToolkit:Accordion>
<ContentControl
Content="Default header template"
Style="{StaticResource Header}" />
<layoutToolkit:Accordion
HorizontalAlignment="Stretch"
x:Name="accordionDefaultHeaderTemplate"
DisplayMemberPath="Value">
<layoutToolkit:Accordion.ContentTemplate>
<DataTemplate>
<TextBlock
Text="{Binding Key}" />
</DataTemplate>
</layoutToolkit:Accordion.ContentTemplate >
</layoutToolkit:Accordion>
<ContentControl
Content="Using selectionChanged event"
Style="{StaticResource Header}" />
<layoutToolkit:Accordion
HorizontalAlignment="Stretch"
SelectionMode="ZeroOrMore"
SelectionChanged="Accordion_SelectionChanged">
<layoutToolkit:AccordionItem
Header="Hello"
Content="World"
IsSelected="True" />
<layoutToolkit:AccordionItem
Header="foo"
Content="bar"
IsSelected="True" />
<layoutToolkit:AccordionItem
Header="mini"
Content="me" />
</layoutToolkit:Accordion>
<ContentControl
Content="Expanding/collapsing an entire accordion"
Style="{StaticResource Header}" />
<layoutToolkit:Accordion
HorizontalAlignment="Stretch"
x:Name="accordionExpandCollapse"
SelectionMode="ZeroOrMore">
<layoutToolkit:AccordionItem
Header="Hello"
Content="World" />
<layoutToolkit:AccordionItem
Header="foo"
Content="bar" />
<layoutToolkit:AccordionItem
Header="mini"
Content="me" />
</layoutToolkit:Accordion>
<StackPanel
Orientation="Horizontal">
<Button
Click="ExpandAll_Click"
Content="Expand Accordion"
Margin="2" />
<Button
Click="CollapseAll_Click"
Content="Collapse Accordion"
Margin="2" />
</StackPanel>
<ContentControl
Content="Finding the currently selected clr types"
Style="{StaticResource Header}" />
<layoutToolkit:Accordion
HorizontalAlignment="Stretch"
x:Name="accordionCLRTypes"
SelectionMode="ZeroOrMore"
SelectedItemsChanged="CLRTypesSelectedItemsChanged">
<layoutToolkit:Accordion.ContentTemplate>
<DataTemplate>
<TextBlock
Text="{Binding Key}" />
</DataTemplate>
</layoutToolkit:Accordion.ContentTemplate>
<layoutToolkit:Accordion.ItemTemplate>
<DataTemplate>
<TextBlock
Text="{Binding Value}" />
</DataTemplate>
</lay