async void autoFillClicked(object sender, System.EventArgs e) { string currEvent = Preferences.Get("CurrentEvent", ""); if (Convert.ToInt32(matchnum.Text) < 1) { await DisplayAlert("Oops", "please enter match num first", "ok"); return; } JObject s = App.matchesList; s = (s == null) ? new JObject() : s; if (s.ContainsKey(currEvent)) { setSide(currEvent); } else { var response = await DisplayAlert("Oops", "Looks Like you don't have this downloaded", "Download", "Don't Download"); if (response) { DataDownload.getEventMatches(currEvent); setSide(currEvent); } } }
public App() { InitializeComponent(); DataDownload.initClient(); DataDownload.populateAllData(); MainPage = new NavigationPage(new NavTab()); Application.Current.MainPage = MainPage; }
async void populateTeamList(ListView listView) { Debug.WriteLine("start" + App.teamsList.Count); await Task.Run(() => { if (App.teamsList.Count <= 0) { Debug.WriteLine("Whatt"); DataDownload.populateTeamList(Preferences.Get(ConstantVars.TEAM_LIST_STORAGE, "[]"), App.teamsList); } setSimplifiedTeams(App.teamsList, teams); }); Debug.WriteLine("wre" + App.teamsList.Count); listView.ItemsSource = null; listView.ItemsSource = teams; }
public ChangeEventPage() { InitializeComponent(); CompetitionList.RefreshCommand = new Command(() => { //Do your stuff. CompetitionList.IsRefreshing = true; try { DataDownload.refreshEvents(); } catch (Exception ex) { DisplayAlert(ex.ToString(), "", "OK"); } CompetitionList.ItemsSource = null; CompetitionList.ItemsSource = App.eventsList.Values; CompetitionList.IsRefreshing = false; }); CompetitionList.ItemsSource = App.eventsList.Values; }
public MatchEntryStart(Enum ismatch) { goToMatch = ismatch; InitializeComponent(); //MatchesList.ItemsSource = teams; MatchesList.RefreshCommand = new Command(() => { //Do your stuff. MatchesList.IsRefreshing = true; try { DataDownload.refreshTeams(); } catch (Exception ex) { DisplayAlert(ex.ToString(), "", "OK"); } populateTeamList(MatchesList); MatchesList.IsRefreshing = false; }); populateTeamList(MatchesList); }
public static void populateAllData() { DataDownload.populateTeamList(Preferences.Get(ConstantVars.TEAM_LIST_STORAGE, "[]"), App.teamsList); DataDownload.populateEventList(Preferences.Get(ConstantVars.EVENT_LIST_STORAGE, "[]"), App.eventsList); DataDownload.populateMatchList(Preferences.Get(ConstantVars.COMPETITION_MATCHES_LIST, "[]"), App.matchesList, Preferences.Get(ConstantVars.CURRENT_EVENT_NAME, "")); }