Esempio n. 1
0
        private async Task ItemSelecionado(int id)
        {
            if (IsBusy)
            {
                return;
            }
            IsBusy = true;

            try
            {
                var mock = new PropostaMock();
                var item = await mock.GetItemAsync(id.ToString());

                if (item == null)
                {
                    await MessageService.ShowAsync("Proposta não encontrada");

                    return;
                }
                await MessageService.ShowAsync(item.Numero + item.Torre);
            }
            catch (Exception ex)
            {
                await MessageService.ShowAsync(ex.Message);

                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Esempio n. 2
0
        private async Task LoadItems()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Items.Clear();
                var mock  = new PropostaMock();
                var items = await mock.GetItemsAsync(true);

                foreach (var item in items)
                {
                    Items.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }