|
<UserControl x:Class="TestTreeViewWithRightBarView.View.TreeViewControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:TestTreeViewWithRightBarView.ViewModel"
xmlns:local="clr-namespace:TestTreeViewWithRightBarView.View"
>
<Grid>
<TreeView ItemsSource="{Binding Path=TreeRootViewModel}">
<TreeView.Resources>
<HierarchicalDataTemplate
DataType="{x:Type vm:TreeRootViewModel}"
ItemsSource="{Binding Children}"
>
<local:TreeNodeControl />
</HierarchicalDataTemplate>
<HierarchicalDataTemplate
DataType="{x:Type vm:ContinentViewModel}"
ItemsSource="{Binding Children}"
>
<local:TreeNodeControl />
</HierarchicalDataTemplate>
<HierarchicalDataTemplate
DataType="{x:Type vm:CountryViewModel}"
ItemsSource="{Binding Children}"
>
<local:TreeNodeControl />
</HierarchicalDataTemplate>
<DataTemplate
DataType="{x:Type vm:CityViewModel}"
>
<local:TreeNodeControl />
</DataTemplate>
</TreeView.Resources>
</TreeView>
</Grid>
</UserControl>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.