public async Task InitAsync() { Tiles = await _tileProvider.GetTilesAsync(); // Randomly shuffle the list var rnd = new Random(); Tiles = Tiles.OrderBy(item => rnd.Next()).ToList(); NumColumns = (int)(Math.Sqrt(Tiles.Count) + 0.5); _timer.Elapsed += (sender, e) => HandleTimer(); }
private async Task SyncAsync() { _syncInProgress = true; RaisePropertyChanged(nameof(ButtonText)); try { var tiles = await _sourceTileProvider.GetTilesAsync(); await _targetTileProvider.SaveTilesAsync(tiles); await _dialogService.ShowMessageBox("Synchronization Successful - please restart the app to use this data", "Meetup.com Download"); } finally { _syncInProgress = false; RaisePropertyChanged(nameof(ButtonText)); } }