async Task ExecuteLoadItemsCommand() { if (IsBusy) { return; } IsBusy = true; try { await ArbitrageLoader.LoadSources(); } catch (Exception ex) { Debug.WriteLine(ex); MessagingCenter.Send(new MessagingCenterAlert { Title = "Error", Message = "Unable to load items.", Cancel = "OK" }, "message"); } finally { IsBusy = false; } }
public override void OnCreate() { Task.Factory.StartNew(async() => { while (true) { try { await ArbitrageLoader.LoadSources(); } finally { Thread.Sleep(30000); } } }); base.OnCreate(); }