public static CategoryViewData ToCategoryViewData(this Category Objectsource)
        {
            var newCategoryViewData = new CategoryViewData();

            newCategoryViewData.Id = Objectsource.ID;
            newCategoryViewData.Name = Objectsource.Name;
            newCategoryViewData.Balance = Objectsource.Balance;
            newCategoryViewData.Color = Objectsource.Color;

            if (Objectsource.TransactionList.HasLoadedOrAssignedValues)
            {
                newCategoryViewData.ListTransaction = Objectsource.TransactionList.Select(t => t.ToTransactionMinimalViewData()).ToList();
            }

            return newCategoryViewData;
        }
 public override void Dispose()
 {
     Category = new CategoryViewData();
     base.Dispose();
 }
 private void HandleDeleteCategoryTaskSelected(CategoryViewData args)
 {
     if (args != null)
     {
         MessageBoxResult result = MessageBox.Show("Do you really want to delete " + args.Name + "?", "Delete a category", MessageBoxButton.OKCancel);
         if (result == MessageBoxResult.OK)
         {
             CategoryService.DeleteCategorieById(args.Id);
             this.ListeCategory.Remove(args);
         }
     }
 }
 private void HandleFavoriteCategoryTaskSelected(CategoryViewData args)
 {
     //A ENLEVER
 }
 private void HandleEditCategoryTaskSelected(CategoryViewData args)
 {
     if (args != null)
     {
         NavigateTo("/View/EditCategory.xaml?categoryId={0}", args.Id);
     }
 }