/// <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 the geo map chart command action. /// </summary> private void UpdateGeoMapChartCommandAction() { GeographyProvider geographyProvider; BooksReadProvider booksReadProvider; if (GetProviders(out geographyProvider, out booksReadProvider)) { Type geoMapChartType = _selectedGeoMapChart.GetGeneratorClass(); object instance = Activator.CreateInstance(geoMapChartType); _baseGeoMapChart = (BaseGeoMapChartViewModel)instance; _baseGeoMapChart.SetupPlot(geographyProvider, booksReadProvider); OnPropertyChanged(() => BaseGeoMapChart); } }