Skip to content

Commit 8631ba7

Browse files
committed
Windows fix
1 parent 1b451f4 commit 8631ba7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Controls/src/Core/Platform/Windows/Extensions/TextBlockExtensions.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ static void DetermineTruncatedTextWrapping(TextBlock textBlock) =>
2424

2525
public static void UpdateText(this TextBlock platformControl, Label label)
2626
{
27+
string text = TextTransformUtilites.GetTransformedText(label.Text, label.TextTransform);
28+
2729
switch (label.TextType)
2830
{
2931
case TextType.Html:
30-
platformControl.UpdateTextHtml(label);
32+
platformControl.UpdateTextHtml(label, text);
3133
break;
3234

3335
default:
@@ -39,7 +41,7 @@ public static void UpdateText(this TextBlock platformControl, Label label)
3941
{
4042
platformControl.TextHighlighters.Clear();
4143
}
42-
platformControl.Text = TextTransformUtilites.GetTransformedText(label.Text, label.TextTransform);
44+
platformControl.Text = text;
4345
}
4446
break;
4547
}

src/Core/src/Platform/Windows/TextBlockExtensions.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,8 @@ public static void UpdateVerticalTextAlignment(this TextBlock platformControl, I
7474
platformControl.VerticalAlignment = label.VerticalTextAlignment.ToPlatformVerticalAlignment();
7575
}
7676

77-
internal static void UpdateTextHtml(this TextBlock platformControl, ILabel label)
77+
internal static void UpdateTextHtml(this TextBlock platformControl, ILabel label, string text)
7878
{
79-
var text = label.Text ?? string.Empty;
80-
8179
// Just in case we are not given text with elements.
8280
var modifiedText = string.Format("<div>{0}</div>", text);
8381
modifiedText = Regex.Replace(modifiedText, "<br>", "<br></br>", RegexOptions.IgnoreCase);

0 commit comments

Comments
 (0)