private void Button_Click(object sender, RoutedEventArgs e)
 {
     bdEditorWindow = new BDEditorWindow();
     bdEditorWindow.Show();
 }
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (MessageBox.Show("Закрыть ?","Вопрос",MessageBoxButton.YesNo)==MessageBoxResult.Yes)
            {
                try
                {
                    bdEditorWindow.Close();
                    bdEditorWindow = null;
                    myThrArchive = null;
                }
                catch
                {
                    
                }
                try
                {
                    archiveWindow.Dispatcher.Invoke(delegate
                    {
                        archiveWindow.Close();
                        archiveWindow = null;
                    });
                }
                catch
                {

                }
                var ps = Settings.Default;
                ps.Top = Top;
                ps.Left = Left;
                ps.Save();
            }
            else
            {
                e.Cancel = true;
            }
        }