C# 打印时始终未选中WPF复选框

C# 打印时始终未选中WPF复选框,c#,wpf,mvvm,checkbox,printing,C#,Wpf,Mvvm,Checkbox,Printing,我有一个WPF库项目,当我在visual studio中运行它时,它运行得非常完美,打印功能正常工作,但是当我从另一个应用程序打开项目并打印它时,复选框总是空的 我尝试了不绑定和绑定,但复选框总是空的 这怎么可能 复选框如下所示: <CheckBoc IsChecked="true"/> 谢谢, Xander在本例中是一种.NET错误行为。除非禁用复选框,否则复选框状态不会反映在打印输出上。单选按钮也是如此。由于以下问题,我自己复制了它: 请添加一个小但有效的示例来说明您的问题。我

我有一个WPF库项目,当我在visual studio中运行它时,它运行得非常完美,打印功能正常工作,但是当我从另一个应用程序打开项目并打印它时,复选框总是空的

我尝试了不绑定和绑定,但复选框总是空的

这怎么可能

复选框如下所示:

<CheckBoc IsChecked="true"/>
谢谢,
Xander在本例中是一种.NET错误行为。除非禁用复选框,否则复选框状态不会反映在打印输出上。单选按钮也是如此。由于以下问题,我自己复制了它:


请添加一个小但有效的示例来说明您的问题。我希望看到更多代码或更详细的问题。我把水晶球忘在家里了。我添加了一些代码和说明。没有什么比这更重要了。您对复选框应用了任何样式吗?没有,它只是一个简单的复选框,只有IsChecked属性。
// select printer and get printer settings
PrintDialog pd = new PrintDialog();
if (pd.ShowDialog(appView) != true) return;

// create a document
FixedDocument document = new FixedDocument();
document.DocumentPaginator.PageSize = new Size(pd.PrintableAreaWidth, pd.PrintableAreaHeight);

// create pages
FixedPage fixedPage = new FixedPage();
fixedPage.Width = document.DocumentPaginator.PageSize.Width;
fixedPage.Height = document.DocumentPaginator.PageSize.Height;

IPageViewModel pageModel = _applicationViewModel.CurrentPageViewModel;
UserControl pageView = this.GetView(pageModel);

// Add Viewmodel to Page 1
pageView.DataContext = pageModel;
pageView.Width = fixedPage.Width - 10;
pageView.Height = fixedPage.Height - 10;
pageView.Margin = new Thickness(60, 0, 10, 10);
fixedPage.Children.Add(pageView);

// add the pages to the document
PageContent overviewContent = new PageContent();
((IAddChild)overviewContent).AddChild(fixedPage);
document.Pages.Add(overviewContent);

/// and print
pd.PrintDocument(document.DocumentPaginator, "Document");