How to bind a UTextBlock

I did it here and it worked:

  1. I used the TextDelegate property from the UTextBlock class.
  2. This property expect a FText as a return, so the function you bind must return this type and you have to make all conversions for that.
  3. My example below:

Initialization an pointer protection for the Text:

/* 18 Pointer protection PowerBarPercentText */
	if (PowerBarPercentText)
	{
		PowerBarPercentText->SetText(FText::FromString(""));		
		PowerBarPercentText->TextDelegate.BindUFunction(this, "GetPowerBarPercentageString");
	}

The function that was binded, returning the power percent as the content for the text

FText UIceBreakerUserWidgetInGame::GetPowerBarPercentageString()
{
	if (MyClassThatHaveTheFuncion)
	{
          return FText::FromString(FString::SanitizeFloat(MyClassThatHaveTheFuncion->HitPowerPercent));
	}
	else
	{
		return FText::FromString("");
	}
}