示例#1
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            AppCenterService.TrackEvent(AppCenterConstants.FoodListPageAppeared);

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

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

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

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

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

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

            await DisplayErrorMessage(errorMessage);
        }
示例#11
0
 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));
 }