This example binds the WPF Accordion Control to data (MyData.Categories
) and uses System.Windows.HierarchicalDataTemplate to present accordion items.
<dxa:AccordionControl x:Name="accordion" SelectionUnit="SubItem"
ItemsSource="{Binding MyData.Categories }" SelectedItem="{Binding SelectedItem}">
<dxa:AccordionControl.ItemTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:Category}" ItemsSource="{Binding Items}">
<TextBlock Text="{Binding CategoryName}"/>
<HierarchicalDataTemplate.ItemTemplate>
<DataTemplate DataType="{x:Type local:Item}">
<TextBlock Text="{Binding ItemName}"/>
</DataTemplate>
</HierarchicalDataTemplate.ItemTemplate>
</HierarchicalDataTemplate>
</dxa:AccordionControl.ItemTemplate>
</dxa:AccordionControl>
- MainWindow.xaml (VB: MainWindow.xaml)
- ViewModel.cs (VB: ViewModel.vb)
(you will be redirected to DevExpress.com to submit your response)