Хм, у меня странная проблема. когда я создаю новый экземпляр класса, я получаю StackOverflowExcepion:)
Вот код:
public partial class PlayerChooser : Window
{
public PlayerChooser()
{
InitializeComponent();
textBoxPlayer1Name.Visibility = Visibility.Hidden;
textBoxPlayer2Name.Visibility = Visibility.Hidden;
textBoxPlayer3Name.Visibility = Visibility.Hidden;
textBoxPlayer4Name.Visibility = Visibility.Hidden;
}
public static String player1Name;
public static String player2Name;
public static String player3Name;
public static String player4Name;
...
PlayerChooser.player1Name = textBoxPlayer1Name.Text;
PlayerChooser.player2Name = textBoxPlayer2Name.Text;
TwoPlayers501_new twoPlayers501_new = new TwoPlayers501_new();
twoPlayers501_new.Show();
...
}
и класс и конструктор, где происходит исключение
public partial class TwoPlayers501_new : Window
{
public TwoPlayers501_new()
{
InitializeComponent();
textBlockPlayer1Name.Text = PlayerChooser.player1Name;
textBlockPlayer2Name.Text = PlayerChooser.player2Name;
}
...
}
Спасибо заранее, это, наверное, какая-то мелочь ...