void proxy_getServiceQoSHistoricalInfoCompleted(object sender, getServiceQoSHistoricalInfoCompletedEventArgs e) { if (e.Error != null) { } else { ServiceQoSInfoForHistory results = e.Result; //if (results != null) { App app = (App)Application.Current; UIElement uiElement = app.RootVisual; if (uiElement is UserControl) { UserControl control = uiElement as UserControl; UIElement root = control.Content; if (root is SearchingResultPage) { SearchingResultPage srp = root as SearchingResultPage; //if user trigger new search during current search stage, current search results will be ignored and this iterative search will be ended. //if not, these search results will be add to current result page if (SearchingResultPage.ID == ID) { SearchingResultPage.showQoSDetailInformationInControls(results, view); } } } } } }
public void showServicePerformanceInfo(ServiceQoSInfoForHistory results) { StartDateTime_ForService = results.startDateTime; EndDateTime_ForService = results.endDateTime; setServiceQoSDateTimeFromAndTo(FromDateTime_ForService, ToDateTime_ForService); setServiceQoSDatePickerFromAndTo(); datePicker_From_ForService.DisplayDateStart = StartDateTime_ForService; datePicker_From_ForService.DisplayDateEnd = EndDateTime_ForService; StackPanel_ServiceQoS_Chart.DataContext = results.measurementInfoList; if (latestMeasurementInfoList_ForService == null) { latestMeasurementInfoList_ForService = results.measurementInfoList; } foreach (Series s in FGDCScoreChart_ServiceQoS.Series) { if (s is ColumnSeries) { ColumnSeries cs = s as ColumnSeries; var labelStyle = new Style(typeof(AxisLabel)); //when the num of measurement info is larger than 12, we will change FGDC Score Chart's view style if (results != null && results.measurementInfoList.Count > 12) { //cs.IndependentValueBinding.StringFormat = ""; labelStyle.Setters.Add(new Setter(AxisLabel.StringFormatProperty, "")); cs.IndependentAxis = new CategoryAxis { Orientation = AxisOrientation.X }; } else { labelStyle.Setters.Add(new Setter(AxisLabel.StringFormatProperty, "{0:M}")); cs.IndependentAxis = new CategoryAxis { Orientation = AxisOrientation.X }; } CategoryAxis axis = (CategoryAxis)cs.IndependentAxis; axis.AxisLabelStyle = labelStyle; //Style dps = cs.DataPointStyle; ////DependencyObject DO = VisualTreeHelper.GetChild(cs, 0); ////Border b = (Border)VisualTreeHelper.GetChild(dps, 0); //ToolTip tt = new ToolTip(); //tt.Content = "dfdsfs"; //Style tstyle = (Style)Application.Current.Resources["ToolTipTemplate"]; //tt.Style = tstyle; ////cs.SetValue(ToolTipService.ToolTipProperty, tt); //ControlTemplate ct = cs.Template; //ct.SetValue(ToolTipService.ToolTipProperty, tt); //dps.SetValue(ToolTipService.ToolTipProperty, tt); //object o1 = dps.GetValue(ToolTipService.ToolTipProperty); //dps.SetValue(ToolTipService.ToolTipProperty, tt); //foreach (Setter m in dps.Setters) //{ // if (m.Value is ControlTemplate) // { // ControlTemplate ct = m.Value as ControlTemplate; // //DependencyProperty SpeciesProperty = DependencyProperty.Register("", typeof(Grid), typeof(UserControl), null); // object o = ct.GetValue(ToolTipService.ToolTipProperty); // //object o = ct.GetValue(DependencyProperty ); // //ct.SetValue(ToolTipService.ToolTipProperty, tt); // DependencyProperty property = DependencyProperty.Register("Template", typeof(ControlTemplate), typeof(Style), new PropertyMetadata(null)); // object o2 = ct.GetValue(property); // //object o3 = ct.GetValue(System.Windows.CoreDependencyProperty); // DependencyObject vc = VisualTreeHelper.GetChild(dps, 0); // //DependencyObject t = dps.Template.LoadContent(); // //var fis = LogicalTreeHelperEx.GetChildrenByType<TextBlock>(t, true); // //var fis = VisualTreeHelperEx.GetChildsByType<TextBlock>(vc, true); // } //} } } //when the timespan excess 12 day, we will change ResponeTime Chart for Service's view style int num = (ToDateTime_ForService - FromDateTime_ForService).Days; foreach (Axis a in ResponeTimeChart_ServiceQoS.Axes) { if (a is DateTimeAxis) { DateTimeAxis da = a as DateTimeAxis; double interval = 20; if (results != null) { interval = getInterval_DateTimeAxis_LineSeriesChart(num, results.measurementInfoList.Count); } else { interval = getInterval_DateTimeAxis_LineSeriesChart(num, 0); } da.Interval = interval; } } }