/// <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 { vm.GameSelected = GameList.SelectedIndex; } catch (Exception exception) { MessageBox.Show(this, "please choose game", "choose game"); return; } MultiPlayerView sp = new MultiPlayerView(vm); sp.Show(); this.Close(); vm.Join(vm.MazeName); }
/// <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(); }