Questions tagged [visualtreehelper]
92 questions
0
votes
2 answers
VisualTreeHelper.FindElementsInHostCoordinates does not return controls with IsHitTestVisible set up to false
I am doing some experiments and I am trying to collect all elements which are placed under mouse pointer.
XAML test code
0
votes
1 answer
How to Loop Through CheckBoxes in a TabControl using WPF?
I am trying to loop through child elements of a Tab Control to know what Check Boxes are set to checked or not checked. I have found various answers on SO, but I can't seem to get the code to do what I need. Here is what I have thus far:
foreach…

Rinktacular
- 1,116
- 3
- 19
- 45
0
votes
1 answer
Bounds rectangle of selected controls in wpf
Is there a simple way to find the rectangle (area and location) that would be required to cover a set of control?? VisualTreeHelper.GetDescandentBounds() works fine, but there are no overloaded methods where I can specify the controls that it should…

sudarsanyes
- 3,156
- 8
- 42
- 52
0
votes
0 answers
List refreshes visually but VisualTreeHelper list is incorrect
On button click a GalaSoft.MvvmLight.Messaging message is triggered across all viewModels that have the message receiver registered. A new list of data is acquired asynchronously and used to update the UI. The UI updates but when I call the…

Fabii
- 3,820
- 14
- 51
- 92
0
votes
1 answer
Check if specified element is already the logical child of another element
I a beginner in C# and WPF. I'm programming plugin for a node based software called vvvv. I have implemented sliders, buttons and other simple ui elements. The following code shows how a sliders node look in c# :
using System.Windows;
using…

lecloneur
- 424
- 5
- 20
0
votes
2 answers
How to calculate a bounding box for an Expander?
I have an Expander control and i need to calculate its bounds without invisible elements and margins. It commonly can be done by VisualTreeHelper.GetDescendantsBounds. But it seems that the rect is calculated by VisualTreeHelper doesn't depend on…

sedovav
- 1,986
- 1
- 17
- 28
0
votes
2 answers
SIlverlight: Can't find Image on Canvas
In my Canvas, I have an image object. I haven't set a source in it, but it has coordinates and a size. The tag is:

Pete
- 6,585
- 5
- 43
- 69
0
votes
1 answer
Finding the TextBlock that is part of the default control template ComboBox generated through code
I'm trying to find the TextBlock that is inside the control template of a comboBox.
using VisualTreeHelpar.GetChildrenCount is working only if the comboBox is declared in XAML.In that case GetChildrenCount returns 1 and a recursive search is…

uriya
- 1
0
votes
0 answers
Select ImageBrush using VisualTreeHelper
I am trying to select ImageBrush items from a LongListSelector. As the ImageBrushes are inside a DataTemplate, I am selecting them using VisualTreeHelper.
My sample xaml code:

raisul
- 640
- 1
- 5
- 26
0
votes
2 answers
How to get the child control inside a TreeviewItem?
I customed my TreeViewItem to be a StackPanel with image and textblock inside; I'd like to get a reference to the TextBlock inside. For the codes below node is of type TreeviewItem and I am surechildrenCound =3 which could be StackPanel image…

baozi
- 679
- 10
- 30
0
votes
1 answer
Strange behavior by combo box selection in wpf
I am working on an application, wherein we have a main window which is having so many child windows in different dock option. So, one dock is having a property panel window which allows a user to modify property of selected entity and after changing…

Yogesh
- 3,044
- 8
- 33
- 60
0
votes
1 answer
WPF ListView Large List with ScrollViewer, VisualTree element not all loaded
I have a WPF listview and the ScrollViewer shows if large list. The ListView contains items with a checkbox element. We provide the ability to the users to select all and unselect all.
The issue I experienced is only with larger list, meaning we see…

gmang
- 435
- 1
- 6
- 20
0
votes
1 answer
How to get index of a ListBox item without SelectedIndex or the like (in PreviewMouseDown, nothing is "selected" yet)
How to implement the GetListBoxItemIndex function below to get the index of the item I clicked on? I tried using VisualTreeHelper with no success (meaning, VisualTreeHelper obviously works, but I'm not getting anywhere with the tree…

Tar
- 8,529
- 9
- 56
- 127
0
votes
1 answer
WPF visualtreehelper.getchildrencount returns 0 on datagrid
I am using datagrid with 32 rows and when I try to use this GetCell(28,2) its fail, and also on row 28 - 32 there is the same problem.
this one: visualtreehelper.getchildrencount return 0 when its above row 28.
I find out that if i roll down to…

mmm
- 80
- 1
- 8
0
votes
0 answers
Changing all text color in Frame
I want to change all my text in my application (wpf) programmatically, it works form my Grid on my mainwindow (BaseGrid) with:
private void setTextColor()
{
Color myColor = Brushes.Red;
for (int i = 0; i <…

Nick Prozee
- 2,823
- 4
- 22
- 49