You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
3.4 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <UserControl x:Class="ICSharpCode.ILSpy.Controls.ResourceObjectTable"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:properties="clr-namespace:ICSharpCode.ILSpy.Properties"
  6. xmlns:local="clr-namespace:ICSharpCode.ILSpy.Controls"
  7. Cursor="Arrow">
  8. <UserControl.CommandBindings>
  9. <CommandBinding Command="ApplicationCommands.Copy"
  10. Executed="ExecuteCopy"
  11. CanExecute="CanExecuteCopy" />
  12. </UserControl.CommandBindings>
  13. <Grid Margin="5,0,0,0">
  14. <Grid.Resources>
  15. <AlternationConverter x:Key="BackgroundConverter">
  16. <SolidColorBrush Color="Transparent" />
  17. <SolidColorBrush Color="#CCCC33" Opacity="0.15" />
  18. </AlternationConverter>
  19. <Style x:Key="alternatingWithBinding"
  20. TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource {x:Type ListViewItem}}">
  21. <Setter Property="Background"
  22. Value="{Binding RelativeSource={RelativeSource Self},
  23. Path=(ItemsControl.AlternationIndex),
  24. Converter={StaticResource BackgroundConverter}}" />
  25. <Setter Property="ContextMenu">
  26. <Setter.Value>
  27. <ContextMenu>
  28. <MenuItem Header="_Copy" Command="ApplicationCommands.Copy" />
  29. <MenuItem Header="Copy _name" Command="ApplicationCommands.Copy" CommandParameter="Key" InputGestureText=" " />
  30. <MenuItem Header="Copy _value" Command="ApplicationCommands.Copy" CommandParameter="Value" InputGestureText=" " />
  31. <MenuItem Header="Copy _type" Command="ApplicationCommands.Copy" CommandParameter="Type" InputGestureText=" " />
  32. </ContextMenu>
  33. </Setter.Value>
  34. </Setter>
  35. </Style>
  36. </Grid.Resources>
  37. <Grid.RowDefinitions>
  38. <RowDefinition />
  39. <RowDefinition />
  40. <RowDefinition />
  41. </Grid.RowDefinitions>
  42. <Label Content="{x:Static properties:Resources.OtherResources}"
  43. FontFamily="Segoe UI"
  44. FontWeight="Bold"
  45. FontSize="12pt" />
  46. <local:SearchBox x:Name="resourceFilterBox"
  47. FontFamily="Segoe UI"
  48. FontSize="9pt"
  49. Grid.Row="1"
  50. TextChanged="OnFilterTextChanged" />
  51. <ListView Name="resourceListView"
  52. FontFamily="Segoe UI"
  53. FontSize="9pt"
  54. Foreground="Black"
  55. Grid.Row="2"
  56. AlternationCount="2"
  57. ItemContainerStyle="{StaticResource alternatingWithBinding}"
  58. local:SortableGridViewColumn.SortMode="Automatic">
  59. <ListView.View>
  60. <GridView AllowsColumnReorder="False">
  61. <GridView.Columns>
  62. <local:SortableGridViewColumn DisplayMemberBinding="{Binding Key}" SortBy="Key">
  63. <GridViewColumnHeader Content="{x:Static properties:Resources.Name}"
  64. HorizontalContentAlignment="Left"
  65. FontWeight="Bold" />
  66. </local:SortableGridViewColumn>
  67. <local:SortableGridViewColumn DisplayMemberBinding="{Binding Value}" SortBy="Value">
  68. <GridViewColumnHeader Content="{x:Static properties:Resources.ValueString}"
  69. HorizontalContentAlignment="Left"
  70. FontWeight="Bold" />
  71. </local:SortableGridViewColumn>
  72. <local:SortableGridViewColumn DisplayMemberBinding="{Binding Type}" SortBy="Type">
  73. <GridViewColumnHeader Content="{x:Static properties:Resources.Type}"
  74. HorizontalContentAlignment="Left"
  75. FontWeight="Bold" />
  76. </local:SortableGridViewColumn>
  77. </GridView.Columns>
  78. </GridView>
  79. </ListView.View>
  80. </ListView>
  81. </Grid>
  82. </UserControl>