only set statustext binding in textblock

This commit is contained in:
bluepilledgreat 2025-01-22 23:38:44 +00:00
parent 074c049dee
commit 88be992176

View File

@ -558,12 +558,6 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
object? padding = GetThicknessFromXElement(xmlElement, "Padding");
if (padding != null)
textBlock.Padding = (Thickness)padding;
if (xmlElement.Attribute("Name")?.Value == "StatusText")
{
Binding textBinding = new Binding("Message") { Mode = BindingMode.OneWay };
BindingOperations.SetBinding(textBlock, TextBlock.TextProperty, textBinding);
}
}
private static UIElement HandleXmlElement_TextBlock(CustomDialog dialog, XElement xmlElement)
@ -573,6 +567,12 @@ namespace Bloxstrap.UI.Elements.Bootstrapper
textBlock.Text = GetTranslatedText(xmlElement.Attribute("Text")?.Value);
if (xmlElement.Attribute("Name")?.Value == "StatusText")
{
Binding textBinding = new Binding("Message") { Mode = BindingMode.OneWay };
BindingOperations.SetBinding(textBlock, TextBlock.TextProperty, textBinding);
}
return textBlock;
}