Beispiel #1
0
 public void SetFormattedText(FormattedText text)
 {
     label.Text      = text?.Text;
     formattedText   = text;
     label.Realized -= HandleStyleUpdate;
     label.StyleSet -= HandleStyleUpdate;
     label.ApplyFormattedText(text);
     label.Realized += HandleStyleUpdate;
     label.StyleSet += HandleStyleUpdate;
 }
Beispiel #2
0
 public void SetFormattedText(FormattedText text)
 {
     // set content with a custom label, this will recreate labelWidget
     SetContent(text?.Text, Widget.UseUnderline, image, contentPosition, true);
     formattedText = text;
     if (!string.IsNullOrEmpty(formattedText?.Text))
     {
         if (labelWidget.IsRealized)
         {
             labelWidget.ApplyFormattedText(formattedText);
         }
         else
         {
             labelWidget.Realized += HandleStyleUpdate;
         }
         labelWidget.StyleSet += HandleStyleUpdate;
     }
 }