/// <summary>
 /// Handles the Click event of the btnStart control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void btnStart_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         vm.Start();
         Window multiMaze = new MultiMaze(vm);
         multiMaze.Show();
         this.Hide();
     } catch (Exception)
     {
         MessageBox.Show("Connection error");
         this.Close();
         MainWindow win = (MainWindow)Application.Current.MainWindow;
         win.Show();
     }
 }
 /// <summary>
 /// Handles the Click event of the btnJoin control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void btnJoin_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Object selectedItem = txtGameName.SelectedItem;
         vm.Join(selectedItem.ToString());
         Window multiMaze = new MultiMaze(vm);
         multiMaze.Show();
         this.Hide();
     } catch (Exception)
     {
         MessageBox.Show("Connection error");
         this.Close();
         MainWindow win = (MainWindow)Application.Current.MainWindow;
         win.Show();
     }
 }
Esempio n. 3
0
        private void btnStart_Click(object sender, RoutedEventArgs e)
        {
            Window multiMaze = new MultiMaze();

            multiMaze.Show();
        }