Exemplo n.º 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);
 }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 4
0
 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);
 }