private async void DeleteProduct()
        {
            var answer = await Application.Current.MainPage.DisplayAlert(
                Languages.Confirm,
                Languages.DeleteConfirmation,
                Languages.yes,
                Languages.No);

            if (!answer)
            {
                return;
            }

            var connection = await apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                await Application.Current.MainPage.DisplayAlert(
                    Languages.Error,
                    connection.Message,
                    Languages.Accept);

                return;
            }

            var url        = Application.Current.Resources["UrlAPI"].ToString();
            var prefix     = Application.Current.Resources["UrPrefix"].ToString();
            var controller = Application.Current.Resources["UrlProductsController"].ToString();
            var response   = await apiService.Delete(url, prefix, controller, ProductId);

            if (!response.IsSuccess)
            {
                await Application.Current.MainPage.DisplayAlert(
                    Languages.Error,
                    response.Message,
                    Languages.Accept);

                return;
            }

            var productsViewModel = ProductsViewModel.GetInstce();
            var deletedProdcut    = productsViewModel.Products.Where(p => p.ProductId == ProductId).FirstOrDefault();

            if (deletedProdcut != null)
            {
                productsViewModel.Products.Remove(deletedProdcut);
            }
        }
        private async void Save()
        {
            if (string.IsNullOrEmpty(Description))
            {
                await Application.Current.MainPage.DisplayAlert(
                    Languages.Error,
                    Languages.DescriptionError,
                    Languages.Accept);

                return;
            }

            if (string.IsNullOrEmpty(Price))
            {
                await Application.Current.MainPage.DisplayAlert(
                    Languages.Error,
                    Languages.Price_Error,
                    Languages.Accept);

                return;
            }

            var price = decimal.Parse(Price);

            if (price < 0)
            {
                await Application.Current.MainPage.DisplayAlert(
                    Languages.Error,
                    Languages.Price_Error,
                    Languages.Accept);

                return;
            }

            IsRunning = true;
            IsEnabled = false;

            var connection = await apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                IsRunning = false;
                IsEnabled = true;
                await Application.Current.MainPage.DisplayAlert(
                    Languages.Error,
                    connection.Message,
                    Languages.Accept);

                return;
            }

            byte[] imageArray = null;
            if (file != null)
            {
                imageArray = FilesHelper.ReadFully(file.GetStream());
            }


            var product = new Product
            {
                Description = Description,
                Price       = price,
                Remarks     = Remarks,
                ImageArray  = imageArray
            };

            var url        = Application.Current.Resources["UrlAPI"].ToString();
            var prefix     = Application.Current.Resources["UrPrefix"].ToString();
            var controller = Application.Current.Resources["UrlProductsController"].ToString();
            var response   = await apiService.Post(url, prefix, controller, product);

            if (!response.IsSuccess)
            {
                IsRunning = false;
                IsEnabled = true;
                await Application.Current.MainPage.DisplayAlert(
                    Languages.Error,
                    response.Message,
                    Languages.Accept);

                return;
            }

            var newProduct = (Product)response.Result;
            var viewModel  = ProductsViewModel.GetInstce();

            viewModel.Products.Add(new productItemViewModel
            {
                Description = newProduct.Description,
                ImageArray  = newProduct.ImageArray,
                ImagePath   = newProduct.ImagePath,
                IsAvailable = newProduct.IsAvailable,
                Price       = newProduct.Price,
                ProductId   = newProduct.ProductId,
                PublishOn   = newProduct.PublishOn,
                Remarks     = newProduct.Remarks,
            });
            IsRunning = false;
            IsEnabled = true;

            await Application.Current.MainPage.Navigation.PopAsync();
        }