visual-tree

Binding ElementName. Does it use Visual Tree or Logical Tree

Having {Binding ElementName=foo}, will it lookup visual or logical tree? http://blogs.msdn.com/mikehillberg/archive/2008/05/23/Of-logical-and-visual-trees-in-WPF.aspx When does the logical tree matter? When looking up a name, such as in {Binding ElementName=Foo}, the search walks up the ancestry looking for a name scope, ...

How to Create Visual Tree of Bindable Dependency Objects in Silverlight?

Let me explain the problem with an example: [ContentProperty("Questions")] public class QuestionForm : FrameworkElement { public QuestionForm() { this.Questions = new Collection<Question>(); } public Collection<Question> Questions { get; set; } } public class Question : DependencyObject { public static readonly DependencyPr...

WPF: Binding ContextMenu to visual parent

I know ContextMenus aren't part of the visual tree, but I've been trying to bind the Visibility property of a contextmenu to a property on it's parent UserControl. So far I've tried ancestor binding and experimented with a converted, but the only way that seems remotely feasible at the minute is to use a MultiValueConverter and reflectio...

How do I check for when my control obtains or changes the visual parent?

I want to hook my control's visual parent's events. ...

MAF (system.AddIn) plugin's UI overlaps any host side visual element

Hello, I'm having trouble with a WPF visual tree. I'd like the children of any container to be under any visual element that is above their container, like they should. Link to image displaying problem Both red zone and green zone are children of grey zone. <Grid Name="Grey"> <Grid Name="Red">...</Grid> <Grid Name="Green">......

Concepts of Visul tree and Logical tree

I understand the concepts of Visual and logical tree but still I am not able to understand the real use and need of these. Although its not necessary to know everything about these trees but I believe it will benefit in some advanced scenarios. I have already gone through following articles and have understood the concepts http://www.c...

WPF: How to walk up the Visual Tree to find a Model3DGroup a clicked 3d-model is in?

I'm displaying a few 3D-models as Model3DGroups. They are surrounded by Viewport3D which catches MouseDown-events. I want to determine which Model3DGroup (they all have names) was clicked. I'm starting with this: Point location = e.GetPosition(karte.ZAM3DViewport3D); HitTestResult hitResult = VisualTreeHelper.HitTest(ka...

Finding a Visual beneath my own using WPF VisualTreeHelper advanced hit-testing

I have a seemingly simple task. Imagine a point, a visual tree and some Visual (point is within Visual). I want to use advanced hit-testing to get my hands on the first "leaf" Visual that is "behind" my own Visual. I have used VisualTreeHelper and its fancy hit-test methods but could not get the results I wanted. ...

How to access inner TreeViewItem nodes without expanding the parent node

Hello, I have a WPF TreeView that is bound to a collection of custom objects - each of which has an IsExpanded property to expand the container TreeViewItem. I want to be able to programmatically access each TreeViewItem's control contents without expanding the parent TreeViewItem in the visual tree. However, when I attempt to access sa...