Exemplo n.º 1
0
        void ExecuteLoadLocaisCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Locais.Clear();


                foreach (var item in (new LocalService()).GetLocais())
                {
                    Locais.Add(new Tuple <int, string>(item.Key, item.Value));
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Exemplo n.º 2
0
        public async Task GetLocais()
        {
            if (IsBusy)
            {
                return;
            }

            try
            {
                IsBusy = true;
                Locais.Clear();

                var items = await AzureMobileService.Instance.GetLocais();

                foreach (var item in items)
                {
                    Locais.Add(item);
                }
            }
            catch (Exception e)
            {
                LogHelper.Instance.AddLog(e);
            }
            finally
            {
                IsBusy = false;
            }
        }