protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Manage the views SetContentView(Resource.Layout.StockPriceListActivityLayout); _listView = FindViewById <ListView> (Resource.Id.stock_list); // Set up the correct properties on the application var app = ShinobiStockChartApplication.GetApplication(this); app.CurrentActivity = this; // Prepare the services var uiMarshal = new MarshalInvokeService(app); var appStatus = new AppStatusService(app); var navigation = new NavigationService(app); // Create the presenter _presenter = new StockPriceListPresenter(appStatus, uiMarshal, navigation); _presenter.SetView(this); app.Presenter = _presenter; // Set up click handling _listView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => { var stockItem = _prices [e.Position]; StockSelected(this, new StockSelectedEventArgs(stockItem)); }; // Apply the title ActionBar.Title = _presenter.Title; }
public StocksListViewController(StockPriceListPresenter presenter) : base("StocksListViewController", null) { Title = presenter.Title; _presenter = presenter; _presenter.SetView(this); }