public MainWindow() { InitializeComponent(); var connDialog = new ConnectionDialog(); if (connDialog.ShowDialog() ?? false) { _connProto.Server = connDialog.txtServer.Text; _connProto.Port = Int32.Parse(connDialog.txtPort.Text); _connProto.User = connDialog.txtUsername.Text; _connProto.Password = connDialog.txtPassword.Text; } }