private void connect_Click(object sender, RoutedEventArgs e) { if (!cw.IsLoaded) { cw = new ConnectWindow((Application.Current as App).flightSimulatorViewModel); cw.Show(); } }
private void ConnectButton_Click(object sender, RoutedEventArgs e) { // Open connection window - at first with default IP and Port, or if changed the changed values. ConnectWindow cW = new ConnectWindow() { DataContext = (Application.Current as App).ConnectViewModel }; cW.Show(); connectButton.IsEnabled = false; disconnectButton.IsEnabled = true; MyControls.IsEnabled = true; GameMap.IsEnabled = true; }