0

Hi I was wondering if there is a way to turn of the underline text decoration property with applypropertyvalue, or if there was a better way to do it.

I have this code that works fine:

textselectrangea.ApplyPropertyValue(Inline.TextDecorationsProperty, TextDecorations.Underline);

but when I want to turn it off there is no textdecoration.none

textselectrangea.ApplyPropertyValue(Inline.TextDecorationsProperty, TextDecorations.None);
  • 1
    Have you tried passing a null value for the second parameter? – Sector95 May 09 '14 at 16:17
  • I have tried TextDecorations.None & TextDecorations.Null –  May 09 '14 at 16:19
  • 1
    What about just null? – Sector95 May 09 '14 at 16:19
  • is there another way to pass a null value, I wasn't sure how to do it in a ApplyPropertyValue function –  May 09 '14 at 16:20
  • That works great just null thanks a lot, you can post it as an answer and I will mark as correct so what i did was textselectrangea.ApplyPropertyValue(Inline.TextDecorationsProperty, null); –  May 09 '14 at 16:20

1 Answers1

1

Set the second parameter to null:

textselectrangea.ApplyPropertyValue(Inline.TextDecorationsProperty, null);
Sector95
  • 631
  • 6
  • 12