GetVatService() { if (IsBusy) { return; } IsBusy = true; try { VAT.Clear(); var items = await VatServices.GetItemsAsync(true); foreach (var item in items) { VAT.Add(item); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
async Task GetTask() { if (IsBusy) { return; } VatServices = new VatServices(); IsBusy = true; _Dane.Clear(); var items = await VatServices.GetItemsAsync(true); try { foreach (var item in items) { Dane.Add(item); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
public EditItemsPageViewModel() { Items = new ObservableCollection <Items>(); VAT = new ObservableCollection <VAT>(); VatServices = new VatServices(); //Třída, která implementuje API komunikaci pro daně PolozkasService = new PolozkasService(); //Třída, která implementuje API komunikaci pro položky EditItems = new ObservableCollection <EditItem>(); VatNames = new ObservableCollection <string>(); SectionNames = new ObservableCollection <string>(); Sekces = new ObservableCollection <Sekce>(); sekcesService = new SekcesService(); }