/// <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();
     }
 }
Exemplo n.º 2
0
        /// <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)
        {
            vm.MazeName = UserControl.TxtMazeName;
            vm.Rows     = UserControl.TxtRows;
            vm.Cols     = UserControl.TxtCols;

            //creating the waiting window.
            WaitingWindow ww = new WaitingWindow();

            ww.Show();
            this.Close();

            MultiPlayerView sp = new MultiPlayerView(vm);

            sp.Show();
            sp.Hide();
            vm.Start(vm.MazeName, vm.Rows, vm.Cols);
            sp.Show();
            ww.Close();
        }