I want to present some text in the GUI and give the user that ability to double click it. I want to catch this event and deal with it.
I thought to do it like this :
<TextBlock
Height="39"
TextElement.FontSize="18"
FontFamily="Verdana"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Name="Filelink"
Padding="5,0,0,0"
TextDecorations="Underline"
Text="{Binding Path=FilePath}"/>
But seems that it's not easy to deal with clicks in TextBlock
.
Any ideas what is the best way to present a click able text.
Thanks.
If you want clickable text you can just restyle a Button
:
<Button Content="Text here" Click="Click_Handler">
<Button.Template>
<ControlTemplate TargetType="{x:Type Button}">
<ContentPresenter />
</ControlTemplate>
</Button.Template>
</Button>
Also see this question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With