This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RetailersService : AppServiceBase | |
{ | |
public async Task<IList<Retailer>> GetRetailersAsync() | |
{ | |
return await BlobCache.LocalMachine.GetOrFetchObject("retailers", DownloadRetailersAsync); | |
} | |
private Task<IList<Retailer>> DownloadRetailersAsync() | |
{ | |
IList<Retailer> retailers = Enumerable.Range(0, 20) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var scheduler = TaskScheduler.FromCurrentSynchronizationContext(); | |
SetUIThreadMarshaller(action => | |
{ | |
if (Window.Current != null) | |
action(); | |
else | |
Task.Factory.StartNew(action, new CancellationToken(), TaskCreationOptions.PreferFairness, scheduler).Wait(); | |
}); |
NewerOlder