When a StepTabPanel is Disposed, if it is associated with the SelectedDisplayTabItem, set the SelectedDisplayTabItem to null. This was causing an error where a deleted Procedure was the last SelectedDisplayTabItem. When anything was opened, the code tried to find the MyProcedure of the last SelectedDisplayTabItem. Since the last one had been deleted, it had no MyProcedure.
This commit is contained in:
parent
7a5b48e645
commit
6618b1f51e
@ -13,6 +13,10 @@ namespace Volian.Controls.Library
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
// when a StepTabPanel is Disposed, if it was associated with the SelectedDisplayTabItem, set the SelectedDisplayTabItem to null
|
||||
// this was causing an error where a deleted Procedure was being referenced, since it was the last SelectedDisplayTabItem
|
||||
if (MyDisplayTabControl.SelectedDisplayTabItem != null && MyDisplayTabControl.SelectedDisplayTabItem.MyStepTabPanel == this)
|
||||
MyDisplayTabControl.SelectedDisplayTabItem = null;
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
|
Loading…
x
Reference in New Issue
Block a user