protected override async Task OnParametersSetAsync() { if (!string.IsNullOrEmpty(Date)) { LocalDateTimeString = await MomentService.LocalDateAsync(Date, Format); } }
public async Task ExecuteFetchMomentsCommand() { if (IsBusy) { return; } IsBusy = true; try { if (await ConnectivityService.IsConnected()) { Moments.Clear(); var refreshedMoments = await MomentService.GetMoments(); Moments.AddRange(refreshedMoments); } else { DialogService.ShowError(Strings.NoInternetConnection); } } catch (Exception ex) { Logger.Report(ex); } IsBusy = false; }
protected override async Task OnParametersSetAsync() { if (!string.IsNullOrEmpty(Date)) { DateText = await MomentService.LocalDateAsync(Date, Format); FromNowDate = await MomentService.FromNowAsync(Date); } }
private async Task <bool> SendImage() { var recipients = new List <User>(); await Task.Run(() => { foreach (var friend in Friends) { if (friend.SendMoment) { recipients.Add(friend); } friend.SendMoment = false; } }); return(await MomentService.SendMoment(new MemoryStream(imageData), recipients, displayTime)); }
private async Task DestroyImage(Moment moment) { Moments.Remove(moment); await MomentService.DestroyMoment(moment); }