A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/dotnet/communitytoolkit/maui/markup/extensions/label-extensions below:

Label extensions - .NET MAUI Community Toolkit - Community Toolkits for .NET

Label extensions

In this article

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 }
});

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.

Additional resources

In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4