Create Hyperlink in TextBlock via Binding

前端 未结 3 532
死守一世寂寞
死守一世寂寞 2020-12-19 09:40

My problem is to find the urls from the text content and convert it into the clickable hyperlinks via data binding.

This is what I\'ve tried

 

        
3条回答
  •  Happy的楠姐
    2020-12-19 10:07

    I stumbled on this post while looking for the same for UWP. In case you are here too for the same, I'd recommend you use a HyperlinkButton instead of a Hyperlink wrapped in a Textblock. Below is the code on how to use it.

    
    

    You can also use Binding instead of x:Bind and yes you can set the Mode=OneWay too.

    Read More on Microsoft Docs

提交回复
热议问题