public CashFlowTypesViewModel(IShellViewModel shell, IDatabase database, IConfigurationManager configuration, ICachedService cashedService, IEventAggregator eventAggregator)
            : base(shell, database, configuration, cashedService, eventAggregator)
        {
            SuppressEvent = false;
            _cashFlows = new BindableCollectionExt<CashFlow>();
            _cashFlows.PropertyChanged += (s, e) =>
            {
                OnPropertyChanged(s, e);
                CachedService.Clear(CachedServiceKeys.AllCashFlows);
            };

            _cashFlowGroups = new BindableCollectionExt<CashFlowGroup>();
            _cashFlowGroups.PropertyChanged += (s, e) =>
            {
                if (SuppressEvent == true)
                {
                    return;
                }
                OnPropertyChanged(s, e);

                CachedService.Clear(CachedServiceKeys.AllCashFlowGroups);
                CachedService.Clear(CachedServiceKeys.AllCashFlows);
                var cashFlowGroup = s as CashFlowGroup;
                _cashFlows.Where(x => x.CashFlowGroupId == cashFlowGroup.Id)
                    .ForEach(x => x.Group = cashFlowGroup);
                NewCashFlowGroup = null;
                NewCashFlowGroup = CashFlowGroups.First();
            };
        }
Ejemplo n.º 2
0
 public Budget()
 {
     IncomeValues = new BindableCollectionExt<IncomeValue>();
     SavingValues = new BindableCollectionExt<SavingValue>();
     BudgetPlanItems = new BindableCollectionExt<BudgetPlan>();
     Expenses = new BindableCollectionExt<Expense>();
 }
Ejemplo n.º 3
0
 public Saving()
 {
     Values   = new BindableCollectionExt <SavingValue>();
     CashFlow = new CashFlow {
         Description = "Oszczędności"
     };
 }
Ejemplo n.º 4
0
 public ExpensesViewModel(IShellViewModel shell, IDatabase database, IConfigurationManager configuration, ICachedService cashedService, IEventAggregator eventAggregator)
     : base(shell, database, configuration, cashedService, eventAggregator)
 {
     _filteredBudgetExpenses = new List <Expense>();
     ExpensesGridCashFlows   = new BindableCollectionExt <CashFlow>();
     CashFlows                  = new BindableCollectionExt <CashFlow>();
     Filter                     = new ExpensesFilterVM(EventAggregator);
     IsFilteringEnabled         = true;
     ExpensesFilteringViewModel = IoC.Get <ExpensesFilteringViewModel>();
 }
Ejemplo n.º 5
0
 public BudgetCalculationsViewModel(IShellViewModel shell, IDatabase database, IConfigurationManager configuration, ICachedService cashedService, IEventAggregator eventAggregator)
     : base(shell, database, configuration, cashedService, eventAggregator)
 {
     SuppressEvent              = false;
     Equations                  = new BindableCollectionExt <BudgetCalculatorEquation>();
     BudgetCalculatorEvaluator  = IoC.Get <BudgetCalculatorEvaluator>();
     Equations.PropertyChanged += (s, e) => { if (!SuppressEvent)
                                              {
                                                  Save(s as Entity);
                                              }
     };
     EventAggregator.Subscribe(this);
 }
Ejemplo n.º 6
0
 public BudgetPlanItemVM(Budget budget, CashFlow cashFlow, IEnumerable<BudgetPlan> planItems)
 {
     Budget = budget;
     CashFlow = cashFlow;
     Values = new BindableCollectionExt<BudgetPlan>(planItems);
     Values.CollectionChanged += (s, e) =>
         {
             if (e.Action == NotifyCollectionChangedAction.Remove)
             {
                 var item = e.OldItems[0] as BudgetPlan;
                 Budget.BudgetPlanItems.Remove(item);
             }
             RefreshUI();
         };
     Values.PropertyChanged += (s, e) => { RefreshUI(); };
 }
Ejemplo n.º 7
0
 public BudgetPlanItemVM(Budget budget, CashFlow cashFlow, IEnumerable <BudgetPlan> planItems)
 {
     Budget   = budget;
     CashFlow = cashFlow;
     Values   = new BindableCollectionExt <BudgetPlan>(planItems);
     Values.CollectionChanged += (s, e) =>
     {
         if (e.Action == NotifyCollectionChangedAction.Remove)
         {
             var item = e.OldItems[0] as BudgetPlan;
             Budget.BudgetPlanItems.Remove(item);
         }
         RefreshUI();
     };
     Values.PropertyChanged += (s, e) => { RefreshUI(); };
 }
Ejemplo n.º 8
0
 public RevenuesViewModel(IShellViewModel shell, IDatabase database, IConfigurationManager configuration, ICachedService cashedService, IEventAggregator eventAggregator)
     : base(shell, database, configuration, cashedService, eventAggregator)
 {
     AvailableIncomes = new BindableCollectionExt<Income>();
     AvailableSavings = new BindableCollectionExt<Saving>();
 }
Ejemplo n.º 9
0
 public Income()
 {
     Values = new BindableCollectionExt <IncomeValue>();
 }
Ejemplo n.º 10
0
 public CalculatorViewModel()
 {
     Items = new BindableCollectionExt <CalculatorItemVM>();
     Items.PropertyChanged += delegate { NotifyOfPropertyChange(() => TotalValue); };
 }
Ejemplo n.º 11
0
 public BudgetPlanGroupItemVM(IEnumerable <BudgetPlanItemVM> items = null)
 {
     Items = new BindableCollectionExt <BudgetPlanItemVM>(items);
     Items.PropertyChanged   += (s, e) => { RefreshUI(); };
     Items.CollectionChanged += (s, e) => { RefreshUI(); };
 }
Ejemplo n.º 12
0
 public Saving()
 {
     Values = new BindableCollectionExt<SavingValue>();
     CashFlow = new CashFlow { Description = "Oszczędności" };
 }
Ejemplo n.º 13
0
 public BudgetPlanViewModel(IShellViewModel shell, IDatabase database, IConfigurationManager configuration, ICachedService cashedService, IEventAggregator eventAggregator)
     : base(shell, database, configuration, cashedService, eventAggregator)
 {
     AllBudgetPlanList     = new BindableCollectionExt <BudgetPlanItemVM>();
     BudgetPlanListGrouped = new BindableCollectionExt <BudgetPlanGroupItemVM>();
 }
Ejemplo n.º 14
0
 public CalculatorViewModel()
 {
     Items = new BindableCollectionExt<CalculatorItemVM>();
     Items.PropertyChanged += delegate { NotifyOfPropertyChange(() => TotalValue); };
 }
Ejemplo n.º 15
0
 public BudgetCalculatorEquation()
 {
     Items = new BindableCollectionExt <BudgetCalculatorItem>();
 }
 public BudgetCalculatorEquation()
 {
     Items = new BindableCollectionExt<BudgetCalculatorItem>();
 }
Ejemplo n.º 17
0
 public SavingsViewModel(IShellViewModel shell, IDatabase database, IConfigurationManager configuration, ICachedService cashedService, IEventAggregator eventAggregator)
     : base(shell, database, configuration, cashedService, eventAggregator)
 {
     _savings = new BindableCollectionExt<Saving>();
     _savings.PropertyChanged += OnSavingPropertyChanged;
 }
Ejemplo n.º 18
0
 public BudgetPlanViewModel(IShellViewModel shell, IDatabase database, IConfigurationManager configuration, ICachedService cashedService, IEventAggregator eventAggregator)
     : base(shell, database, configuration, cashedService, eventAggregator)
 {
     AllBudgetPlanList = new BindableCollectionExt<BudgetPlanItemVM>();
     BudgetPlanListGrouped = new BindableCollectionExt<BudgetPlanGroupItemVM>();
 }
 public CashFlowGroupDeleteConfirmationViewModel(IShellViewModel shell, IDatabase database, IConfigurationManager configuration, ICachedService cashedService, IEventAggregator eventAggregator)
     : base(shell, database, configuration, cashedService, eventAggregator)
 {
     CashFlowGroups = new BindableCollectionExt<CashFlowGroup>();
 }
 public CashFlowGroupDeleteConfirmationViewModel(IShellViewModel shell, IDatabase database, IConfigurationManager configuration, ICachedService cashedService, IEventAggregator eventAggregator)
     : base(shell, database, configuration, cashedService, eventAggregator)
 {
     CashFlowGroups = new BindableCollectionExt <CashFlowGroup>();
 }
Ejemplo n.º 21
0
 public Income()
 {
     Values = new BindableCollectionExt<IncomeValue>();
 }
Ejemplo n.º 22
0
 public SavingsViewModel(IShellViewModel shell, IDatabase database, IConfigurationManager configuration, ICachedService cashedService, IEventAggregator eventAggregator)
     : base(shell, database, configuration, cashedService, eventAggregator)
 {
     _savings = new BindableCollectionExt <Saving>();
     _savings.PropertyChanged += OnSavingPropertyChanged;
 }
 public BudgetPlanGroupItemVM(IEnumerable<BudgetPlanItemVM> items = null)
 {
     Items = new BindableCollectionExt<BudgetPlanItemVM>(items);
     Items.PropertyChanged += (s, e) => { RefreshUI(); };
     Items.CollectionChanged += (s, e) => { RefreshUI(); };
 }
Ejemplo n.º 24
0
 public IncomesViewModel(IShellViewModel shell, IDatabase database, IConfigurationManager configuration, ICachedService cashedService, IEventAggregator eventAggregator)
     : base(shell, database, configuration, cashedService, eventAggregator)
 {
     _incomes = new BindableCollectionExt <Income>();
 }