wpf - How to get databound TreeViews selected TreeViewItem's Header section height without child heights -
I am using a WPF tree with some heritable datatlets. Treviewview has drag drop capability.
Can anyone help me get selected TreeViewItem header section height (actual height)? If I get the selected item's actual height (trevium. Actualheart) it will give height with the children. But I want it to be the height of the header element. I have achieved this by using a visual search to find a control inside the data template, which includes the entire head. I want to do it faster. The way is (more than the visual tree search) because I'm doing it in a dragrover event in the preview.
There is a title with the name of the treeviewititit's name, which is named as a PushHeader, and to get reference to that part Can be used. Note that if the control template has been changed and the new template does not actually present the header, then it may be lost.
var header = trivium. Template.Fundname ("Pantheidder", Tryvytim) as Framework Element; If (header! = Null) {var height = header.ActualHeight; }
(The current limit you are using is probably the root of this element, so you can get slightly different results).
Comments
Post a Comment