OK,I found VisualTreeHelper-it works as before,but what about LogicalTreeHelper What is the difference LogicalTreeHelper.GetParent(ListViewItem)==null and VisualTreeHelper.GetParent(ListViewItem) is not.Why By the way it could be useful to have shortcut for Parent in such elements as ListViewItem which dosen't exists by itself.
WPF has 2 trees of elements to deal with. There is the logical tree with things like controls that can render with styling and templates. There is the visual tree which is the actual tree of things to render. Your List is most likely in a template or such where there is no logical enclosing element, but has a visual parent because it is being rendered as the expansion of the template.
So,you say that elements coming not from template will be included in logical tree but that visuals+visuals contained in templates form visual tree It could be helpful to have formal definition of this trees...
That's exactly right and it is a key concept of the WPF architecture. There isa very good set of documentation on the Visual vs. Logical tree available here in the SDK.
Parent&VisualOperations
Pirox
What is the difference LogicalTreeHelper.GetParent(ListViewItem)==null and VisualTreeHelper.GetParent(ListViewItem) is not.Why
By the way it could be useful to have shortcut for Parent in such elements as ListViewItem which dosen't exists by itself.
Thanks.
Natalie Casey
Pintag
- sk
NewHacker
It could be helpful to have formal definition of this trees...
Thanks.
Tyson882
HTH,
Drew