Skip to content

Commit e574bc2

Browse files
Add ExpandAllCommand
1 parent 0af4564 commit e574bc2

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

ILSpy/ViewModels/CompareViewModel.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public CompareViewModel(TabPageModel tabPage, AssemblyTreeModel assemblyTreeMode
6868
this.root = new ComparisonEntryTreeNode(MergeTrees(leftTree.Item2, rightTree.Item2), this);
6969

7070
this.SwapAssembliesCommand = new DelegateCommand(OnSwapAssemblies);
71+
this.ExpandAllCommand = new DelegateCommand(OnExpandAll);
7172

7273
this.PropertyChanged += CompareViewModel_PropertyChanged;
7374
}
@@ -150,6 +151,7 @@ public bool ShowIdentical {
150151
}
151152

152153
public ICommand SwapAssembliesCommand { get; set; }
154+
public ICommand ExpandAllCommand { get; set; }
153155

154156
void OnSwapAssemblies()
155157
{
@@ -160,6 +162,14 @@ void OnSwapAssemblies()
160162
OnPropertyChanged(nameof(RightAssembly));
161163
}
162164

165+
public void OnExpandAll()
166+
{
167+
foreach (var node in RootEntry.DescendantsAndSelf())
168+
{
169+
node.IsExpanded = true;
170+
}
171+
}
172+
163173
Entry MergeTrees(Entry a, Entry b)
164174
{
165175
var m = new Entry() {

ILSpy/Views/CompareView.xaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@
1313
<RowDefinition Height="*" />
1414
</Grid.RowDefinitions>
1515
<ToolBar>
16-
<Label Content="Left:" />
17-
<TextBlock VerticalAlignment="Center" Text="{Binding LeftAssembly.Text}" />
18-
<Label Content="Right:" />
19-
<TextBlock VerticalAlignment="Center" Text="{Binding RightAssembly.Text}" />
2016
<Button Content="Swap" Command="{Binding SwapAssembliesCommand}" />
2117
<ToggleButton Content="Show identical" IsChecked="{Binding ShowIdentical}" />
18+
<Button Content="Expand all" Command="{Binding ExpandAllCommand}" />
2219
</ToolBar>
2320
<stv:SharpTreeView Grid.Row="1" Root="{Binding RootEntry}" ShowRoot="True">
2421
<stv:SharpTreeView.ItemContainerStyle>

0 commit comments

Comments
 (0)