Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用ApplyPropertyValue为文本加下划线_C#_.net_Wpf - Fatal编程技术网

C# 使用ApplyPropertyValue为文本加下划线

C# 使用ApplyPropertyValue为文本加下划线,c#,.net,wpf,C#,.net,Wpf,我想使用ApplyPropertyValue中的textrange为所选文本加下划线。 以下是我的一行代码: new TextRange(start, end).ApplyPropertyValue(??, TextDecorations.Underline); 您需要在其中传递dependency属性,它是Inline.TextDecorationsProperty- new TextRange(start, end).ApplyPropertyValue(Inline.TextDecora

我想使用ApplyPropertyValue中的textrange为所选文本加下划线。 以下是我的一行代码:

new TextRange(start, end).ApplyPropertyValue(??, TextDecorations.Underline);

您需要在其中传递dependency属性,它是
Inline.TextDecorationsProperty
-

new TextRange(start, end).ApplyPropertyValue(Inline.TextDecorationsProperty,
                                                TextDecorations.Underline);
根据MSDN文件,该方法采用和

您可能正在查找Dependency属性

new TextRange(start, end).ApplyPropertyValue(
    Inline.TextDecorationsProperty,
    TextDecorations.Underline);

好的,那个代码有什么问题吗?我在属性值参数中使用了“?”,我应该用什么替换它?
new TextRange(start, end).ApplyPropertyValue(
    Inline.TextDecorationsProperty,
    TextDecorations.Underline);