private void AsyncListarAgendaVencida() { List <string> _list = new List <string>(); _list.Add(DateTime.Now.ToShortDateString()); _list.Add("1"); Task.Factory.StartNew(() => mdata.AgendaVencida(_list)) .ContinueWith(task => { if (task.IsCompleted) { ListarAgenda = task.Result; } }); }
private void AsyncListarAgendaVencida() { List <string> _list = new List <string>(); _list.Add(DateTime.Now.ToShortDateString()); _list.Add("1"); Task.Factory.StartNew(() => mdata.AgendaVencida(_list)) .ContinueWith(task => { if (task.IsCompleted) { ListarAgenda = task.Result; } }, System.Threading.CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()); }