public override void ViewDidLoad() { base.ViewDidLoad(); this.CreateBinding(KeyTextField).To((MainViewModel vm) => vm.ParameterKey).Apply(); this.CreateBinding(AnonButton).To((MainViewModel vm) => vm.GoAnonymousCommand).Apply(); this.CreateBinding(ParamsButton).To((MainViewModel vm) => vm.GoParameterizedCommand).Apply(); this.CreateBinding(SimpleButton).To((MainViewModel vm) => vm.GoSimpleCommand).Apply(); this.View.AddGestureRecognizer(new UITapGestureRecognizer(() => { KeyTextField.ResignFirstResponder(); })); }
private void BtnTwitchLogin_Click(object sender, RoutedEventArgs e) { string username = UsernameTextField.Text; string oauth = KeyTextField.Password; try { new MainWindow(username, oauth).Show(); Closed -= Startup_Closed; this.Close(); } catch (Exception) { //Twitch login was probably bad UsernameTextField.Text = ""; KeyTextField.Clear(); new ErrorWindow("The Twitch username you submitted is invalid!").ShowDialog(); } }