private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) { App.Current.Dispatcher.Invoke(() => { ReportViewModel reportViewModel = DataContext as ReportViewModel; if (reportViewModel != null) { reportViewModel.ResetFilter(reportViewModel.CurrentFilter); reportViewModel.RefreshCharts(); } }); }