private static DataPoint[] getItemList() { TodoItemDatabase itemDataBase = TodoItemDatabase.getDatabase(); Task <List <TodoItem> > taskItemList = itemDataBase.GetItemsAsync(); List <TodoItem> itemList = taskItemList.Result; DataPoint[] points = new DataPoint[itemList.Count]; int i = 0; foreach (TodoItem item in itemList) { points[i++] = new DataPoint(item.ID, item.Count); } return(points); }