Browse Source

Fix #3705: Code window is empty when select a .baml and refresh

pull/3726/head
Christoph Wille 2 months ago committed by Siegfried Pammer
parent
commit
4c8e606a6a
  1. 19
      ILSpy/AssemblyTree/AssemblyTreeModel.cs

19
ILSpy/AssemblyTree/AssemblyTreeModel.cs

@ -946,12 +946,31 @@ namespace ICSharpCode.ILSpy.AssemblyTree @@ -946,12 +946,31 @@ namespace ICSharpCode.ILSpy.AssemblyTree
}
private void RefreshInternal()
{
_ = RefreshInternalAsync();
}
private async Task RefreshInternalAsync()
{
using (Keyboard.FocusedElement.PreserveFocus())
{
var path = GetPathForNode(SelectedItem);
ShowAssemblyList(settingsService.AssemblyListManager.LoadList(AssemblyList.ListName));
// Ensure assembly loaded before FindNodeByPath to allow lazy-loaded resource nodes to be found
if (path?.Length > 0)
{
foreach (var asm in AssemblyList.GetAssemblies())
{
if (asm.FileName == path[0])
{
await asm.GetMetadataFileAsync().Catch<Exception>(_ => { });
break;
}
}
}
SelectNode(FindNodeByPath(path, true), inNewTabPage: false);
RefreshDecompiledView();

Loading…
Cancel
Save