void proxy_getWMSLayersQoSHistoricalInfoCompleted(object sender, getWMSLayersQoSHistoricalInfoCompletedEventArgs e) { if (e.Error != null) { } else { LayerQoSInfoForHistory results = e.Result; if (results != null && results.measurementInfoList.Count > 0) { 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) { if (view != null) { view.serviceQualityInfoPanel.showLayerHistoryInfoOnChart(results); } } } } } } }
public void showLayerHistoryInfoOnChart(LayerQoSInfoForHistory layerQoSInfoForHistory) { Grid_WMSLayerQoS.Visibility = Visibility.Visible; StartDateTime_ForLayer = layerQoSInfoForHistory.startDateTime; EndDateTime_ForLayer = layerQoSInfoForHistory.endDateTime; setLayerQoSDateTimeFromAndTo(FromDateTime_ForLayer, ToDateTime_ForLayer); setLayerQoSDatePickerFromAndTo(); datePicker_From_ForLayer.DisplayDateStart = StartDateTime_ForLayer; datePicker_From_ForLayer.DisplayDateEnd = EndDateTime_ForLayer; ResponeTimeChart_Layer.DataContext = layerQoSInfoForHistory.measurementInfoList; //when the timespan excess 12 day, we will change ResponeTime Chart for Layer's view style int num = (ToDateTime_ForLayer - FromDateTime_ForLayer).Days; foreach (Axis a in ResponeTimeChart_Layer.Axes) { if (a is DateTimeAxis) { DateTimeAxis da = a as DateTimeAxis; double interval = 20; if (layerQoSInfoForHistory != null) { interval = getInterval_DateTimeAxis_LineSeriesChart(num, layerQoSInfoForHistory.measurementInfoList.Count); } else { interval = getInterval_DateTimeAxis_LineSeriesChart(num, 0); } da.Interval = interval; } } }