I wrote before about using hyperlinks in WPF. For my new side project I need to switch from hypertext to the simple text depending on availability of URL. Switching to simple text seemed easy, just assigning text value to the Text property worked. Switching back was not obvious for me.
Then I found that TextBlock has Inlines property. The code became this:
tHypertext.NavigateUri = new Uri(uri);
tTextBlock.Text = value;
tHypertext.NavigateUri = null;
Where TextBlock and Hypertext are from previouse example