I’m using this control Here to be able to host Table that can bind to a list and to generate rows accordingly, that worked really good, however the table just doesn’t appear when printing to an XPS or PDF files, it does appear on the FlowDocument but it prints as blank , I tried changing the colors of Background and Foreground with no success , any suggestions ?
Share
I have just successfully implemented that example (Create Flexible UIs With Flow Documents And Data Binding) and did experience the same problem as you.
The problem was that the
DataContextfor theBindableRunis not being set correctly. As explained in the article you need to fix-up the context (using theFixupDataContexthelper method), set theDataContextfor theFrameworkContentElement, and clear the context that you previous ‘fixed’ up (using theUnFixupDataContexthelper method). The order of execution of these statements is critical. Re-read the article again and make sure you understand it; I had to re-read it several times and study the code to truly understand what he was talking about.I have taken the implementation one step further and added support for data binding other elements in the
TableCell. The changes comprises of using an attached property to identify elements that have theirDataContext‘fixed’ and then expanding the on the helper methods to also work againstFrameworkElementsin addition theFrameworkContentElements.HTH,
Edit:
Usage