Ejemplo n.º 1
0
        public RootVM()
        {
            InitMef();
            CreateSeries();

            Model       = new PlotModel();
            Model.Title = "Mortgage";

            Model.Axes.Add(new LinearAxis {
                Position = AxisPosition.Left
            });

            var dateAxis = new DateTimeAxis();

            dateAxis.Position = AxisPosition.Bottom;
            dateAxis.Minimum  = DateTimeAxis.ToDouble(MortgageConstants.GetDateFromMonthOfMortgage(0));
            dateAxis.Maximum  = DateTimeAxis.ToDouble(MortgageConstants.GetDateFromMonthOfMortgage(MortgageConstants.OriginalDurationInMonths));
            Model.Axes.Add(new DateTimeAxis {
                Position = AxisPosition.Bottom
            });

            FinancialData = new FinancialData(Settings.Default.DataFile);
            GazelleVM     = new GazelleVM(FinancialData);

            foreach (var seriesPair in _mefSeriesPlots)
            {
                Model.Series.Add(seriesPair.Value);
            }

            SavingsVM = new SavingsVM(FinancialData);
        }
Ejemplo n.º 2
0
        public SavingsVM(FinancialData financialData)
        {
            _gazelleSeries = GazelleSeries.Instance;
            _financialData = financialData;

            Model       = new PlotModel();
            Model.Title = "Savings Over Time";

            var valueAxis = new LinearAxis();

            valueAxis.Position = AxisPosition.Left;
            valueAxis.Minimum  = 0;
            Model.Axes.Add(valueAxis);

            var dateAxis = new DateTimeAxis();

            dateAxis.Position = AxisPosition.Bottom;
            dateAxis.Minimum  = DateTimeAxis.ToDouble(MortgageConstants.GetDateFromMonthOfMortgage(0));
            dateAxis.Maximum  = DateTimeAxis.ToDouble(MortgageConstants.GetDateFromMonthOfMortgage(MortgageConstants.OriginalDurationInMonths));
            Model.Axes.Add(new DateTimeAxis {
                Position = AxisPosition.Bottom
            });

            InitSeries();

            _financialData.DataChanged += OnFinancialDataChanged;
            RefreshSavingsSeries();
        }
Ejemplo n.º 3
0
 public GazelleVM(FinancialData financialData)
 {
     _financialData              = financialData;
     _financialData.DataChanged += OnFinancialDataChanged;
     OnFinancialDataChanged(null, EventArgs.Empty);
 }