void Played03(List <Filmes> temp) { Filmes.Clear(); if (temp[0].nota > temp[1].nota) { FirstMovie = temp[0]; SecondMovie = temp[1]; } else if (temp[0].nota < temp[1].nota) { FirstMovie = temp[1]; SecondMovie = temp[0]; } else { if (string.Compare(temp[0].titulo, temp[1].titulo) == -1) { FirstMovie = temp[0]; SecondMovie = temp[1]; } if (string.Compare(temp[0].titulo, temp[1].titulo) == 1) { FirstMovie = temp[1]; SecondMovie = temp[0]; } } }
public override async void OnNavigatedTo(INavigationParameters parameters) { base.OnNavigatedFrom(parameters); if (!VerifyConnection.GetConnectionStatus()) { Xamarin.Forms.DependencyService.Get <IToastService>().DisplayMessage("Sem conexão."); } this.IsBusy = true; await Policy .Handle <HttpRequestException>() .WaitAndRetryForeverAsync ( sleepDurationProvider: retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)) ) .ExecuteAsync(async() => await _service.GetFilmes()) .ContinueWith(t => { Device.BeginInvokeOnMainThread(() => { Filmes.Clear(); Filmes.AddRange(t.Result); SetMessage(Filmes.Count); this.IsBusy = false; }); }); }