public InterfaceSelectView(IChartViewModel chartViewModel) { InitializeComponent(); ChartViewModel = chartViewModel; this.Loaded += InterfaceView_Loaded; }
public InterfaceView(IChartViewModel chartViewModel) { InitializeComponent(); ChartViewModel = chartViewModel; this.Loaded += InterfaceView_Loaded; this.Closing += InterfaceView_Closing; }
/// <summary> /// 配置数据接口 /// </summary> /// <param name="propertyGridControl"></param> private void ConfigDataInterface(PropertyGridControl propertyGridControl) { if (propertyGridControl != null) { IChartControl chartControl = propertyGridControl.SelectedObject as IChartControl; if (chartControl != null) { IChartViewModel singleHisViewModel = chartControl.ChartViewModel; InterfaceSelectView interfaceView = new InterfaceSelectView(singleHisViewModel); OpenConfigWindow(propertyGridControl, interfaceView); } } }
/// <summary> /// 配置数据源 /// </summary> /// <param name="propertyGridControl"></param> private void ConfigDataSource(PropertyGridControl propertyGridControl) { if (propertyGridControl != null) { IChartControl chartControl = propertyGridControl.SelectedObject as IChartControl; if (chartControl != null) { IChartViewModel singleHisViewModel = chartControl.ChartViewModel; DataSourceSelectView dataSourceConfigView = new DataSourceSelectView(singleHisViewModel); OpenConfigWindow(propertyGridControl, dataSourceConfigView); } } }
private void OnTickerViewLoaded(object sender, RoutedEventArgs e) { int items = (int)this.ActualWidth / ItemWidth; IChartViewModel model = DataContext as IChartViewModel; if (model == null) { return; } model.SetTickerItems(items); }
private void OnTestCheckChanged(TestCheckChanged testCheckChanged) { var testerNode = testCheckChanged.TreeItem as TesterNodeViewModel; var testedNode = testCheckChanged.TreeItem as TestedTypeNodeViewModel; IChartViewModel chart = null; if (testerNode != null) { chart = this.Charts.FirstOrDefault(x => x.TestSuiteInfo.Equals(testerNode.TestSuiteInfo)); } if (chart != null && !(testerNode.IsChecked ?? true)) { this.Charts.Remove(chart); } if (chart == null && testerNode != null && (testerNode.IsChecked ?? true)) { this.Charts.Add(new ChartViewModel(testerNode.Lab, testerNode.TestSuiteInfo)); } chart = null; TestInfo test = null; if (testedNode != null) { chart = (from ch in this.Charts where Equals(ch.TestSuiteInfo, testedNode.TestInfo.Suite) select ch).FirstOrDefault(); } if (chart != null) { test = (from t in chart.Tests where t.TestId == testedNode.TestInfo.TestId select t).FirstOrDefault(); } if (chart != null && test != null && !(testedNode.IsChecked ?? true)) { chart.Remove(testedNode.TestInfo); } if (chart != null && test == null && (testedNode.IsChecked ?? true)) { chart.Add(testedNode.TestInfo); } }
public ChartRemoved(IChartViewModel chart) { this.Chart = chart; }
public DataSourceSelectView(IChartViewModel chartViewModel) { InitializeComponent(); ChartViewModel = chartViewModel; }