SystemMenuTree.xaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <UserControl x:Class="Muchinfo.MTPClient.UI.Views.SystemMenuTree"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:converters="clr-namespace:Muchinfo.MTPClient.Infrastructure.Converters;assembly=Client.Infrastructure"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:data="clr-namespace:Muchinfo.MTPClient.Data;assembly=Client.Data"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. mc:Ignorable="d">
  9. <UserControl.Resources>
  10. <converters:BoolOpposedVisibility x:Key="BoolOpposedVisibility" />
  11. <HierarchicalDataTemplate x:Key="TreeDataTemplate"
  12. DataType="{x:Type data:SysMenuItem}"
  13. ItemsSource="{Binding Children}">
  14. <!--
  15. <Grid>
  16. <Rectangle HorizontalAlignment="Stretch"
  17. VerticalAlignment="Stretch"
  18. Fill="{DynamicResource DisEnableBrush}"
  19. Stretch="Fill"
  20. Visibility="{Binding IsEnabled,
  21. Converter={StaticResource BoolOpposedVisibility}}" />
  22. -->
  23. <TextBlock Text="{Binding Title}" />
  24. <!-- </Grid> -->
  25. <!--
  26. <HierarchicalDataTemplate.ItemContainerStyle>
  27. <Style TargetType="{x:Type TreeViewItem}">
  28. <Setter Property="IsSelected" Value="{Binding IsSelected}" />
  29. </Style>
  30. </HierarchicalDataTemplate.ItemContainerStyle>
  31. -->
  32. </HierarchicalDataTemplate>
  33. </UserControl.Resources>
  34. <UserControl.DataContext>
  35. <Binding Path="MenuTree" Source="{StaticResource Locator}" />
  36. </UserControl.DataContext>
  37. <Grid Background="{DynamicResource TreeBackground}">
  38. <Border MinWidth="150"
  39. BorderBrush="{DynamicResource TreeBorderBrush}"
  40. BorderThickness="0,0,1,0">
  41. <TreeView x:Name="FunctionTreeView"
  42. Margin="10,0,0,0"
  43. Background="{DynamicResource TreeBackground}"
  44. BorderBrush="Transparent"
  45. BorderThickness="0"
  46. FontSize="{DynamicResource MuchinfoFontSize_S}"
  47. Foreground="{DynamicResource TreeForeground}"
  48. ItemContainerStyle="{DynamicResource LineTreeViewItem}"
  49. ItemTemplate="{DynamicResource TreeDataTemplate}"
  50. ItemsSource="{Binding MenuSource}"
  51. MouseLeftButtonUp="TreeView_OnMouseLeftButtonUp">
  52. <!--
  53. <TreeViewItem IsExpanded="True" Style="{DynamicResource TreeViewItemHiddenStyle}"
  54. ItemsSource="{Binding MenuSource}"></TreeViewItem>
  55. -->
  56. </TreeView>
  57. </Border>
  58. </Grid>
  59. </UserControl>