8,735
社区成员
发帖
与我相关
我的任务
分享
<UserControl x:Class="ProjectExtension.Presentation.Controls.TreeControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProjectExtension"
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<UserControl.Resources>
<local:EntityCollectionValueConverter x:Key="EntityCollectionValueConverter" />
<sdk:HierarchicalDataTemplate x:Key="HTemplate"
ItemsSource="{Binding Converter={StaticResource EntityCollectionValueConverter}, ConverterParameter=Categories}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=CategoryName, Mode=TwoWay}"
Margin="5,0" Width="74" />
</StackPanel>
</sdk:HierarchicalDataTemplate>
</UserControl.Resources>
<Grid DataContext="{Binding Value}" x:Name="LayoutRoot" Background="White">
<StackPanel Orientation="Horizontal">
<sdk:TreeView Name="treeViewControl" ItemsSource="{Binding}" SelectedItemChanged="treeViewControl_SelectedItemChanged" ItemTemplate="{StaticResource HTemplate}">
</sdk:TreeView>
</StackPanel>
</Grid></UserControl>