Ejemplo n.º 1
0
        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(); }));
        }
Ejemplo n.º 2
0
        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();
            }
        }