wpf - How would I databind a Paragraph to a TextBlock? -


How can I take a paragraph object and how to data it on a text block for use in the datatypleplate? Can I bring There is nothing simple binding, one of the paragraph objects toasting () .

Inline property has added me a list of TextRun which creates manual paragraphs, but it can not be compelled and I can actually work with a binding based solution.

The edited question to focus on what I really need to do.

Here's an example using nested items control Unfortunately, this whole paragraph is one Instead of putting in a text block, a text block will make inline:

  & lt; Grid xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: sys = "clr-namespace: system; assembly = mscorlib" xmlns: x = "http://schemas.microsoft Com / winfx / 2006 / xaml "& gt; & Lt; Grid.Resources & gt; & Lt; FlowDocument x: key = "document" & gt; & Lt; Paragraphs & gt; & Lt; Run xml: space = "preserve" & gt; This is the first paragraph & lt; / Run> & Lt; Run & gt; Quick brown fox jumps on lazy dogs. & Lt; / Run> & Lt; / Paragraph & gt; & Lt; Paragraphs & gt; & Lt; Run xml: space = "preserve" & gt; This is the second paragraph & lt; / Run> & Lt; Run & gt; Two hot jokes fax help my big quiz & Lt; / Run> & Lt; / Paragraph & gt; & Lt; Paragraphs & gt; & Lt; Run xml: space = "preserve" & gt; This is the third paragraph & lt; / Run & gt; Run & gt; Black Quartz Sphinx, my fast judge! & Lt; / Run> & Lt; / Paragraph & gt; & Lt; / FlowDocument & gt; & Lt; Datamapplet datatype = "{x: type paragraph}" & gt; & Lt; ItemsControl ItemSource = "{Binding Inline}" ishtatavishvil = "False" & gt; & Lt; ItemsControl.ItemsPanel & gt; & Lt; ItemsPanelTemplate & gt; & Lt; WrapPanel / & gt; & Lt; / ItemsPanelTemplate & gt; & Lt; /ItemsControl.ItemsPanel> & Lt; / ItemsControl> & Lt; / DataTemplate & gt; & Lt; /Grid.Resources> & Lt; ListBox ItemsSource = "{Binding Block, Source = {Static Resources Document}}" /> & Lt; / Grid & gt;  

If you want one paragraph element you might be suggested and use only the rich textbox to read, or so that the property of these inlays can be constrained.


Comments