<Hyperlink Command="{Binding Path=Source1}">
<TextBlock x:Name="DescriptionText" TextWrapping="Wrap">
<TextBlock.Style>
<Style>
<Setter Property="TextBlock.Text" Value="Click here to set Source1"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsActive}" Value="False">
<Setter Property="TextBlock.Text" Value="{Binding Path=Source1Des, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Hyperlink>
我想只修剪文字下划线。怎么做?
答案 0 :(得分:1)
使用Run而不是Textblock
<TextBlock TextWrapping="Wrap">
<Hyperlink Command="{Binding Path=Source1}">
<Run>
<Run.Style>
<Style TargetType="Run">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Text" Value="My mouse is over" />
</Trigger>
</Style.Triggers>
<Setter Property="Text" Value="Click here to set Source1" />
</Style>
</Run.Style>
</Run>
</Hyperlink>
</TextBlock>