//Begin code public Main() { InitializeComponent(); this.client = new BattleshipServiceClient(new InstanceContext(this)); roomsPage = new RoomsPage(this); SetContent(roomsPage); loginPage = new LoginPage(this); ((RoomsPage)this.Content).grid.Children.Add(loginPage); loginPage.SetValue(Grid.RowSpanProperty, 4); loginPage.SetValue(Grid.ColumnSpanProperty, 2); this.Closing += Dispatcher_ShutdownStarted; chat = ""; }
public Main() { InitializeComponent(); this.client = new BattleshipServiceClient(new InstanceContext(this)); roomsPage = new RoomsPage(this); SetContent(roomsPage); loginPage = new LoginPage(this); ((RoomsPage)this.Content).grid.Children.Add(loginPage); loginPage.SetValue(Grid.RowSpanProperty, 4); loginPage.SetValue(Grid.ColumnSpanProperty, 2); this.Closing += Dispatcher_ShutdownStarted; chat = ""; }
public void CantConnectToServer(string message) { MessageBox.Show(message, "Can't connect to server!", MessageBoxButton.OK, MessageBoxImage.Error); client = null; Application.Current.Shutdown(); }