Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8363645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:13:53+00:00 2026-06-09T12:13:53+00:00

I answer to a previous question, the following solution was provided (and helped greatly):

  • 0

I answer to a previous question, the following solution was provided (and helped greatly):

<sdk:Label>
    <TextBlock Text="This is underlined" TextDecorations="Underline" />
</sdk:Label>

It seems that the following XAML would achieve the same result:

    <TextBlock Text="This is underlined" TextDecorations="Underline" />

So my question is: Why would one want to put a TextBlock in a Label? What advantages does that give you? What is the criteria to do it one way or another?

As you probably guessed, there is probably something fundamental about the XAML objects that I’m not understanding yet.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:13:55+00:00Added an answer on June 9, 2026 at 12:13 pm

    In most general cases, it does not give you any advantages.

    In fact, in the case you have defined, the TextBlock should not be wrapped with a Label.

    Label is a ContentControl. It renders any type of content given to it using the ContentTemplate. By default, when you try to render a string, it internally uses TextBlock to render it.

    So, following are identical:

    <Label>
        Text
    </Label>
    
    <Label>
        <TextBlock>
            Text
        </TextBlock>
    </Label>
    

    In this case, using a Label only gives you an advantage if you have a custom ContentTemplate defined using an implicit style inside App.xaml so that it is applied to all the Labels in the application.

    Otherwise, it’s the same and only a TextBlock should be used if the only requirement is to display some underlined text.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code adapted from a previous question/answer: var str = $('title').text();
I've found an answer to a previous question about javascript short hand for this
Expanding on Jon Skeet's answer to This Previous Question . Skeet doesn't address the
This question is based on my previous question which I got a working answer
This is a CSS related question, I got one good answer from my previous
Following on from the excellent answer to my previous question: Linq Entity Framework generic
Following my previous question came a quick and great answer, however it turned out
On the following answer to a previous question someone mentioned an auto-casting bool I
In a previous question of mine I got the following answer, which is perfect,
I'm following on from a previous question . The answer I accepted involves using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.