Label extensions

The Label extensions provide a series of extension methods that support configuring a Label.

FormattedText

The FormattedText method allows us to assign multiple Spans to the Label.FormattedTextProperty.

The following example demonstrates how to add multiple Spans to a Label using .FormattedText():

new Label().FormattedText(new[] 
{
    new Span { Text = "Here is a link to the docs: " },
    new Span { Text = "https://learn.microsoft.com/", TextDecorations = TextDecorations.Underline, TextColor = Colors.Blue }
});