bug in lazy portfolio repo stuff

This commit is contained in:
Matthew D. Groves 2011-03-06 23:33:40 -05:00
parent b6bee8f594
commit 21e07938b2
2 changed files with 7 additions and 1 deletions

View file

@ -3,10 +3,12 @@ using System.Collections.Generic;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Util;
using Android.Views;
using Android.Widget;
using MonoStockPortfolio.Framework;
using MonoStockPortfolio.Presenters;
using System.Linq;
namespace MonoStockPortfolio.Activites
{
@ -33,6 +35,10 @@ namespace MonoStockPortfolio.Activites
public void RefreshList(IList<string> portfolioNames)
{
foreach (var portfolioName in portfolioNames)
{
Log.Info("RefreshList", portfolioName);
}
var listAdapter = new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, portfolioNames);
PortfolioListView.Adapter = listAdapter;
}

View file

@ -33,6 +33,7 @@ namespace MonoStockPortfolio.Presenters
public void RefreshPortfolioList()
{
_portfolios = null;
var portfolioNames = Portfolios.Select(p => p.Name).ToList();
_currentView.RefreshList(portfolioNames);
}
@ -44,7 +45,6 @@ namespace MonoStockPortfolio.Presenters
public void ViewPortfolio(int portfolioPosition)
{
// why is _currentView null?
_currentView.StartViewPortfolioActivity(Portfolios[portfolioPosition].ID ?? -1);
}