protected override void OnAppearing() { base.OnAppearing(); AppCenterService.TrackEvent(AppCenterConstants.FoodListPageAppeared); Device.BeginInvokeOnMainThread(_foodListView.BeginRefresh); }
void HandleUploadPhotoFailed(object sender, string errorMessage) { AppCenterService.TrackEvent(AppCenterConstants.UploadPhotoFailed, new Dictionary <string, string> { { AppCenterConstants.Error, errorMessage } }); DisplayErrorMessage(errorMessage); }
void HandleCancelToolbarItemClicked(object sender, EventArgs e) { AppCenterService.TrackEvent(AppCenterConstants.CancelButtonTapped); if (!ViewModel.IsPhotoUploading) { ClosePage(); } }
void HandleUploadPhotoCompleted(object sender, EventArgs e) { AppCenterService.TrackEvent(AppCenterConstants.UploadPhotoToSucceeded); Device.BeginInvokeOnMainThread(async() => { await DisplayAlert("Photo Saved", string.Empty, "OK"); ClosePage(); }); }
void HandleItemSelected(object sender, SelectedItemChangedEventArgs e) { var itemTapped = e.SelectedItem as FoodLogModel; AppCenterService.TrackEvent(AppCenterConstants.FoodListItemTapped, new Dictionary <string, string> { { AppCenterConstants.Description, itemTapped?.Description_PascalCase } }); _foodListView.SelectedItem = null; }
void HandleItemTapped(object sender, ItemTappedEventArgs e) { var listView = (ListView)sender; listView.SelectedItem = null; if (e.Item is FoodLogModel itemTapped) { AppCenterService.TrackEvent(AppCenterConstants.FoodListItemTapped, AppCenterConstants.Description, itemTapped.Description_PascalCase); } }
protected override void OnAppearing() { base.OnAppearing(); AppCenterService.TrackEvent(AppCenterConstants.AddFoodListPageAppeared); }
void HandleNoCameraFound(object sender, EventArgs e) { AppCenterService.TrackEvent(AppCenterConstants.NoCameraFound); DisplayErrorMessage("No Camera Found"); }
void HandleAddFoodButtonClicked(object sender, EventArgs e) { AppCenterService.TrackEvent(AppCenterConstants.AddFoodListPageButtonTapped); Device.BeginInvokeOnMainThread(async() => await Navigation.PushModalAsync(new HealthClinicNavigationPage(new AddFoodPage()))); }
async void HandleUploadPhotoFailed(object sender, string errorMessage) { AppCenterService.TrackEvent(AppCenterConstants.UploadPhotoFailed, AppCenterConstants.Error, errorMessage); await DisplayErrorMessage(errorMessage); }
void HandleCancelToolbarItemClicked(object sender, EventArgs e) { AppCenterService.TrackEvent(AppCenterConstants.CancelButtonTapped); ClosePage(); }
public static Task <HttpResponseMessage> DeleteFoodFromAPI(int id) { AppCenterService.TrackEvent(AppCenterConstants.DeleteFoodAPITriggered); return(GetObjectFromAPI($"{APIConstants.DeleteFoodLogUrl}?id={id}")); }
public static Task <HttpResponseMessage> PostFoodPhoto(byte[] foodPhoto) { AppCenterService.TrackEvent(AppCenterConstants.UploadPhotoToAPITriggered); return(PostObjectToAPI(APIConstants.PostFoodUrl, foodPhoto)); }
public static Task <IReadOnlyList <FoodLogModel> > GetFoodLogs() { AppCenterService.TrackEvent(AppCenterConstants.GetFoodLogsFromAPITriggered); return(GetObjectFromAPI <IReadOnlyList <FoodLogModel> >(APIConstants.GetFoodLogsUrl)); }