private void DoneButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                RunButton.IsEnabled = false;

                // When the user is finished with the toolbar, revert to the configured toolbar.
                if (_mapWidget != null)
                {
                    _mapWidget.Map.MouseClick -= Map_MouseClick;
                    _mapWidget.SetToolbar(null);
                }
                int id  = -1;
                int id2 = -1;
                for (int i = 0; i < _mapWidget.Map.Layers.Count; i++)
                {
                    client.Layer player = _mapWidget.Map.Layers[i];

                    if (player.ID == "GroundCommunicationCoverageMap")
                    {
                        id = i;
                    }
                    if (player.ID == "GroundCommunicationGraphics")
                    {
                        id2 = i;
                    }
                }
                if (id != -1)
                {
                    _mapWidget.Map.Layers.RemoveAt(id);
                }

                if (id2 != -1)
                {
                    _mapWidget.Map.Layers.RemoveAt(id2 - 1);
                }

                if (_graphicsLayer != null)
                {
                    _graphicsLayer.Graphics.Clear();
                }

                if (pWin != null)
                {
                    pWin.Close();
                }

                if (_dtLegends != null)
                {
                    _dtLegends.Clear();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }
        }