Example #1
0
        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;
            }
        }
Example #2
0
        public override void OnCreate()
        {
            Task.Factory.StartNew(async() =>
            {
                while (true)
                {
                    try
                    {
                        await ArbitrageLoader.LoadSources();
                    }
                    finally
                    {
                        Thread.Sleep(30000);
                    }
                }
            });

            base.OnCreate();
        }