diff --git a/ILSpy/ViewModels/TabPageModel.cs b/ILSpy/ViewModels/TabPageModel.cs index 691d7d28c..20e4bfb67 100644 --- a/ILSpy/ViewModels/TabPageModel.cs +++ b/ILSpy/ViewModels/TabPageModel.cs @@ -86,8 +86,19 @@ namespace ICSharpCode.ILSpy.ViewModels textView = new DecompilerTextView(); tabPage.Content = textView; } + string oldTitle = tabPage.Title; tabPage.Title = Properties.Resources.Decompiling; - return action(textView); + try + { + return action(textView); + } + finally + { + if (tabPage.Title == Properties.Resources.Decompiling) + { + tabPage.Title = oldTitle; + } + } } public static void ShowTextView(this TabPageModel tabPage, Action action) @@ -97,8 +108,13 @@ namespace ICSharpCode.ILSpy.ViewModels textView = new DecompilerTextView(); tabPage.Content = textView; } + string oldTitle = tabPage.Title; tabPage.Title = Properties.Resources.Decompiling; action(textView); + if (tabPage.Title == Properties.Resources.Decompiling) + { + tabPage.Title = oldTitle; + } } public static void Focus(this TabPageModel tabPage)