I have an object with two lists of child objects within. I want to show the content of object in the page and the two lists to be displayed in RadPanelBar controls so that I can see the content of the object and the lists to be collapsible sections and each item in the collapsible section should show relevant child objects' contents with probably the title of the child object as item header.
My object structure is as below.
My XAML has the below code.
<StackPanel Orientation="Vertical" Grid.Row="18" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0,10,10,0">
<!--Chart Series Configuratin Section Start-->
<telerik:RadPanelBar ItemsSource="{Binding Path=Series}" DataContext="{Binding}" telerik:StyleManager.Theme="Vista">
<telerik:RadPanelBar.Resources>
<DataTemplate x:Key="seriesTemplate">
<Views:SeriesView DataContext="{Binding}" VerticalAlignment="Top" Grid.ColumnSpan="2" />
</DataTemplate>
</telerik:RadPanelBar.Resources>
<telerik:RadPanelBar.ItemTemplate>
<telerik:HierarchicalDataTemplate ItemsSource="{Binding Converter={StaticResource collectionConverter}}" ItemTemplate="{StaticResource seriesTemplate}">
<TextBlock Text="{Binding Path=SeriesName, Mode=TwoWay}" Margin="5 3"/>
</telerik:HierarchicalDataTemplate>
</telerik:RadPanelBar.ItemTemplate>
</telerik:RadPanelBar>
<!--Chart Series Configuration Section End-->
</StackPanel>
<StackPanel Orientation="Vertical" Grid.Row="19" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0,10,10,0">
<!--Chart Zone Configuratin Section Start-->
<telerik:RadPanelBar ItemsSource="{Binding Path=Zones}" DataContext="{Binding}" telerik:StyleManager.Theme="Vista">
<telerik:RadPanelBar.Resources>
<DataTemplate x:Key="zoneTemplate">
<Views:ZoneView DataContext="{Binding}" VerticalAlignment="Top" Grid.ColumnSpan="2" />
</DataTemplate>
</telerik:RadPanelBar.Resources>
<telerik:RadPanelBar.ItemTemplate>
<telerik:HierarchicalDataTemplate ItemsSource="{Binding Converter={StaticResource collectionConverter}}" ItemTemplate="{StaticResource zoneTemplate}">
<TextBlock Text="{Binding Path=ZoneName, Mode=TwoWay}" Margin="5 3"/>
</telerik:HierarchicalDataTemplate>
</telerik:RadPanelBar.ItemTemplate>
</telerik:RadPanelBar>
<!--Chart Zone Configuration Section End-->
</StackPanel>
Without the
collectionConverter, It would render the RadPanelBar section headers but would not generate the content of the RadPanelBarItem. Is there any other way to generate the desired output without using the converter. Is there any other control which would generate the similar output. My CollectionConverter is as shown below.