private void Window_Loaded(object sender, RoutedEventArgs e) { _model.InitModel((UInt32)gameField.ActualHeight, (UInt32)gameField.ActualWidth); // create observable collections. gameField.ItemsSource = _model.gameFields; }
private void SocketSetup_Click(object sender, RoutedEventArgs e) { SocketSetupWindow socketSetupWindow = new SocketSetupWindow(); socketSetupWindow.ShowDialog(); this.Title = this.Title + " " + socketSetupWindow.SocketData.LocalIPString + "@" + socketSetupWindow.SocketData.LocalPort.ToString(); _model.SetLocalNetworkSettings(socketSetupWindow.SocketData.LocalPort, socketSetupWindow.SocketData.LocalIPString); _model.SetRemoteNetworkSettings(socketSetupWindow.SocketData.RemotePort, socketSetupWindow.SocketData.RemoteIPString); _model.InitModel(); }
private void SetUp_Click(object sender, RoutedEventArgs e) { SocketSetupWindow socketSetupWindow = new SocketSetupWindow(); socketSetupWindow.ShowDialog(); SetUp.IsEnabled = false; Play.IsEnabled = true; _model.SetLocalNetworkSettings(socketSetupWindow.SocketData.LocalPort, socketSetupWindow.SocketData.LocalIPString); _model.SetRemoteNetworkSettings(socketSetupWindow.SocketData.RemotePort, socketSetupWindow.SocketData.RemoteIPString); // initialize model and get the ball rolling _model.InitModel(); // set title bar to be unique this.Title = this.Title + " " + socketSetupWindow.SocketData.LocalIPString + "@" + socketSetupWindow.SocketData.LocalPort.ToString(); }
private void SocketSetup_Button_Click(object sender, RoutedEventArgs e) { // call up socket setup windows to get setup data SocketSetupWindow socketSetupWindow = new SocketSetupWindow(); socketSetupWindow.ShowDialog(); // set title bar to be unique this.Title = this.Title + " " + socketSetupWindow.SocketData.LocalIPString + "@" + socketSetupWindow.SocketData.LocalPort.ToString(); // update model with setup data _model.SetLocalNetworkSettings(socketSetupWindow.SocketData.LocalPort, socketSetupWindow.SocketData.LocalIPString); _model.SetRemoteNetworkSettings(socketSetupWindow.SocketData.RemotePort, socketSetupWindow.SocketData.RemoteIPString); // initialize model and get the ball rolling _model.InitModel(); }