public async void AddMemeAsync() { try { if (!string.IsNullOrEmpty(url)) { var value = await _tronaldDumpService.GetMemeAsync(url); if (value != null) { var id = 1; if (ImageCollection.Count > 0) { id = ImageCollection.Last().Id + 1; } var meme = new MemeDbItem { Id = id, Image = value }; ImageCollection.Add(meme); if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.UWP) { await _databaseService.AddMeme(meme); } } else { _toastMessage.ShowToast(commonErrorMessage); } } else { _toastMessage.ShowToast(apiErrorMessage); } } catch { _toastMessage.ShowToast(commonErrorMessage); } }