public static void ShowWindow(GpuSpeedViewModel gpuSpeedVm = null) { ContainerWindow.ShowWindow(new ContainerWindowViewModel() { Title = "算力图表", IconName = "Icon_Speed", Width = 860, Height = 520, CloseVisible = Visibility.Visible, FooterVisible = Visibility.Collapsed }, ucFactory: (window) => { SpeedCharts uc = new SpeedCharts(); return(uc); }, beforeShow: (uc) => { if (gpuSpeedVm != null) { SpeedChartsViewModel vm = (SpeedChartsViewModel)uc.DataContext; SpeedChartViewModel item = vm.SpeedChartVms.FirstOrDefault(a => a.GpuSpeedVm == gpuSpeedVm); if (item != null) { vm.SetCurrentSpeedChartVm(item); } } }, fixedSize: false); }
private void DataGrid_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e) { DataGrid dg = (DataGrid)sender; if (dg.SelectedItem != null) { GpuSpeedViewModel gpuSpeedVm = (GpuSpeedViewModel)dg.SelectedItem; gpuSpeedVm.OpenChart.Execute(null); } else { SpeedCharts.ShowWindow(null); } e.Handled = true; }
private void DataGrid_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e) { DataGrid dg = (DataGrid)sender; Point p = e.GetPosition(dg); if (p.Y < dg.ColumnHeaderHeight) { return; } if (dg.SelectedItem != null) { GpuSpeedViewModel gpuSpeedVm = (GpuSpeedViewModel)dg.SelectedItem; gpuSpeedVm.OpenChart.Execute(null); } else { SpeedCharts.ShowWindow(null); } e.Handled = true; }
public static void ShowWindow(GpuSpeedViewModel gpuSpeedVm = null) { ContainerWindow.ShowWindow(new ContainerWindowViewModel { Title = "算力图", IconName = "Icon_SpeedChart", Width = 760, Height = 460, CloseVisible = Visibility.Visible, FooterVisible = Visibility.Collapsed }, ucFactory: (window) => { SpeedCharts uc = new SpeedCharts(); return(uc); }, beforeShow: (window, uc) => { if (gpuSpeedVm != null) { SpeedChartViewModel item = uc.Vm.SpeedChartVms.Items.FirstOrDefault(a => a.GpuSpeedVm == gpuSpeedVm); if (item != null) { uc.Vm.CurrentSpeedChartVm = item; } } }, fixedSize: false); }