The problem with my code is that I created a dependency property, but I never set the property to anything. When I did this in the constructor, it worked:
public TraceChartView()
{
InitializeComponent();
CopyToClipboardCommand = new RelayCommand(DoCopyToClipboard);
}
For my implementation, I don't really need a dependency property, and the whole thing can be implemented with a single line in the code behind:
public RelayCommand CopyToClipboardCommand { get { return new RelayCommand(DoCopyToClipboard); } }
with this xaml:
<local:TraceChartView x:Name="chartView"/>
<Button Content="Copy To Clipboard"
Command="{Binding ElementName=chartView,
Path=CopyToClipboardCommand}"/>
I hope that this will help some other WPF beginner.