Configuración TextBlock.IsHypenationEnabled
a ciertos, en realidad hacer algo similar a eso, pero si desea utilizar las etiquetas, se puede utilizar un método como este:
/// <summary>
/// Adds break to a TextBlock according to a specified tag
/// </summary>
/// <param name="text">The text containing the tags to break up</param>
/// <param name="tb">The TextBlock we are assigning this text to</param>
/// <param name="tag">The tag, eg <br> to use in adding breaks</param>
/// <returns></returns>
public string WordWrap(string text, TextBlock tb, string tag)
{
//get the amount of text that can fit into the textblock
int len = (int)Math.Round((2 * tb.ActualWidth/tb.FontSize));
string original = text.Replace(tag, "");
string ret = "";
while (original.Length > len)
{
//get index where tag occurred
int i = text.IndexOf(tag);
//get index where whitespace occurred
int j = original.IndexOf(" ");
//does tag occur earlier than whitespace, then let's use that index instead!
if (j > i && j < len)
i = j;
//if we usde index of whitespace, there is no need to hyphenate
ret += (i == j) ? original.Substring(0, i) + "\n" : original.Substring(0, i) + "-\n";
//if we used index of whitespace, then let's remove the whitespace
original = (i == j) ? original.Substring(i + 1) : original.Substring(i);
text = text.Substring(i + tag.Length);
}
return ret + original;
}
esta manera Ahora puede decir:
textBlock1.Text = WordWrap("StackOver<br>Flow For<br>Ever", textBlock1, "<br>");
This seria:

Sin embargo, sólo con IsHyphenated sin etiquetas, será:

bien:
textBlock1.Text = WordWrap("StackOver<br>Flow In<br> U", textBlock1, "<br>");
la Salida:

Y IsHyphenated sin tags:

EDIT: en la reducción de tamaño de la fuente, he descubierto que el primer código que he publicado no prefieren añadir pausas, donde los espacios en blanco se producen a roturas especificados por el usuario.
¡Gracias! Esto se ve exactamente como lo que quiero. Tienes que probarlo antes de aceptarlo. –
Funciona bien, solo tuve que hacer dos cambios menores: 1. textBlock1 se reemplaza por el parámetro tb 2. // obtener el índice donde se produjo la etiqueta int i = text.IndexOf (tag); if (i <0) { return ret + text; } –
Gracias, de hecho pensé que había actualizado esto ... En cuanto a verificar si la etiqueta existe, no es necesario si la está usando solo para los textos que necesitan la etiqueta, también si desea que todos sus TextBlocks tengan este característica, debe hacer un control personalizado y anular la propiedad de cambio de texto ... –