예제 #1
0
        private void Connect(object sender, RoutedEventArgs e)
        {
            SimulatorWindow sw = new SimulatorWindow();

            sw.Show();
            this.Close();
        }
예제 #2
0
 /// <summary>
 /// Connecting to server after "Connect" button is clicked.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void connectButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         //connect to server
         this.fs_ViewModel.connect();
         //open simulator window
         SimulatorWindow objSimulator = new SimulatorWindow(model);
         objSimulator.wheelsControl.DataContext = new WheelsControlVM(this.model);
         this.Visibility = Visibility.Hidden;
         //matching data context to VM
         objSimulator.DataContext = fs_ViewModel;
         objSimulator.Show();
         this.Close();
     }
     catch (Exception exception)
     {
         this.errorLabel.Visibility = Visibility.Visible;
     }
 }