private void RefreshStats(Expression <Func <GameResult, bool> > filter = null) { var expr = filter ?? GetFilterExpression(); Task.Run(() => CurrentStats.RefreshFrom(dbContext, expr)); Task.Run(() => this.totals.Update(dbContext, expr)); }
private void RefreshStats(Expression <Func <ArenaSession, bool> > filter = null) { needStatsRefresh = true; var expr = filter ?? GetFilterExpression(); Application.Current.Dispatcher.BeginInvoke( (Action)(() => { if (needStatsRefresh) { needStatsRefresh = false; Task.Run(() => totals.Update(dbContext, expr)); Task.Run(() => CurrentStats.RefreshFrom(dbContext, expr)); } }), DispatcherPriority.ContextIdle); }