I'm trying to bind my NavBarControl to my ViewModel with a IList. I've found the documentation for a DataTable, but I don't want to use a DataTable and I can't find anything on List/Collection.
My problem is that I can't get any of the NavBarItems to populate under the groups. Not sure if I'm not binding it right or I need to change my IList.
<dxn:NavBarControl HorizontalAlignment="Left" Name="navBarControl1" VerticalAlignment="Top" Height="300" Width="300"
ItemsSource="{Binding Path=NavigationBarContent}" GroupDescription="DisplayName">
<dxn:NavBarControl.Resources>
<Style TargetType="{x:Type dxn:NavBarGroup}">
<Setter Property="Header" Value="{Binding}"/>
</Style>
<Style TargetType="{x:Type dxn:NavBarItem}">
<Setter Property="Content" Value="{Binding}"/><!--Didn't know what to put here, so it just binds the groups name-->
</Style>
</dxn:NavBarControl.Resources>
</dxn:NavBarControl>
We have closed this ticket because another page addresses its subject:
Looking for NavBarItem binding exampleThe example that demonstrates NavBarControl within the MVVM pattern (E3541) does not work properly
Answers
Hello Brian,
Thank you for the update. I have reproduced the problem you reported. It looks like a bug in NavBarControl. I have converted this issue to a bug report. We will fix it as soon as possible. Please accept our apologies for the inconvenience.
To resolve this problem immediately, I have created a different solution for you, which contains special cross-platform attached behavior. This solution operates fine.
Thanks,
Alexander.
Hello Brian,
Thank you for the question. We have a code example regarding your question. Please take a look at it: How to generate groups and items via ItemsSource. Let me know if you need any additional assistance.
Thanks,
Alexander.
Hello Alexander,
That example helps, but I've got one question about it. Why does it populate one more additional navbaritem for each group?
Group 0
-Group 0, Header 0
-Group 0, Header 1
…
-Group 0, Header 8
-Group 0, Header 9
-Group 0 //Why does it add this navbaritem?