visualtree

WPF Get Element(s) under mouse

Is there a way with WPF to get an array of elements under the mouse on a MouseMove event? ...

Walk the Model3DGroup tree!

I have a complex 3D scene consisting of Model3DGroups that I need to analyze at runtime. Since Mode3D nodes do not participate neither in the VisualTree nor in the LogicalTree is there any other way I can find the parent of a Model3DGroup? ...

Walk the VisualTree in a worker thread for fulltext search

I am using WPF to show complex data (think reporting). I now need to have a fulltext search for it. We currently do this by walking the visual tree looking for textblocks. It seems that this needs to be done on the UI thread, is that right? The problem here is that it might take quite a while until the next match is found during wich the...

DataTemplate defined in XAML has null VisualTree

I'm using WPF with .NET 3.0. I have a relatively simple DataTemplate defined as the CellTemplate for a GridView. I expect the DataTemplate's VisualTree property to contain a FrameworkElementFactory, but the property is null when I try to access it from the GridViewColumnHeader.Click event. Why is the VisualTree null? I need to access...

ListBoxItem.Parent returns nothing, unable to get it thru VisualTreeHelper.GetParent either

How do I extract the parent container of a ListBoxItem? In the following example I can go till the ListBoxItem, higher than that I get Nothing: <ListBox Name="lbAddress"> <ListBox.ItemTemplate> <DataTemplate> <Button Click="Button_Click"/> </DataTemplate> </ListBox.ItemTemplate> </ListBox> Private Sub Button_Click(...

How do I add an element to the visual tree in Silverlight

Hi, Here is my specific problem: Xaml: <local:ShrinkableContentControl x:Name="m_ShrinkableContentControl"> <Border Background="SkyBlue"> <Button Click="Button_Click_1" Content="Hello"/> </Border> </local:ShrinkableContentControl> Code for ShrinkableContentControl: [ContentProperty("Shrinkable")] public class Shrink...

Move UIElement in Visual Tree without recalculating layout

We have a WPF application (.Net 4.0) using a Docking Control (Actipro). We can dock out the docking windows. In that case, a "real" Window is created and the content is assigned to that window. Of course, moving stuff in the Visual Tree will re-trigger the complete layouting. This is problematic, because in one of these docking windows,...