protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it Button button = FindViewById <Button>(Resource.Id.myButton); button.Click += delegate { _service.OnClick(); button.Text = _service.Message; }; }
public override void ViewDidLoad() { base.ViewDidLoad(); // Code to start the Xamarin Test Cloud Agent #if ENABLE_TEST_CLOUD Xamarin.Calabash.Start(); #endif // Perform any additional setup after loading the view, typically from a nib. Button.AccessibilityIdentifier = "myButton"; Button.TouchUpInside += delegate { _service.OnClick(); Button.SetTitle(_service.Message, UIControlState.Normal); }; }