For example, my TreeViewItem’ header consists of TextBlock and Image. How I can get references to them?
For example, my TreeViewItem’ header consists of TextBlock and Image. How I can get
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not sure if I got you right, but if you want to get visual children of an element, try using
VisualTreeHelper.GetChildandVisualTreeHelper.GetChildrenCount.PS: usually it’s more problematic to get a reference to the TreeViewItem itself…
UPDATE (A code example for future generations):