Beispiel #1
0
 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);
 }
Beispiel #2
0
        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;
        }
Beispiel #3
0
        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);
 }