protected override void OnDeactivate(bool close)
 {
     base.OnDeactivate(close);
     DiagramLegend.DeactivateWith(this);
 }
 protected override void OnActivate()
 {
     base.OnActivate();
     DiagramLegend.ActivateWith(this);
 }