Files
serein-flow/WorkBench/Themes/LazyTreeView.xaml

27 lines
1.3 KiB
Plaintext
Raw Normal View History

<UserControl x:Class="Serein.WorkBench.Themes.LazyTreeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Themes"
xmlns:converters="clr-namespace:Serein.WorkBench.Tool.Converters"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<converters:TypeToColorConverter x:Key="TypeToColorConverter" />
</UserControl.Resources>
<Grid>
<TreeView Name="treeView"
SelectedItemChanged="treeView_SelectedItemChanged"
ItemsSource="{Binding RootNodes}">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding SuccessorNodes}">
<TextBlock Text="{Binding DisplayName}" Foreground="{Binding ControlType, Converter={StaticResource TypeToColorConverter}}" />
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
</Grid>
</UserControl>