This question görünüyor oluşturmak olduğunu ne istersen. here cevabı, isteğinize göre bir çözüm sunmalıdır.
cevap özeti, aşağıdaki örneğe benzer bir FlowDocument
kullanmak edilir:
<FlowDocument>
<Paragraph>
<Floater HorizontalAlignment="Left">
<BlockUIContainer>
<Image Source="/FlowDocumentTest;component/dog.png" Width="100" />
</BlockUIContainer>
</Floater>
Here is where the text goes to wrap around the image.
</Paragraph>
</FlowDocument>
Güncelleme soru devletler olarak
, artık TextBlock/Çalıştır oluşturmak için bazı C# kodu kullanıyor Öğeler, her ikisi de bir Paragraf nesnesinin çocukları olabilir. Yani basitçe adını siz Paragraph
şöyle:
<FlowDocument>
<Paragraph x:Name="textPara">
<Floater HorizontalAlignment="Left">
<BlockUIContainer>
<Image Source="/FlowDocumentTest;component/dog.png" Width="100" />
</BlockUIContainer>
</Floater>
</Paragraph>
</FlowDocument>
Ardından C#, yani textPara ait Inlines
özelliğine Oluşturulan TextBlock
s veya Run
s eklenir
var runToInsert = new Run("Some text to display");
textPara.Inlines.InsertAfter(textPara.Inlines.FirstInline, runToInsert);
Üzerinde dur! Ayrıca bkz. [This] (http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.richtextblockoverflow (v = win.10) .aspx) – wpfwannabe