Questions tagged [visual-tree]

106 questions
1
vote
1 answer

Replace a control within a user control through dependency property

I've made a simple project to illustrate my problem. I have a user control ('ButtonPod') that houses a button and a rectangle:
Nick B
  • 1,101
  • 9
  • 19
1
vote
0 answers

When clearing a root datacontext by removing from visual tree, binding further down the tree remains

[Silverlight] I have a large visual object tree I'm removing from the visual tree (Grid.Children.Clear()), upon removal the DataContext of the root nulls out, but further down the tree a binding which looks like this
shane
  • 415
  • 5
  • 18
1
vote
1 answer

Help with using the visual tree in Silverlight

I have a question of how I can use the visual tree helper to get an object that I need. I have a user controll called DialogItemControll that I call from my main page like this: DialogItemControll ivDialogWindow = new DialogItemControll() …
Fore
  • 5,726
  • 7
  • 22
  • 35
1
vote
0 answers

WPF: Is every visual tree also a combination of visual and logical trees?

As far as I understand, a logical tree is always a subset of the visual tree of some element in WPF. Technically, the distinction between the two is whether or not they are assigned to the Template property of an element (= visual) or to the…
domin
  • 1,192
  • 1
  • 7
  • 28
1
vote
1 answer

WPF | VisualTreeHelper.GetChildrenCount(this) on collapsed parent

I have a "huge" Control where ~50% of it is collapsed. You can switch by a property to hide the visible part and show the collapsed one. Now when the Control is loaded, I try to find all FooControls in the visible and collapsed part of the control.…
Dominic Jonas
  • 4,717
  • 1
  • 34
  • 77
1
vote
0 answers

How to access inner TreeViewItem nodes without expanding the parent node

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…
Xam
  • 271
  • 3
  • 12
1
vote
1 answer

Changing background of TabControl

I would like to change the background color of a WPF TabControl: Changing the background color of the TabControl does not work, because the Grid element (direct child of the TabControl) doesn't inherit the backround of its parent: The code below…
JanDotNet
  • 3,746
  • 21
  • 30
1
vote
1 answer

Is there any means to detect adding/removing of descendants in the visual tree

I have a pair of controls, let's call them BigDaddy and Flea. One or more Flea elements may appear anywhere in the visual tree of BigDaddy. Is there any way to detect the adding/removing of Flea objects on BigDaddy given that there is no requirement…
Richard SP.
  • 497
  • 6
  • 15
1
vote
0 answers

Selecting the Window for "Live Visual Tree" in Visual Studio 2015

I have a Visual Studio 2015 solution that contains 2 WPF applications. Both applications start up when I run the solution in debug mode (pressing F5). I am using the new Live Visual Tree window that comes with Visual Studio 2015 but it only presents…
Kobi Hari
  • 1,259
  • 1
  • 10
  • 25
1
vote
1 answer

How to accessing Elements in XAML DataTemplate Listview without interacting with it

I have a C# Store App and using DataTemplate Selectors to determine which type of Template to use in a ListView Control bound to an Array. Because it is templated, I cannot assign a dynamic x:Name to each ListView Row. I need to be able to access…
Rob
  • 11,185
  • 10
  • 36
  • 54
1
vote
1 answer

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.
CannibalSmith
  • 4,742
  • 10
  • 44
  • 52
1
vote
1 answer

Get Binding Source object from binding using ElementName

I need to bind something to a child of an element in my VisualTree . in a UserControl: in DataGrid's Template :
eran otzap
  • 12,293
  • 20
  • 84
  • 139
1
vote
3 answers

How to find DataTemplate-Generated UIElement

Hi i try to find the generated UIElement from a DataTemplate but i'm not able to find my UserControl which should be somewhere in my ContentPresenter i looked in to the control via a Breakpoint and Snoop but i cant find the UserControl can someone…
WiiMaxx
  • 5,322
  • 8
  • 51
  • 89
1
vote
2 answers

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 its parent UserControl. So far I've tried ancestor binding and experimented with a converted, but the only way…
Echilon
  • 10,064
  • 33
  • 131
  • 217
1
vote
1 answer

WPF - PreviewMouseLeftButtonDown finding the visual owning control of e.OriginalSource

Very simple question. I have attached to the PreviewMouseLeftButtonDown event. I know this event Tunnels so the first item in the visual tree is going to get flagged as the e.OriginalSource. Example: I have a Grid named "MainGrid". This Grid…
tronious
  • 1,547
  • 2
  • 28
  • 45