示例#1
0
        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();
        }
示例#2
0
        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));
            }
        }