protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.Main); _state = (IndexViewModel) HelloWorld.App.Controller<HomeController>(this).Hello().Model; Button button = FindViewById<Button> (Resource.Id.myButton); button.Click += delegate { button.Text = string.Format ("{0} clicks!", _state.Count++); }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.Main); _controller = HelloWorld.App.Controller<HomeController>(this); _state = _controller.Hello().Model.As<IndexViewModel>(); Button button = FindViewById<Button> (Resource.Id.myButton); button.Click += delegate { button.Text = string.Format ("{0} clicks!", _state.Count++); }; var notes = FindViewById<Button> (Resource.Id.buttonToNotes); notes.Click += delegate { HelloWorld.App.Activiate(_controller.Notes()); }; var cats = FindViewById<Button> (Resource.Id.catsButton); cats.Click += delegate { HelloWorld.App.Activiate(_controller.Cats()); }; }
protected void init() { _model = (IndexViewModel) ViewData.State; _controller = (HomeController) ViewData.Controller; }