I have a xaml window with an unnamed border control somewhere inside. The border control uses the attached property that I wrote, and the attached property basically sets the Name property of the border control to a known value, such as "placeholder". After the window is loaded, it tries to find this border control through the name that it assigned.
The problem is that it does not work. Window.FindName returns null. Any ideas?
Edit: The border control gets the name before calling Window.FindName, so it does not mean that it was not named in time.
As an alternative solution, I was thinking of just going through the kids window and finding one that uses my attached property. How can I do it?
Thank!
source
share