I have a WPF User Control with a RichTextBox in it. I am consuming this User Control in one the WPF pages. Alongwith it, I am using a FlowDocumentPageViewer with a ListView in it. Later on, I am assigning the data of ListView in the RichTextBox using a FlowDocument. Everything goes well but the wrap functionality does not work in it.
On behalf of @Sumit (who asked the question)
below is the code snippet which is currently being used.
1) User Control with RichTextBox
2) Method to bind FlowDocument to RichTextBox
3)Consumer Page
4) Consumer Page Code behind
To diagnose the problem for wrap functionality, I segregated the components being used in the current XAML code into different solutions.
Please refer the following description to understand the steps followed in the analysis:-
After isolating the components in this way, I observed that while integrating the User Control with FlowDocumentPageViewer the wrap functionality stopped working.
This was resolved when I put Style with property Text Wrapping set to Wrap for the FlowDocument itself.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.