public MainPage() { InitializeComponent(); DBSample dBSample = new DBSample(); var items = Task.Run <List <TodoItem> >(async() => { return(await dBSample.Test()); }).Result; itemsListView.ItemsSource = items; }
static void Main(string[] args) { DBSample dBSample = new DBSample(); var items = Task.Run <List <TodoItem> >(async() => { return(await dBSample.Test()); }).Result; items.ForEach(Console.WriteLine); Console.WriteLine("Output is also in Debug window"); Console.ReadKey(); }