WP - 如何以编程方式删除hyperlinkBut​​ton中的下划线?

Moh*_*eeq 3 c# windows-phone-8

我在C#中开发了一个hyperlinkBut​​ton.超链接中的下划线让我感到恼火.我不知道如何删除它.帮我删除下划线,我需要在C#中回答.[这是WP8应用程序]

    HyperlinkButton hyperlinkButton = new HyperlinkButton()
    {
        Content = "Click me",
        HorizontalAlignment = HorizontalAlignment.Left,
        NavigateUri = new Uri("http://my-link-com", UriKind.Absolute)
    };
Run Code Online (Sandbox Code Playgroud)

gun*_*171 6

引用道格拉斯斯托克韦尔

您可以直接设置属性,也可以使用样式:

<Style TargetType="{x:Type Hyperlink}">
    <Style.Triggers>
        <Trigger Property="IsMouseOver" Value="True">
            <Setter Property="Foreground" Value="DarkSlateBlue" />
        </Trigger>
    </Style.Triggers>
    <Setter Property="Foreground" Value="SteelBlue" />
    <Setter Property="TextBlock.TextDecorations" Value="{x:Null}" />
</Style>
Run Code Online (Sandbox Code Playgroud)