void refreshDataWorker_DoWork(object sender, DoWorkEventArgs e) { try { RefreshDashOptions opt = e.Argument as RefreshDashOptions; VM_DashboardMetro.Instance.RefreshAllData( opt.ContinueWatching, opt.RandomSeries, opt.NewEpisodes); } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
public void RefreshAllData() { RefreshDashOptions opt = new RefreshDashOptions() { ContinueWatching = Dash_ContinueWatching_Visibility == Visibility.Visible, RandomSeries = Dash_RandomSeries_Visibility == Visibility.Visible, NewEpisodes = Dash_NewEpisodes_Visibility == Visibility.Visible }; if (opt.ContinueWatching) { IsLoadingContinueWatching = true; } if (opt.RandomSeries) { IsLoadingRandomSeries = true; } if (opt.NewEpisodes) { IsLoadingNewEpisodes = true; } refreshDataWorker.RunWorkerAsync(opt); }