private void ViewSummary(object sender, RoutedEventArgs e) { ReportViewer.Visibility = Visibility.Visible; DailySummary res = null; res = im.PrepareDailySummary(); DailyReportGD.DataContext = res; }
private async void ViewSummary(object sender, RoutedEventArgs e) { ReportViewer.Visibility = Visibility.Visible; DailySummary res = null; await Task.Run(() => { res = im.PrepareDailySummary(); }).ConfigureAwait(false); await Dispatcher.BeginInvoke(new Action(() => { DailyReportGD.DataContext = res; })); }