Wpf flowDocument处的打印问题';s内部复选框

Wpf flowDocument处的打印问题';s内部复选框,wpf,printing,checkbox,flowdocument,Wpf,Printing,Checkbox,Flowdocument,我想知道这是否是打印flowdocument的正确方法:( 但这是一个非常奇怪的现象 我的代码如下: string flowDocString = " <FlowDocument xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>" + " <Section>" + " <Paragraph>" + " <CheckBo

我想知道这是否是打印flowdocument的正确方法:( 但这是一个非常奇怪的现象

我的代码如下:

string flowDocString =
" <FlowDocument xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>" +
"      <Section>" +
"          <Paragraph>" +
"              <CheckBox IsChecked='True'>Test</CheckBox>" +
"          </Paragraph>" +
"      </Section>" +
" </FlowDocument>";
FlowDocument flowDoc = (FlowDocument)XamlReader.Load(new MemoryStream(new UTF8Encoding().GetBytes(flowDocString)));

PrintDialog printDlg = new PrintDialog();
IDocumentPaginatorSource idpSource = flowDoc;
printDlg.PrintDocument(idpSource.DocumentPaginator, "Hello WPF Printing.");
string flowDocString =
" <FlowDocument xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>" +
"      <Section>" +
"          <Paragraph>" +
"              <CheckBox IsChecked='True' IsEnabled='False'>Test</CheckBox>" +
"          </Paragraph>" +
"      </Section>" +
" </FlowDocument>";
string-flowDocString=
" " +
"      " +
"          " +
“测试”+
"          " +
"      " +
" ";
FlowDocument flowDoc=(FlowDocument)XamlReader.Load(新的MemoryStream(新的UTF8Encoding().GetBytes(flowDocString));
PrintDialog printDlg=新建PrintDialog();
IDocumentPaginatorSource idpSource=flowDoc;
printDlg.PrintDocument(idpSource.DocumentPaginator,“Hello WPF Printing.”);
当我使用这段代码时,复选框的状态仍然是未选中的。 但是当我像这样修改flowDocString时:

string flowDocString =
" <FlowDocument xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>" +
"      <Section>" +
"          <Paragraph>" +
"              <CheckBox IsChecked='True'>Test</CheckBox>" +
"          </Paragraph>" +
"      </Section>" +
" </FlowDocument>";
FlowDocument flowDoc = (FlowDocument)XamlReader.Load(new MemoryStream(new UTF8Encoding().GetBytes(flowDocString)));

PrintDialog printDlg = new PrintDialog();
IDocumentPaginatorSource idpSource = flowDoc;
printDlg.PrintDocument(idpSource.DocumentPaginator, "Hello WPF Printing.");
string flowDocString =
" <FlowDocument xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>" +
"      <Section>" +
"          <Paragraph>" +
"              <CheckBox IsChecked='True' IsEnabled='False'>Test</CheckBox>" +
"          </Paragraph>" +
"      </Section>" +
" </FlowDocument>";
string-flowDocString=
" " +
"      " +
"          " +
“测试”+
"          " +
"      " +
" ";
如果修改,上述结果将按预期显示。 怎么会这样?请告诉我为什么