public StocksListViewController(StockPriceListPresenter presenter) : base("StocksListViewController", null) { Title = presenter.Title; _presenter = presenter; _presenter.SetView(this); }
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 override bool FinishedLaunching(UIApplication app, NSDictionary options) { window = new UIWindow(UIScreen.MainScreen.Bounds); var navController = new UINavigationController(); var marshalInvokeService = new MarshalInvokeService(); var appStatusService = new AppStatusService(); var navigationService = new NavigationService(navController); var stockPriceListPresenter = new StockPriceListPresenter(appStatusService, marshalInvokeService, navigationService); var mainView = new StocksListViewController(stockPriceListPresenter); navController.PushViewController(mainView, false); window.RootViewController = navController; window.MakeKeyAndVisible(); return(true); }