Skip to content

Commit

Permalink
Clear lists of variables on close to prevent loading on closed windows
Browse files Browse the repository at this point in the history
  • Loading branch information
awulkiew committed Nov 20, 2023
1 parent 48fba16 commit d092b17
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 0 deletions.
6 changes: 6 additions & 0 deletions solution/GraphicalDebugging/GeometryWatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,11 @@ public GeometryWatch() : base(null)
// the object returned by the Content property.
this.Content = new GeometryWatchControl();
}

protected override void OnClose()
{
(this.Content as GeometryWatchControl).OnClose();
base.OnClose();
}
}
}
5 changes: 5 additions & 0 deletions solution/GraphicalDebugging/GeometryWatchControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -563,5 +563,10 @@ private void dataGridContextMenuDisable_Click(object sender, RoutedEventArgs e)
Util.EnableDataGridItems(dataGrid, Geometries,
(GeometryItem geometry) => geometry.IsEnabled = false);
}

public void OnClose()
{
Geometries.Clear();
}
}
}
6 changes: 6 additions & 0 deletions solution/GraphicalDebugging/GraphicalWatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,11 @@ public GraphicalWatch() : base(null)
// the object returned by the Content property.
this.Content = new GraphicalWatchControl();
}

protected override void OnClose()
{
(this.Content as GraphicalWatchControl).OnClose();
base.OnClose();
}
}
}
5 changes: 5 additions & 0 deletions solution/GraphicalDebugging/GraphicalWatchControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,5 +280,10 @@ private void dataGridContextMenuDelete_Click(object sender, RoutedEventArgs e)
(GraphicalItem variable) => { },
() => { });
}

public void OnClose()
{
Variables.Clear();
}
}
}
6 changes: 6 additions & 0 deletions solution/GraphicalDebugging/PlotWatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,11 @@ public PlotWatch() : base(null)
// the object returned by the Content property.
this.Content = new PlotWatchControl();
}

protected override void OnClose()
{
(this.Content as PlotWatchControl).OnClose();
base.OnClose();
}
}
}
5 changes: 5 additions & 0 deletions solution/GraphicalDebugging/PlotWatchControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -571,5 +571,10 @@ private void dataGridContextMenuDisable_Click(object sender, RoutedEventArgs e)
Util.EnableDataGridItems(dataGrid, Plots,
(PlotItem plot) => plot.IsEnabled = false);
}

public void OnClose()
{
Plots.Clear();
}
}
}

0 comments on commit d092b17

Please sign in to comment.