I can't determine why the UserControl isn't properly formatting the text, though it should be possible. However, to solve the initial problem I would use a CustomControl instead of of a UserControl for this.
The first thing we'd do is create the CustomControl. Unfortunately, neither TextBlock nor Hyperlink derive from Control, so while it would be nice to simply extend one of those, we cannot.
[ContentProperty("Text")]
[TemplatePart(Name = "PART_HyperlinkContainer", Type=typeof(Hyperlink))]
[TemplatePart(Name = "Part_TextContainer", Type = typeof(TextBlock))]
public class CustomLinker : Control
{
static CustomLinker()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomLinker), new FrameworkPropertyMetadata(typeof(CustomLinker)));
}
public string Text
{
get { return (string)GetValue(TextProperty); }
set { SetValue(TextProperty, value); }
}
// Using a DependencyProperty as the backing store for Text. This enables animation, styling, binding, etc...
public static readonly DependencyProperty TextProperty =
DependencyProperty.Register("Text", typeof(string), typeof(CustomLinker), new UIPropertyMetadata(""));
public ICommand Click
{
get { return (ICommand)GetValue(ClickProperty); }
set { SetValue(ClickProperty, value); }
}
// Using a DependencyProperty as the backing store for Click. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ClickProperty =
DependencyProperty.Register("Click", typeof(ICommand), typeof(CustomLinker), new UIPropertyMetadata(null));
}
All that the control needs are the Click event and Text properties, for the click event, I decided to use a Command instead. Hyperlink supports commands, and that makes it easier to use in the long run.
The ContentProperty tells the CustomControl what to do with content set directly inside it. The two TemplateParts define the TextBlock that will contain our text, and the Hyperlink that contains that text block.
Now, along with the custom control a default template was generated, so lets go take a look at that. And build in the TemplateParts that we defined.
<Style TargetType="{x:Type local:CustomLinker}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:CustomLinker}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<TextBlock>
<Hyperlink x:Name="PART_HyperlinkContainer"
TextDecorations="None"
Command="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Click}">
<TextBlock x:Name="Part_TextContainer"
TextWrapping="Wrap"
Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Text}" />
</Hyperlink>
</TextBlock>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
And, that's all that is needed. Now we can use our control,
<local:CustomLinker Click="{Binding MyCommand}">
Click this text that is really rather long and overly descriptive in order to do something.
</local:CustomLinker>