Beispiel #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Code to start the Xamarin Test Cloud Agent
           
            viewModel = new LoginViewModel();
            // Perform any additional setup after loading the view, typically from a nib.
            Button.AccessibilityIdentifier = "myButton";
            Button.TouchUpInside += delegate
            {
                viewModel.GetPeopleCommand.Execute(null);
                      
            };


        }
Beispiel #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            viewModel = new LoginViewModel();
            // Get our button from the layout resource,
            // and attach an event to it
            button = FindViewById<Button>(Resource.Id.myButton);

            username = FindViewById<EditText>(Resource.Id.username);
            password = FindViewById<EditText>(Resource.Id.password);

            combo = FindViewById<TextView>(Resource.Id.combo);

            progressBar = FindViewById<ProgressBar>(Resource.Id.progressBar1);

            username.TextChanged += (sender, e) => 
                {
                    viewModel.Username = username.Text;
                };

            password.TextChanged += (sender, e) => 
                {
                    viewModel.Password = password.Text;
                };


            username.Text = viewModel.Username;
            password.Text = viewModel.Password;
            combo.Text = viewModel.ComboDisplay;
            progressBar.Visibility = ViewStates.Gone;

           
            button.Click += delegate
            {
               viewModel.GetPeopleCommand.Execute(null);
            };
        }