/// <summary> /// Initializes a new instance of the <see cref="TesterViewModel"/> class. /// </summary> public TesterViewModel() { _booksReadFromDatabase = new ObservableCollection <BookRead>(); _nationsReadFromDatabase = new ObservableCollection <Nation>(); _booksReadDatabase = new BooksReadDatabase(DatabaseConnectionString); _nationsReadDatabase = new NationDatabase(DatabaseConnectionString); _basePieChart = new BasePieChartViewModel(); SetupPieChartTypesByTitle(); _baseScatterChart = new BaseScatterChartViewModel(); SetupScatterChartTypesByTitle(); _baseLineChart = new BaseLineChartViewModel(); SetupLineChartTypesByTitle(); _baseGeoMapChart = new BaseGeoMapChartViewModel(); SetupGeoMapChartTypesByTitle(); _baseMultipleAxisLineChart = new BaseMultipleAxisLineChartViewModel(); SetupMultipleAxisLineChartTypesByTitle(); _baseColumnChart = new BaseColumnChartViewModel(); SetupColumnChartTypesByTitle(); _baseStackedAreaChart = new BaseStackedAreaChartViewModel(); SetupStackedAreaChartTypesByTitle(); }
/// <summary> /// The update Column chart command action. /// </summary> private void UpdateColumnChartCommandAction() { GeographyProvider geographyProvider; BooksReadProvider booksReadProvider; if (GetProviders(out geographyProvider, out booksReadProvider)) { Type columnChartType = _selectedColumnChart.GetGeneratorClass(); object instance = Activator.CreateInstance(columnChartType); _baseColumnChart = (BaseColumnChartViewModel)instance; _baseColumnChart.SetupPlot(geographyProvider, booksReadProvider); OnPropertyChanged(() => BaseColumnChart); } }