private bool CanCopy(DataGrid dataGrid) { if (dataGrid == null) return false; return dataGrid.HasRectangularCellSelection(); }