mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
Fixes #3251: Decompiler Settings: Checkbox in group header does not reflect state of the grouppull/3265/head
4 changed files with 106 additions and 150 deletions
@ -1,63 +1,38 @@
@@ -1,63 +1,38 @@
|
||||
<UserControl x:Class="ICSharpCode.ILSpy.Options.DecompilerSettingsPanel" |
||||
x:ClassModifier="internal" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:properties="clr-namespace:ICSharpCode.ILSpy.Properties" |
||||
xmlns:toms="urn:TomsToolbox"> |
||||
<UserControl.Resources> |
||||
<CollectionViewSource x:Key="SettingsCollection" Source="{Binding Settings}"> |
||||
<CollectionViewSource.GroupDescriptions> |
||||
<PropertyGroupDescription PropertyName="Category" /> |
||||
</CollectionViewSource.GroupDescriptions> |
||||
</CollectionViewSource> |
||||
</UserControl.Resources> |
||||
<Grid> |
||||
<Grid.RowDefinitions> |
||||
<RowDefinition Height="Auto" /> |
||||
<RowDefinition Height="*" /> |
||||
</Grid.RowDefinitions> |
||||
<Grid.ColumnDefinitions> |
||||
<ColumnDefinition Width="*" /> |
||||
</Grid.ColumnDefinitions> |
||||
<TextBlock Margin="3" Grid.ColumnSpan="3" TextWrapping="Wrap" Text="{x:Static properties:Resources.DecompilerSettingsPanelLongText}" /> |
||||
<ListBox Grid.Row="1" ItemsSource="{Binding Source={StaticResource SettingsCollection}}"> |
||||
<ListBox.ItemContainerStyle> |
||||
<Style TargetType="ListBoxItem"> |
||||
<Setter Property="IsTabStop" Value="False"/> |
||||
<Setter Property="Focusable" Value="False"/> |
||||
</Style> |
||||
</ListBox.ItemContainerStyle> |
||||
<ListBox.GroupStyle> |
||||
<GroupStyle> |
||||
<GroupStyle.Panel> |
||||
<ItemsPanelTemplate> |
||||
<VirtualizingStackPanel Orientation="Vertical" /> |
||||
</ItemsPanelTemplate> |
||||
</GroupStyle.Panel> |
||||
<GroupStyle.ContainerStyle> |
||||
<Style TargetType="{x:Type GroupItem}" BasedOn="{StaticResource {x:Type GroupItem}}"> |
||||
<Setter Property="Template"> |
||||
<Setter.Value> |
||||
<ControlTemplate> |
||||
<Expander Padding="0" BorderThickness="0" IsExpanded="True"> |
||||
<Expander.Header> |
||||
<CheckBox Checked="OnGroupChecked" Unchecked="OnGroupUnchecked" Loaded="OnGroupLoaded" VerticalContentAlignment="Center" |
||||
FontSize="16" FontWeight="Bold" Content="{Binding Name}" /> |
||||
</Expander.Header> |
||||
<ItemsPresenter/> |
||||
</Expander> |
||||
</ControlTemplate> |
||||
</Setter.Value> |
||||
</Setter> |
||||
</Style> |
||||
</GroupStyle.ContainerStyle> |
||||
</GroupStyle> |
||||
</ListBox.GroupStyle> |
||||
<ListBox.ItemTemplate> |
||||
<DataTemplate> |
||||
<CheckBox Margin="19,0,0,0" IsChecked="{Binding IsEnabled}" Content="{Binding Description}" /> |
||||
</DataTemplate> |
||||
</ListBox.ItemTemplate> |
||||
</ListBox> |
||||
</Grid> |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:properties="clr-namespace:ICSharpCode.ILSpy.Properties" |
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" |
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
||||
xmlns:options="clr-namespace:ICSharpCode.ILSpy.Options" |
||||
d:DataContext="{d:DesignInstance options:DecompilerSettingsViewModel}"> |
||||
<DockPanel> |
||||
<TextBlock Margin="3" DockPanel.Dock="Top" TextWrapping="Wrap" Text="{x:Static properties:Resources.DecompilerSettingsPanelLongText}" /> |
||||
<ScrollViewer> |
||||
<ItemsControl ItemsSource="{Binding Settings}"> |
||||
<ItemsControl.ItemTemplate> |
||||
<DataTemplate> |
||||
<Grid> |
||||
<Expander Padding="0" BorderThickness="0" IsExpanded="True"> |
||||
<Expander.Header> |
||||
<CheckBox VerticalContentAlignment="Center" |
||||
FontSize="16" FontWeight="Bold" |
||||
Content="{Binding Category}" |
||||
IsChecked="{Binding AreAllItemsChecked, Mode=TwoWay}"/> |
||||
</Expander.Header> |
||||
<ItemsControl ItemsSource="{Binding Settings}"> |
||||
<ItemsControl.ItemTemplate> |
||||
<DataTemplate> |
||||
<CheckBox Margin="28,0,0,0" IsChecked="{Binding IsEnabled}" Content="{Binding Description}" /> |
||||
</DataTemplate> |
||||
</ItemsControl.ItemTemplate> |
||||
</ItemsControl> |
||||
</Expander> |
||||
</Grid> |
||||
</DataTemplate> |
||||
</ItemsControl.ItemTemplate> |
||||
</ItemsControl> |
||||
</ScrollViewer> |
||||
</DockPanel> |
||||
</UserControl> |
||||
Loading…
Reference in new issue