locked
TextDecoration support in Windows 8.1

    Question

  • Hello,

    I am currently developing an application for Windows 8.1, and I would like to use the TextDecoration class. In the documentation, I can see there is the Windows 8.1 compatibility and the class exists in the Framework 4.5.

    I already added the Windows SDK reference and the Behavior SDK reference. But, I can't find any TextDecoration class (or TextDecorations property).

    My question is the following: Why? Is there a way to include this class?

    Thanks.

    Thursday, March 6, 2014 11:48 AM

Answers

  • Hi BatRocchia,

    Where you find the documentation, can you share us the link?

    I'm not sure if TextDecoration is supported by now, we can still have several ways to make the text looks good. For instance the underline effect, TextBlock applied with Underline element, or apply a line over the text. 

    Do you have some specific scenario that we can help?

                 <TextBlock>
                    <Underline>
                        <Run Text="xxxxxxxxxxx" />
                    </Underline>
                </TextBlock>
        <Grid>
            <TextBlock Text="This is a test"/>
            <Line Stretch="Fill" Stroke="white" StrokeThickness="2" />
        </Grid>


    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by BatRocchia Thursday, March 6, 2014 2:01 PM
    Thursday, March 6, 2014 12:55 PM
    Moderator

All replies

  • Hi BatRocchia,

    Where you find the documentation, can you share us the link?

    I'm not sure if TextDecoration is supported by now, we can still have several ways to make the text looks good. For instance the underline effect, TextBlock applied with Underline element, or apply a line over the text. 

    Do you have some specific scenario that we can help?

                 <TextBlock>
                    <Underline>
                        <Run Text="xxxxxxxxxxx" />
                    </Underline>
                </TextBlock>
        <Grid>
            <TextBlock Text="This is a test"/>
            <Line Stretch="Fill" Stroke="white" StrokeThickness="2" />
        </Grid>


    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by BatRocchia Thursday, March 6, 2014 2:01 PM
    Thursday, March 6, 2014 12:55 PM
    Moderator
  • The documentation is here: http://msdn.microsoft.com/en-us/library/system.windows.textdecorations(v=vs.110).aspx

    In my case, I can use the object Line or Underline.

    I was just wondering why you choose to remove a very simple style object.

    Thursday, March 6, 2014 1:03 PM
  • Well, the documentation only mentioned that Windows 8.1 Platform support this, but not mention it is supported by Windows Store App. 

    If the documentation has a small green bag, that means it is supported by windows store app. For instance this class: http://msdn.microsoft.com/en-us/library/system.argumentexception(v=vs.110).aspx and at the end of the Version information, .net for windows store app should be listed there.

    However I cannot explain why there is no simple style object in windows store app, it is by-design, but i will mark your question as a customer request. Maybe in the feature it will be added into the WinRT API.

    Thank you for supporting the forum.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Thursday, March 6, 2014 1:35 PM
    Moderator
  • Thank you for your explanation, I never noticed the green bag.

    I mark your previous answer as answer.

    Thursday, March 6, 2014 2:03 PM