protected async override void OnNavigatedTo(NavigationEventArgs e) { Partneri.Clear(); FirmaDAL.PartnerDalProvider dalProvider = new FirmaDAL.PartnerDalProvider(); LoadingIndicator.IsActive = true; List <FirmaDAL.Partner> result = await Task.Run(() => dalProvider.FetchAll()); LoadingIndicator.IsActive = false; foreach (var item in result) { Partneri.Add(item); } // Navigation logic (back button) Frame rootFrame = Window.Current.Content as Frame; if (rootFrame.CanGoBack) { Windows.UI.Core.SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.Visible; } else { Windows.UI.Core.SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.Collapsed; } }
public List <Partner> FetchAll() { FirmaDAL.PartnerDalProvider partnerDalProvider = new FirmaDAL.PartnerDalProvider(); MjestoBllProvider mjestoBllProvider = new MjestoBllProvider(); var mjestoLookupList = mjestoBllProvider.FetchLookup(); var result = partnerDalProvider.FetchAll(); List <Partner> partnerList = new List <Partner>(); foreach (var partner in result) { partnerList.Add(new Partner(partner, mjestoLookupList, e => Validator.ValidatePartner(e as Partner))); } return(partnerList); }