// When a certain city is selected, we can view the amount of business // per zipcode with this function private void businessPerZipCodeButton_Click(object sender, RoutedEventArgs e) { ChartWindow chartWindow = new ChartWindow(); if (cityDataGrid.SelectedIndex > -1) { Business city = (Business)cityDataGrid.SelectedItem; chartWindow.ZipChart(city.city); chartWindow.SetTitle(String.Format("Number of Businesses Per Zipcode in {0}", city.city)); chartWindow.Title = "Businesses Per Zipcode"; chartWindow.Show(); chartWindow.Topmost = true; } }
// When a business is selected in the business search results, we can view the number of checkins that // the business has for every day of the week by opening a new window from our ChartWindow Class. private void showCheckinsButton_Click(object sender, RoutedEventArgs e) { ChartWindow chartWindow = new ChartWindow(); if (searchResultsDataGrid.SelectedIndex > -1) { Business business = (Business)searchResultsDataGrid.SelectedItem; chartWindow.CheckinChart(business.bid); chartWindow.SetTitle(business.bname); chartWindow.Title = "Business Checkins"; chartWindow.Show(); chartWindow.Topmost = true; } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.myWindow = ((Milestone_2.ChartWindow)(target)); return; case 2: this.myChart = ((System.Windows.Controls.DataVisualization.Charting.Chart)(target)); return; case 3: this.myColumns = ((System.Windows.Controls.DataVisualization.Charting.ColumnSeries)(target)); return; } this._contentLoaded = true; }