private void fingerPrint_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (fingerVerified == true) { Transition(); } else { if (serial != null) { if (serial.IsOpen) { serial.Close(); } } UserControl usc = new UserControlWelcome(data); var parent = (Grid)this.Parent; parent.Children.Add(usc); parent.Children.Remove(this); } if (serial != null) { serial.Close(); } }
public MainWindow() { InitializeComponent(); data = new LoginData(); UserControl usc = new UserControlWelcome(data); data.setUserName("root"); data.setPassword("mysql"); GridMain.Children.Add(usc); }