public override async void OnNavigatedTo(NavigationParameters parameters) { base.OnNavigatedTo(parameters); localDbTeams = await localDbService.GetAllTeamsAsync(); if (parameters.ContainsKey("id")) { Team = localDbTeams.First(t => t.Id == (int)parameters["id"]).Name; } }
public override async void OnNavigatingTo(NavigationParameters parameters) { base.OnNavigatingTo(parameters); var allTeams = await localDbService.GetAllTeamsAsync(); if (allTeams != null) { Teams = new ObservableCollection <TeamViewModel>(allTeams.Select(TeamViewModel.GetViewModelFromEntity)); } }
public override async void OnNavigatedTo(NavigationParameters parameters) { base.OnNavigatedTo(parameters); localDbTeams = await localDbService.GetAllTeamsAsync(); if (parameters.ContainsKey("id")) { var result = localDbTeams.FirstOrDefault(t => parameters["id"].ToString().Contains(t.Id.ToString())); FavoriteTeam = result != null? result.Name ?? string.Empty: string.Empty; } }
private async Task LoadSurveysAsync() { var allTeams = await localDbService.GetAllTeamsAsync(); var allSurveys = await localDbService.GetAllSurveysAsync(); if (allSurveys != null) { Surveys = new ObservableCollection <SurveyViewModel>(allSurveys.Select(s => SurveyViewModel.GetViewModelFromEntity(s, allTeams))); } RaisePropertyChanged(nameof(IsEmpty)); }