multiple text box overlays

I am creating multiple text boxes based of the active elements overlay example like this

var textBlock3 = new TextBlock()
{
    Text = text,
    IsHitTestVisible = false // this will ensure that the text will not capture any mouse events
};
 
Canvas.SetLeft(textBlock3, initialX + (2 * offsetX));
Canvas.SetTop(textBlock3, initialY + (2 * offsetY));

i have about 20-30 of these boxes to make, when i call them into the method I have to list them all like this

imageViewerAddOn.ActiveElementsOverlayAdd(new List<FrameworkElement> { textBlock, textBlock2, textBlock3 }, new ActiveElementsOverlayRenderParameters() { FollowDigitalZoom = false, ShowAlways = true, ZOrder = 1 });

was wondeirng if there is an easier way to do this that is less messy.

For context, I am trying to overlay the screen with the current logged in users username and it has been requesed that it is repeated across the screen evenly spaced.

At the risk of oversimplifying this you could simply build the list in some kind of loop. Create an array, list, or collection of TextBlock objects and then transform this into a list of FrameworkElement.

var list = new List<FrameworkElement>();
foreach (..)
{
    list.Add(..);
}
imageViewerAddOn.ActiveElementsOverlayAdd(list, ..

Whether this is useful or you needed more solid or creative advise I hope my answer might be a help..

No, of course you can do this.

I had such a narrow view of what i was trying to do i didnt see that I could just construct the list sperately and pass it directly.

Thanks