Canberk
Canberk

Reputation: 1

Empty visual tree in WPF

I just want to see visual elements of controls, and to do it I created a really basic window which contains two labels and button. The problem is that I can't see any visual as I expected either in VisualTreeHelper or visual studio's tool named "WPF Tree Visualizer".

Current project

The weird part is that it works in my another project.

Another project

What may cause of this? Why it doesn't work as in my other project?

Upvotes: -2

Views: 225

Answers (1)

Jesse Good
Jesse Good

Reputation: 52365

Looks like you are calling the code in the constructor. Try calling the same code in the window loaded event and you should see a difference.

Upvotes: 1

Related Questions