I've taken the Copy from XamDataGrid example found here:
http://blogs.infragistics.com/wpf/articles/xamdatagrid-copying-to-excel-via-the-clipboard.aspx
and created a static helper class, that contains all the private static "copying to clip board" methods along with a public method to add copying. This method is as follows.
{
grid.CommandBindings.Add(copyCommandBinding);
grid.InputBindings.Add(
new KeyBinding(copyCommand, new KeyGesture(Key.C, ModifierKeys.Control)));
What are the drawbacks to calling this helper method as:
CopyHelper.AddCopy(xamDataGrid1, new RoutedCommand());
VS.
CopyHelper
.AddCopy(xamDataGrid1, CopyCommand);
Where CopyCommand is a static RoutedCommand.
The only thing that jumps out at me is that there may be a duplicate in the RoutedCommand should you add the copy ability to multiple grids, but maybe you guys see something I do not.
thanks in advance.