Ejemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            ViewModel = AccountFragment.ViewModel;

            firstName = FindViewById <TextView>(Resource.Id.first_name);
            lastName  = FindViewById <TextView>(Resource.Id.last_name);

            firstName.Text = ViewModel.UserDetail.FirstName;
            lastName.Text  = ViewModel.UserDetail.LastName;

            firstNameRow = FindViewById <LinearLayout>(Resource.Id.first_name_row);
            lastNameRow  = FindViewById <LinearLayout>(Resource.Id.last_name_row);
            aboutMeRow   = FindViewById <LinearLayout>(Resource.Id.about_me_row);

            firstNameRow.Click += async(sender, e) =>
            {
                await ViewModel.ExecuteClickFirstNameCommandAsync();

                firstName.Text = ViewModel.UserDetail.FirstName;
            };

            lastNameRow.Click += async(sender, e) =>
            {
                await ViewModel.ExecuteClickLastNameCommandAsync();

                lastName.Text = ViewModel.UserDetail.LastName;
            };

            aboutMeRow.Click += (sender, e) =>
            {
                Toast.MakeText(this, "Clicked.", ToastLength.Short).Show();
            };
        }