Hi
I'm trying to populate PanelBar with items (textboxes for instance), and I'm having problems setting up ItemTemplates.
My XAML looks like this:
My data structures look like this:
Finally, I have an observable collection called
The strange thing is, sections and their headers are displayed correctly, but items that should be inside them are nonexistent, I simply can't get them to display.
Could you provide a working example of this kind of menu, because I've tried all possible combination and I simply can't get it to work. Perhaps I'm doing something wrong, but I have no idea where to being looking.
Thank you
I'm trying to populate PanelBar with items (textboxes for instance), and I'm having problems setting up ItemTemplates.
My XAML looks like this:
<UserControl.Resources> |
<DataTemplate x:Key="ItemsTemplate"> |
<TextBlock Text="{Binding Text}" /> |
</DataTemplate> |
<Data:HierarchicalDataTemplate x:Key="SectionsTemplate" |
ItemTemplate="{StaticResource ItemsTemplate}" ItemsSource="{Binding MenuItems}"> |
<TextBlock Text="{Binding Header}" /> |
</Data:HierarchicalDataTemplate> |
</UserControl.Resources> |
<Grid> |
<telerikNavigation:RadPanelBar x:Name="panelBar" ItemsSource="{Binding Sections}" |
ItemTemplate="{StaticResource SectionsTemplate}" /> |
</Grid> |
My data structures look like this:
public class MenuItem |
{ |
public string Name { get; set; } |
public string Text { get; set; } |
public string IconPath { get; set; } |
public string ViewName { get; set; } |
} |
public class SectionItem |
{ |
public string Header { get; set; } |
public string ImagePath { get; set; } |
public ObservableCollection<MenuItem> MenuItems { get; set; } |
} |
Finally, I have an observable collection called
public ObservableCollection<SectionItem> Sections { get; set; } |
The strange thing is, sections and their headers are displayed correctly, but items that should be inside them are nonexistent, I simply can't get them to display.
Could you provide a working example of this kind of menu, because I've tried all possible combination and I simply can't get it to work. Perhaps I'm doing something wrong, but I have no idea where to being looking.
Thank you