1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| <UserControl.Resources>
<!-- TEMPLATE TREEVIEW -->
<HierarchicalDataTemplate x:Key="folderTemplate" DataType="{x:Type ctrl:RubriqueItem}" ItemsSource="{Binding Path=SousRubriques}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path=Nom}" Foreground="DarkBlue" Margin="20,2,0,2" FontFamily="Verdana" Focusable="True" FontSize="13" HorizontalAlignment="Left" Style="{DynamicResource TBCTemplate}" />
</StackPanel>
</HierarchicalDataTemplate>
<Style x:Key="TBCTemplate" TargetType="{x:Type TextBlock}">
<Setter Property="Control.FontSize" Value="13" />
<Style.Triggers>
<Trigger Property="Control.IsMouseOver" Value="True">
<Setter Property="Control.FontWeight" Value="Bold" />
</Trigger>
<Trigger Property="Control.IsEnabled" Value="False">
<Setter Property="Control.Foreground" Value="Gray" />
</Trigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
<Grid>
<TreeView BorderThickness="0,0,0,0" x:Name="TreeViewMenu" ItemsSource="{Binding}" ItemTemplate="{StaticResource folderTemplate}" Background="Transparent" />
</Grid> |
Partager