示例#1
0
        // Add new category
        public void AddCategory(CategoryDto category)
        {
            int id          = ++ViewModel.CategoryCollection.LastCategoryId;
            var newCategory = new CategoryDto {
                CategoryId = id, Name = ViewModel.NewCategory.Name, CategoryType = ViewModel.NewCategory.CategoryType, ParentUserId = UserLoggedIn.UserId
            };

            ViewModel.CategoryCollection.Categories.Add(newCategory);
            RestClient.AddCategory(newCategory);
            ViewModel.NavigationViewItems.AddMenuItem(newCategory);
            ViewModel.NewCategory.Name = String.Empty;
        }