private void btnNewMatch_Click(object sender, EventArgs e) { FormCreateMatch form = new FormCreateMatch(myServer.Players); if (form.ShowDialog() == DialogResult.OK) { UCMatch ucMatch = new UCMatch(form.GetMatch()); ucMatch.ButtonCloseClicked += UcMatch_ButtonCloseClicked; pnlContainer.Controls.Add(ucMatch); } }
private async void btnCreateMatch_Click(object sender, RoutedEventArgs e) { createMatch = await CreateMatch.CreateNewWindowAsync(myServer.Players); if (createMatch.ShowDialog() == true) { UCMatch ucMatch = new UCMatch(createMatch.GetMatch()); ucMatch.ButtonCloseClicked += UcMatch_ButtonCloseClicked; wrapPanelMatches.Children.Add(ucMatch); } }