private void btnCreateMaze_Click(object sender, RoutedEventArgs e)
 {
     mazeDesigner         = new MazeCreator();
     mazeDesigner.Closed += (s, ev) => {
         mazes = mazeRepo.GetIDNameDictionary();
         listBoxMazes.ItemsSource   = mazes;
         listBoxMazes.SelectedIndex = 0;
         ControlButtonVisible();
         this.Visibility = Visibility.Visible;
     };
     mazeDesigner.Show();
     this.Visibility = System.Windows.Visibility.Hidden;
 }
        private void btnEditMaze_Click(object sender, RoutedEventArgs e)
        {
            var value = listBoxMazes.SelectedValue.ToString();
            int Id    = Int32.Parse(value);

            mazeDesigner         = new MazeCreator(Id);
            mazeDesigner.Closed += (s, ev) => {
                mazes = mazeRepo.GetIDNameDictionary();
                listBoxMazes.ItemsSource   = mazes;
                listBoxMazes.SelectedIndex = 0;
                ControlButtonVisible();
                this.Visibility = Visibility.Visible;
            };
            mazeDesigner.Show();
            this.Visibility = System.Windows.Visibility.Hidden;
        }