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 Span
s to the Label.FormattedTextProperty
.
The following example demonstrates how to add multiple Span
s 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.
.NET MAUI Community Toolkit
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for