I am creating a WinUI 3 application, I need to manipulate one of the UI elements during runtime in a very custom and versatile way, so I don’t want to define it within XAML.
To manipulate it with code I had to assign the element to a variable during runtime. To do that I had to start from my main window Content
property and loop over the nested UI elements until I find the one I am looking for.
There must be a more efficient way, I know the Name of the element, but I cannot know where in the UI hierarchy it would be located, how can I reference it during runtime?