Exemplo n.º 1
0
        private void BindViewModel()
        {
            this.Bind(ViewModel, m => m.UserName, a => a.UserNameEditText.Text);
            this.Bind(ViewModel, m => m.Password, a => a.PasswordEditText.Text);
            this.OneWayBind(ViewModel, m => m.Error, a => a.ErrorTextView.Text);

            this.OneWayBindMultiple(ViewModel, m => m.IsUiEnabled,
                                    a => a.LoginButton.Enabled,
                                    a => a.RegisterButton.Enabled,
                                    a => a.UserNameEditText.Enabled,
                                    a => a.PasswordEditText.Enabled);

            LoginButton
            .Events()
            .Click
            .InvokeCommandWithoutParam(ViewModel, m => m.LoginCommand);

            RegisterButton
            .Events()
            .Click
            .InvokeCommandWithoutParam(ViewModel, m => m.RegisterCommand);
        }