protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); _mainViewModel = new MainViewModel(new DroidDialogService(this), new DroidStorageService(this)); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); _mainViewModel.FirstName = FindViewById<CustomEditText>(Resource.Id.firstNameText); _mainViewModel.LastName = FindViewById<CustomEditText>(Resource.Id.lastNameText); _mainViewModel.Age = FindViewById<CustomEditText>(Resource.Id.ageText); _mainViewModel.ClearButton = FindViewById<CustomButton>(Resource.Id.clearPersonButton); _mainViewModel.SaveButton = FindViewById<CustomButton>(Resource.Id.savePersonButton); _mainViewModel.Start(); }
public override void ViewDidLoad() { base.ViewDidLoad(); NavigationController.NavigationBar.Translucent = false; NavigationController.NavigationBar.Opaque = true; Title = "Save Yourself"; // Perform any additional setup after loading the view, typically from a nib. _mainViewModel = new MainViewModel(new TouchDialogService(), new TouchStorageService()); _mainViewModel.FirstName = firstNameTextField; _mainViewModel.LastName = lastNameTextField; _mainViewModel.Age = ageTextField; _mainViewModel.ClearButton = clearButton; _mainViewModel.SaveButton = saveButton; _mainViewModel.Start(); }