public void EditCategory(object item)
        {
            if (CanEditCategory(null))
            {
                if (SelectedCategory != null)
                {
                    CategoryData categoryItem = new CategoryData()
                    {
                        ProductCategoryID = SelectedCategory.ProductCategoryID,
                        Name     = CategoryName,
                        IsActive = CategoryIsActive
                    };
                    ProductCategory updatedProductCategory = CategoriesClient.UpdateCategory(categoryItem);

                    CategoryData categoryInList = CategoryList.FirstOrDefault(cat => cat.ProductCategoryID == updatedProductCategory.ProductCategoryID);
                    categoryInList.Name     = updatedProductCategory.Name;
                    categoryInList.IsActive = updatedProductCategory.IsActive;
                }
                else
                {
                    try
                    {
                        CategoryData categoryItem = new CategoryData()
                        {
                            ProductCategoryID = 0,
                            Name     = CategoryName,
                            IsActive = CategoryIsActive
                        };
                        ProductCategory updatedProductCategory = CategoriesClient.UpdateCategory(categoryItem);

                        if (updatedProductCategory != null)
                        {
                            CategoryList.Add(new CategoryData()
                            {
                                ProductCategoryID = updatedProductCategory.ProductCategoryID,
                                Name         = updatedProductCategory.Name,
                                IsActive     = updatedProductCategory.IsActive,
                                ProductCount = updatedProductCategory.ProductCount
                            });
                        }
                        else
                        {
                            MessageBox.Show("Save failed.");
                        }
                    }
                    catch (Exception ex)
                    {
                        Debug.WriteLine(ex.Message);
                    }
                }
            }
        }