Esempio n. 1
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            AppCenterService.TrackEvent(AppCenterConstants.FoodListPageAppeared);

            Device.BeginInvokeOnMainThread(_foodListView.BeginRefresh);
        }
Esempio n. 2
0
        void HandleUploadPhotoFailed(object sender, string errorMessage)
        {
            AppCenterService.TrackEvent(AppCenterConstants.UploadPhotoFailed,
                                        new Dictionary <string, string> {
                { AppCenterConstants.Error, errorMessage }
            });

            DisplayErrorMessage(errorMessage);
        }
Esempio n. 3
0
        void HandleCancelToolbarItemClicked(object sender, EventArgs e)
        {
            AppCenterService.TrackEvent(AppCenterConstants.CancelButtonTapped);

            if (!ViewModel.IsPhotoUploading)
            {
                ClosePage();
            }
        }
Esempio n. 4
0
        void HandleUploadPhotoCompleted(object sender, EventArgs e)
        {
            AppCenterService.TrackEvent(AppCenterConstants.UploadPhotoToSucceeded);

            Device.BeginInvokeOnMainThread(async() =>
            {
                await DisplayAlert("Photo Saved", string.Empty, "OK");
                ClosePage();
            });
        }
Esempio n. 5
0
        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;
        }
Esempio n. 6
0
        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);
            }
        }
Esempio n. 7
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            AppCenterService.TrackEvent(AppCenterConstants.AddFoodListPageAppeared);
        }
Esempio n. 8
0
        void HandleNoCameraFound(object sender, EventArgs e)
        {
            AppCenterService.TrackEvent(AppCenterConstants.NoCameraFound);

            DisplayErrorMessage("No Camera Found");
        }
Esempio n. 9
0
 void HandleAddFoodButtonClicked(object sender, EventArgs e)
 {
     AppCenterService.TrackEvent(AppCenterConstants.AddFoodListPageButtonTapped);
     Device.BeginInvokeOnMainThread(async() => await Navigation.PushModalAsync(new HealthClinicNavigationPage(new AddFoodPage())));
 }
Esempio n. 10
0
        async void HandleUploadPhotoFailed(object sender, string errorMessage)
        {
            AppCenterService.TrackEvent(AppCenterConstants.UploadPhotoFailed, AppCenterConstants.Error, errorMessage);

            await DisplayErrorMessage(errorMessage);
        }
Esempio n. 11
0
 void HandleCancelToolbarItemClicked(object sender, EventArgs e)
 {
     AppCenterService.TrackEvent(AppCenterConstants.CancelButtonTapped);
     ClosePage();
 }
Esempio n. 12
0
 public static Task <HttpResponseMessage> DeleteFoodFromAPI(int id)
 {
     AppCenterService.TrackEvent(AppCenterConstants.DeleteFoodAPITriggered);
     return(GetObjectFromAPI($"{APIConstants.DeleteFoodLogUrl}?id={id}"));
 }
Esempio n. 13
0
 public static Task <HttpResponseMessage> PostFoodPhoto(byte[] foodPhoto)
 {
     AppCenterService.TrackEvent(AppCenterConstants.UploadPhotoToAPITriggered);
     return(PostObjectToAPI(APIConstants.PostFoodUrl, foodPhoto));
 }
Esempio n. 14
0
 public static Task <IReadOnlyList <FoodLogModel> > GetFoodLogs()
 {
     AppCenterService.TrackEvent(AppCenterConstants.GetFoodLogsFromAPITriggered);
     return(GetObjectFromAPI <IReadOnlyList <FoodLogModel> >(APIConstants.GetFoodLogsUrl));
 }