Exemplo n.º 1
0
        public override void AddNewSubcat(BudgetSubcatEdit subcat)
        {
            var newSubcat = PlannedSubcat.Create(subcat.Name, subcat.Id);

            newSubcat.PropertyChanged += OnSubcatChanged;
            subcats.Add(newSubcat);
        }
Exemplo n.º 2
0
        public static BudgetPlannedCategory Create(BudgetCategoryTemplate categoryDesc)
        {
            var category = new BudgetPlannedCategory()
            {
                Name     = categoryDesc.Name,
                Id       = categoryDesc.Id,
                IsIncome = categoryDesc.IsIncome,
                IconName = categoryDesc.IconFileName
            };

            int index = 0;

            foreach (string subcatName in categoryDesc.subcategories)
            {
                var subcat = PlannedSubcat.Create(subcatName, index++);
                subcat.PropertyChanged += category.OnSubcatChanged;
                category.subcats.Add(subcat);
            }

            return(category);
        }