The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

[UWP][VB][XAML]Adding/Editing TextBlock Inlines/Runs in Codebehind RRS feed

  • Question

  • As we all know, TextBlock has an Inlines property that contains Runs. This is not hard to edit in static XAML code, but how can I add or edit these in my codebehind? Intellisense doesn't even show an Inlines property, so I am not sure what to do. Any ideas? Thanks.

    Nathan Sokalski

    Monday, July 15, 2019 6:59 PM


  • Hi,

    So you want to add things to the Inline property of the TextBlock. You could try to add runs or other things to the TextBlock.Inlines like this:

                Run run = new Run();
                run.Text = "This is some text.";
                Span span = new Span();
                Italic Italic = new Italic();
    For more information, please refer this: Inline Class

    Best regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Tuesday, July 16, 2019 2:21 AM