I'd like to have two top-level TreeView items, which are not related to bindings. Simple hard coded top-level items. However, those items will have children. And those children will be from my VM.
Something like this:
However, this doesn't seem to be allowed. How can I accomplish this? Essentially, my VM has two collections of stuff, and I want to show both in a single tree view, but without introducing a bunch of stuff into my view model.
Something like this:
<
telerik:RadTreeViewItem
ItemsSource
=
"{Binding DataContext.Documents, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadTreeView}}}"
>
<
TextBlock
Text
=
"Documents"
/>
</
telerik:RadTreeViewItem
>
<
telerik:RadTreeViewItem
ItemsSource
=
"{Binding DataContext.Pages, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadTreeView}}}"
>
<
TextBlock
Text
=
"Excluded Pages"
/>
</
telerik:RadTreeViewItem
>
However, this doesn't seem to be allowed. How can I accomplish this? Essentially, my VM has two collections of stuff, and I want to show both in a single tree view, but without introducing a bunch of stuff into my view model.