private void OnNewMapSelected(object sender, EventArgs e) { var dlg = new NewMapDialog(); switch (_state.LastNewMapType) { case 0: dlg._radioSingleTileMap.IsPressed = true; break; case 1: dlg._radioGeneratedMap.IsPressed = true; break; } dlg.Closed += (s, a) => { if (!dlg.Result) { return; } try { if (dlg._radioSingleTileMap.IsPressed) { throw new NotImplementedException(); _state.LastNewMapType = 0; } else { OnNewGeneratedMap(); _state.LastNewMapType = 1; } } catch (Exception ex) { ReportError(ex.Message); } }; dlg.ShowModal(_desktop); }
private void NewMapItemOnClicked(object sender, EventArgs eventArgs) { _newMapDialog = new NewMapDialog(); _newMapDialog.ShowModal(_desktop); _newMapDialog.ButtonOk.Click += NewOnClicked; }