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, ...
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...
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...
I want to hook my control's visual parent's events.
...
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">......
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...
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...
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.
...
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...