public static bool?ShowDialog(Window owner, IPokemon pokemon) { ChangeNicknameWindow window = new ChangeNicknameWindow(pokemon); window.Owner = owner; return(window.ShowDialog()); }
private void OnChangeNicknameClicked(object sender, RoutedEventArgs e) { labelNickname.Content = pokemon.Nickname; string result = ChangeNicknameWindow.ShowDialog(Window.GetWindow(this), pokemon.Nickname); if (result != null) { if (result == "") { pokemon.RemoveNickname(); } else { pokemon.Nickname = result; } labelNickname.Content = pokemon.Nickname; } }