Adding a line to a textblock programmatically

前端 未结 2 1875
南笙
南笙 2021-01-19 18:03

I know how to add a control to the canvas/grid/layout- simply by calling canvas.Childern.Add(). However, when I want to embed something inside a textblock, I ca

2条回答
  •  囚心锁ツ
    2021-01-19 18:37

    I Believe if you have multiple lines you must use the Inlines property which is a collection that contains a list of inline elements. You can't directly add text to it, you must add it to an Inline object - such as a Run.

提交回复
热议问题