1、首先在XMAL文件里定义资源
<Window.Resources>
<DataTemplate x:Key="Data">
<Grid>
<StackPanel>
<Image Source="{Binding Content}"
dxp:ExportSettings.TargetType="Image"
dxp:ExportSettings.BorderThickness="0" />
</StackPanel>
</Grid>
</DataTemplate>
</Window.Resources>
2、加入引用
xmlns:dxp="http://schemas.devexpress.com/winfx/2008/xaml/printing"
3、具体实现代码
SimpleLink sl = new SimpleLink();
sl.DetailCount = 1;
sl.DetailTemplate = (DataTemplate)Resources["Data"];//资源
sl.CreateDetail += new EventHandle