Reputation: 3863
I want to underline the selected text by using textrange in ApplyProperyValue. Here is my single line of code :
new TextRange(start, end).ApplyPropertyValue(??, TextDecorations.Underline);
Upvotes: 1
Views: 948
Reputation: 4002
According to the TextRange.ApplyPropertyValue Method
MSDN file, the TextRange.ApplyPropertyValue Method
method takes a DependencyProperty
and an Object
.
public void ApplyPropertyValue(
DependencyProperty formattingProperty,
Object value
)
You are probably looking for the Inline.TextDecorationsPropertyProperty
Dependency Property.
new TextRange(start, end).ApplyPropertyValue(
Inline.TextDecorationsProperty,
TextDecorations.Underline);
Upvotes: 0
Reputation: 81313
You need to pass dependency property in there which is Inline.TextDecorationsProperty
-
new TextRange(start, end).ApplyPropertyValue(Inline.TextDecorationsProperty,
TextDecorations.Underline);
Upvotes: 2