Skip to content

Commit 80722b7

Browse files
Address PR feedback and fix missing property
- Removed immediate unloading of AssemblyLoadContext for External Applications to avoid crashes when applications register persistent UI or events. - Added missing SelectedTab property to AddInManagerViewModel to fix binding warning in XAML. Co-authored-by: chuongmep <31106432+chuongmep@users.noreply.github.com>
1 parent 5a7b4e2 commit 80722b7

2 files changed

Lines changed: 8 additions & 17 deletions

File tree

AddInManager/Command/AddinManagerBase.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -196,23 +196,6 @@ public Result RunActiveApp(UIControlledApplication application)
196196
{
197197
MessageBox.Show(ex.ToString());
198198
}
199-
finally
200-
{
201-
alc.Unload();
202-
203-
var alcWeakRef = new WeakReference(alc, trackResurrection: true);
204-
205-
Dispatcher.CurrentDispatcher.BeginInvoke(() =>
206-
{
207-
for (var counter = 0; alcWeakRef.IsAlive && counter < 10; counter++)
208-
{
209-
GC.Collect();
210-
GC.WaitForPendingFinalizers();
211-
}
212-
213-
Debug.WriteLine(alcWeakRef.IsAlive ? "Assembly has not been unloaded properly" : "Assembly unloaded");
214-
});
215-
}
216199
return result;
217200
}
218201

AddInManager/ViewModel/AddInManagerViewModel.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,14 @@ public bool IsTabStartSelected
231231
set => OnPropertyChanged(ref isTabStartSelected, value);
232232
}
233233

234+
private int selectedTab;
235+
236+
public int SelectedTab
237+
{
238+
get => selectedTab;
239+
set => OnPropertyChanged(ref selectedTab, value);
240+
}
241+
234242
private bool isTabLogSelected;
235243

236244
public bool IsTabLogSelected

0 commit comments

Comments
 (0)