async Task ExecuteLoadItemsCommand()
        {
            IsBusy = true;

            try
            {
                TransactionList.Clear();

                var idUser = Application.Current.Properties["userId"].ToString();

                typeConst = new TypeMethod();

                typesServices = new TypesServices();

                int HeightList = 0;

                var transactionList = await typesServices.GetAllTransaction(typeConst.Income, idUser);

                Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(transactionList));
                foreach (DataTransaction item in transactionList.data.items)
                {
                    HeightList = (item.data.Count * 40) + (10 * item.data.Count) + 30;

                    item.AddProperty(HeightList);

                    TransactionList.Add(item);

                    HeightList = 0;
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
예제 #2
0
        private async Task InitializeDataAsync()
        {
            var TypesServices = new TypesServices();

            CostManagement = await TypesServices.GetAllCates("chiphi");

            IncomeManagement = await TypesServices.GetAllCates("thunhap");

            foreach (ItemCate item in CostManagement.data.items)
            {
                ListCostsPicker.Add(item.name);
                ListCostsId.Add(item.id);
                ListImageCosts.Add(item.img);
            }

            foreach (ItemCate item in IncomeManagement.data.items)
            {
                ListIncomesPicker.Add(item.name);
                ListIncomesId.Add(item.id);
                ListImageIncomes.Add(item.img);
            }
        }