Replies: 1 comment 3 replies
-
I think that your proposed solution would be viable, my question would be how you decide when to insert a separator and when not to insert one. If your collection contains "separator" items that have no data but only serve as separation, then a DataTemplateSelector would make this quite easy I think. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello -
In a WinUI3 desktop app I'm working on, I've been trying to get a separator line to show up in a NavigationView. If I create the NV statically by explicitly adding NavigationViewItems into NavigationView, while inserting a NavigationViewItemSelector after one of the items, the selector line will show up.
However, if the NavigationViewItems are created dynamically through an ObserverCollection, I have not found a way to get the separator line to show up. The only sample code I've found in WinUI-Gallery where a NavigationViewItemSeparator is inserted into a NavigationViewItem list are for explicit (non-observer) lists.
I suspect that what I want to do can only be accomplished by incorporating the NavigationViewItemSeparator into a NavigationViewItem DataTemplate. However, I may be overcomplicating things and just don't know if there is a more straightforward way to get the separator to appear.
Would appreciate any pointers on this. Please let me know if I need to supply any more info to answer the question.
Thanks very much.
Robert Cohn
Beta Was this translation helpful? Give feedback.
All reactions