Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF Treeview: Different display name for Hyperlink

$
0
0

I'm using a hyper-link in WPF tree-view to open the linked PDF file. It's displaying the entire file-name in the treeView.
How can I give a different display name for the hyper-link and make it open during click?
How can I add a space(white-space) between file-name and display file-name? (As you see it in the below image it looks a bit messy).
Thank you very much for your help.

XAML Code:

<TextBlock Margin="4,0,0,0" Text="{Binding XPath=@Name, Mode=TwoWay}"/><TextBlock Name="txtBox"> <Hyperlink Name="linkName" NavigateUri="{Binding XPath=@WebSite}" RequestNavigate="Hyperlink_RequestNavigate" >  <TextBlock Margin="-4,0,0,0" Name="SecondTextBlock"   Text="{Binding XPath= @WebSite}" /></Hyperlink>    </TextBlock>

XML Content:

<Solution Name ="PDF:For2K_XP_V3.10_English" WebSite ="file://For2K_XP_V3.10_English.pdf"/>

Image:


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>