12345678910111213141516171819202122232425262728293031323334 |
- <UserControl x:Class="FWindSoft.Wpf.Controls.TreeCategory"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:controls="clr-namespace:FWindSoft.Wpf.Controls"
- Name="this" Width="{Binding Width, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UIElement}}" Height="{Binding Height, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UIElement}}">
- <Grid>
- <TreeView x:Name="tree" Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.CanContentScroll="True">
- <TreeView.ItemContainerStyle>
- <Style TargetType="TreeViewItem">
- <Setter Property="IsExpanded" Value="{Binding IsExpanded,Mode=TwoWay}"></Setter>
- </Style>
- </TreeView.ItemContainerStyle>
- <TreeView.ItemTemplate>
- <HierarchicalDataTemplate ItemsSource="{Binding Path=Items}">
- <Border>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"></ColumnDefinition>
- <ColumnDefinition></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <CheckBox
- FontSize="14"
- FontFamily="微软雅黑"
- Tag="{Binding}"
- IsChecked="{Binding Path=IsChecked,Mode=TwoWay}" VerticalAlignment="Center" Command="controls:TreeCategory.SelectCommand" CommandParameter="{Binding}"></CheckBox>
- <TextBlock Grid.Column="1" Text="{Binding Path=Display}"></TextBlock>
- </Grid>
- </Border>
-
- </HierarchicalDataTemplate>
- </TreeView.ItemTemplate>
- </TreeView>
- </Grid>
- </UserControl>
|