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();
            };
        }
Esempio n. 2
0
 public Budget()
 {
     IncomeValues = new BindableCollectionExt<IncomeValue>();
     SavingValues = new BindableCollectionExt<SavingValue>();
     BudgetPlanItems = new BindableCollectionExt<BudgetPlan>();
     Expenses = new BindableCollectionExt<Expense>();
 }
Esempio n. 3
0
 public Saving()
 {
     Values   = new BindableCollectionExt <SavingValue>();
     CashFlow = new CashFlow {
         Description = "Oszczędności"
     };
 }
Esempio 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>();
 }
Esempio 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);
 }
 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(); };
 }
Esempio 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(); };
 }
 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>();
 }
Esempio n. 9
0
 public Income()
 {
     Values = new BindableCollectionExt <IncomeValue>();
 }
Esempio n. 10
0
 public CalculatorViewModel()
 {
     Items = new BindableCollectionExt <CalculatorItemVM>();
     Items.PropertyChanged += delegate { NotifyOfPropertyChange(() => TotalValue); };
 }
 public BudgetPlanGroupItemVM(IEnumerable <BudgetPlanItemVM> items = null)
 {
     Items = new BindableCollectionExt <BudgetPlanItemVM>(items);
     Items.PropertyChanged   += (s, e) => { RefreshUI(); };
     Items.CollectionChanged += (s, e) => { RefreshUI(); };
 }
Esempio n. 12
0
 public Saving()
 {
     Values = new BindableCollectionExt<SavingValue>();
     CashFlow = new CashFlow { Description = "Oszczędności" };
 }
 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 CalculatorViewModel()
 {
     Items = new BindableCollectionExt<CalculatorItemVM>();
     Items.PropertyChanged += delegate { NotifyOfPropertyChange(() => TotalValue); };
 }
Esempio n. 15
0
 public BudgetCalculatorEquation()
 {
     Items = new BindableCollectionExt <BudgetCalculatorItem>();
 }
 public BudgetCalculatorEquation()
 {
     Items = new BindableCollectionExt<BudgetCalculatorItem>();
 }
Esempio 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;
 }
 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>();
 }
Esempio n. 21
0
 public Income()
 {
     Values = new BindableCollectionExt<IncomeValue>();
 }
Esempio 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(); };
 }
Esempio 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>();
 }