async Task <int> onLoadList_(object ___notUsed___) { Bpr.Beep1of2(); var sw = Stopwatch.StartNew(); Task <int> task = Task.Run(() => { _db.MediaUnits.Take(7).Load(); return(_db.MediaUnits.Local.Count()); }); //{ Task.Delay(3333); return DateTime .Now.Millisecond; }); await task.ContinueWith(_ => { PlayList.ClearAddRange(_db.MediaUnits.Local); if (PlayList.Count() > 0) { CurMediaUnit = PlayList[0]; onTglPlayPause(___notUsed___); } TopLefttInfo = $"{PlayList.Count()} songs loaded in {.001 * sw.ElapsedMilliseconds:N1} sec. "; Bpr.Beep2of2(); }, TaskScheduler.FromCurrentSynchronizationContext()); int ttlRows = await task; TopLefttInfo = $"{PlayList.Count()} songs loaded in {.001 * sw.ElapsedMilliseconds:N1} sec. "; //await _db.MediaUnits.Take(7).LoadAsync(); return(ttlRows); }
async Task <int> onLoadList__(object ___notUsed___) { Bpr.Beep1of2(); var sw = Stopwatch.StartNew(); int ttlRows = await Task.Run(() => { _db.MediaUnits.Take(7).Load(); return(_db.MediaUnits.Local.Count()); }); //{ Task.Delay(3333); return DateTime .Now.Millisecond; }); PlayList.ClearAddRange(_db.MediaUnits.Local); if (PlayList.Count() > 0) { CurMediaUnit = PlayList[0]; } TopLefttInfo = $"{PlayList.Count()} songs loaded in {.001 * sw.ElapsedMilliseconds:N1} sec. "; Bpr.Beep2of2(); return(ttlRows); }