Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF checkbox always unchecked when printing
    primarykey
    data
    text
    <p>I have a WPF Library project, and when i run it in visual studio it runs perfect, and the print function works as it should, but when i open the project from another application and print it, the checkboxes are always empty.</p> <p>I tried it without binding and with binding, but the checkboxes are always empty.</p> <p>How is this possible??</p> <p>Checkbox is like this:</p> <pre><code>&lt;CheckBoc IsChecked="true"/&gt; </code></pre> <p>and when i print it from visual studio it's checked but when i open the DLL with another application and print it to xps or printer, it's unchecked.</p> <p>The checkbox is in a view and when i click on a button, the view is added to an fixedpage and this is sended to the printer with printdialog. There is nothing special in code.</p> <p>Code to create fixedpage</p> <pre><code>// 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"); </code></pre> <p>Thanks, Xander</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload