/// <summary> /// Create new activity instance. /// </summary> protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); // Set our view from the "main" layout resource SetContentView (Resource.Layout.Main); InitializeContainerIfNecessary(); var npo = new NamedParameterOverloads(); npo.Add("activity", this); _controller = _container.Resolve<DemoActivityController>(npo); // Get our button from the layout resource, // and attach an event to it _button = FindViewById<Button> (Resource.Id.myButton); _button.Click += _controller.OnButtonClick; }