private void showChartWindow() { //在此执行你的代码 chartWindow = new ChartWindow(); if (chartWindow != null) { chartWindow.chartWindowClosing += ChartWindow_chartWindowClosing; } }
private void btn_chart_Click(object sender, RoutedEventArgs e) { if (!chartWindow.IsVisible) { bChartWindowIsOpen = true; chartWindow = new ChartWindow(); chartWindow.chartWindowClosing += ChartWindow_chartWindowClosing;//注册子窗口关闭事件 checkBox_decode.IsChecked = true; bHexDisplayFlag = true; chartWindow.ShowDialog(); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.chart_window = ((ChipseaUartHelper.ChartWindow)(target)); #line 9 "..\..\ChartWindow.xaml" this.chart_window.Loaded += new System.Windows.RoutedEventHandler(this.chart_window_Loaded); #line default #line hidden #line 9 "..\..\ChartWindow.xaml" this.chart_window.Closing += new System.ComponentModel.CancelEventHandler(this.chart_window_Closing); #line default #line hidden #line 9 "..\..\ChartWindow.xaml" this.chart_window.Closed += new System.EventHandler(this.chart_window_Closed); #line default #line hidden return; case 2: this.plotter = ((Microsoft.Research.DynamicDataDisplay.ChartPlotter)(target)); return; case 3: this.checkBox_origin = ((System.Windows.Controls.CheckBox)(target)); #line 38 "..\..\ChartWindow.xaml" this.checkBox_origin.Checked += new System.Windows.RoutedEventHandler(this.checkBox_origin_Checked); #line default #line hidden #line 38 "..\..\ChartWindow.xaml" this.checkBox_origin.Unchecked += new System.Windows.RoutedEventHandler(this.checkBox_origin_Unchecked); #line default #line hidden return; case 4: this.checkBox_shake = ((System.Windows.Controls.CheckBox)(target)); #line 42 "..\..\ChartWindow.xaml" this.checkBox_shake.Checked += new System.Windows.RoutedEventHandler(this.checkBox_shake_Checked); #line default #line hidden #line 42 "..\..\ChartWindow.xaml" this.checkBox_shake.Unchecked += new System.Windows.RoutedEventHandler(this.checkBox_shake_Unchecked); #line default #line hidden return; case 5: this.checkBox_moving = ((System.Windows.Controls.CheckBox)(target)); #line 45 "..\..\ChartWindow.xaml" this.checkBox_moving.Checked += new System.Windows.RoutedEventHandler(this.checkBox_moving_Checked); #line default #line hidden #line 45 "..\..\ChartWindow.xaml" this.checkBox_moving.Unchecked += new System.Windows.RoutedEventHandler(this.checkBox_moving_Unchecked); #line default #line hidden return; case 6: this.checkBox_iir = ((System.Windows.Controls.CheckBox)(target)); #line 48 "..\..\ChartWindow.xaml" this.checkBox_iir.Checked += new System.Windows.RoutedEventHandler(this.checkBox_iir_Checked); #line default #line hidden #line 48 "..\..\ChartWindow.xaml" this.checkBox_iir.Unchecked += new System.Windows.RoutedEventHandler(this.checkBox_iir_Unchecked); #line default #line hidden return; case 7: this.checkBox_average1 = ((System.Windows.Controls.CheckBox)(target)); #line 51 "..\..\ChartWindow.xaml" this.checkBox_average1.Checked += new System.Windows.RoutedEventHandler(this.checkBox_average_Checked); #line default #line hidden #line 51 "..\..\ChartWindow.xaml" this.checkBox_average1.Unchecked += new System.Windows.RoutedEventHandler(this.checkBox_average_Unchecked); #line default #line hidden return; case 8: this.btn_pause = ((System.Windows.Controls.Button)(target)); #line 62 "..\..\ChartWindow.xaml" this.btn_pause.Click += new System.Windows.RoutedEventHandler(this.btn_pause_Click); #line default #line hidden return; case 9: this.btn_reset = ((System.Windows.Controls.Button)(target)); #line 63 "..\..\ChartWindow.xaml" this.btn_reset.Click += new System.Windows.RoutedEventHandler(this.btn_reset_Click); #line default #line hidden return; case 10: this.textBlock_max = ((System.Windows.Controls.TextBlock)(target)); return; case 11: this.textBlock_min = ((System.Windows.Controls.TextBlock)(target)); return; case 12: this.textBlock_delta = ((System.Windows.Controls.TextBlock)(target)); return; case 13: this.label = ((System.Windows.Controls.Label)(target)); return; case 14: this.label_Copy = ((System.Windows.Controls.Label)(target)); return; case 15: this.label_Copy1 = ((System.Windows.Controls.Label)(target)); return; case 16: this.textBox_origin = ((System.Windows.Controls.TextBox)(target)); #line 71 "..\..\ChartWindow.xaml" this.textBox_origin.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.textBox_origin_DataContextChanged); #line default #line hidden return; case 17: this.textBox_shake_threshold = ((System.Windows.Controls.TextBox)(target)); #line 78 "..\..\ChartWindow.xaml" this.textBox_shake_threshold.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.textBox_shake_threshold_DataContextChanged); #line default #line hidden return; case 18: this.textBox_shake_count = ((System.Windows.Controls.TextBox)(target)); #line 87 "..\..\ChartWindow.xaml" this.textBox_shake_count.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.textBox_shake_count_DataContextChanged); #line default #line hidden return; case 19: this.textBox_average_times = ((System.Windows.Controls.TextBox)(target)); #line 102 "..\..\ChartWindow.xaml" this.textBox_average_times.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.textBox_average_times_DataContextChanged); #line default #line hidden return; case 20: this.textBox_moving_length = ((System.Windows.Controls.TextBox)(target)); #line 113 "..\..\ChartWindow.xaml" this.textBox_moving_length.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.textBox_moving_length_DataContextChanged); #line default #line hidden return; case 21: this.textBox_iir_order = ((System.Windows.Controls.TextBox)(target)); #line 128 "..\..\ChartWindow.xaml" this.textBox_iir_order.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.textBox_iir_order_DataContextChanged); #line default #line hidden return; case 22: this.textBox_iir_threshold = ((System.Windows.Controls.TextBox)(target)); #line 137 "..\..\ChartWindow.xaml" this.textBox_iir_threshold.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.textBox_iir_threshold_DataContextChanged); #line default #line hidden return; case 23: this.textBlock_log = ((System.Windows.Controls.TextBlock)(target)); return; case 24: this.btn_change = ((System.Windows.Controls.Button)(target)); #line 148 "..\..\ChartWindow.xaml" this.btn_change.Click += new System.Windows.RoutedEventHandler(this.btn_change_Click); #line default #line hidden return; } this._contentLoaded = true; }