Questions tagged [visual-tree]
106 questions
2
votes
2 answers
How come I can only have one instance of a Silverlight UserControl per page?
Its pretty lame, but I tried adding two UserControl's to my Silverlight Page, and I get an exception telling me (with extensive digging) that the same control name has been used to the visual tree twice. So the controls inside my UserControl are…

Jordan
- 9,642
- 10
- 71
- 141
2
votes
1 answer
how to test the speed of visual tree rendering in silverlight?
For example, I create a Canvas that contains a big amount of Shapes like this:
var canvas = CreateCanvasThatContainsShapes();
Then I add all the canvas to main page:
layoutRoot.Content = canvas;
It takes not so much time for those two lines of…

Cui Pengfei 崔鹏飞
- 8,017
- 6
- 46
- 87
2
votes
3 answers
Clear TextBlock from Button when they both are in a DataGridTemplateColumn
I have a DataGrid with DataGridTemplateColumn.
The DataGridTemplateColumn contains a button and TextBlock.
I want that pressing the button will clear the textBlock's text.
How do I do that ?
XAML:

Erez
- 6,405
- 14
- 70
- 124
2
votes
2 answers
Set control to top most silverlight
[Situation]
I have a custom item control which I add to a stack panel and after that is freely to move around by dragging.
public partial class CustomItem: UserControl
{
private bool IsDragging { get; set; }
private Point clickPosition;
…

Theun Arbeider
- 5,259
- 11
- 45
- 68
2
votes
1 answer
WPF TabControl Children
This is my current Scenario: I have several UserControls inside different TabItems on a single TabControl in a WPF Window. Something Like:

Federico Berasategui
- 43,562
- 11
- 100
- 154
2
votes
0 answers
How to move a WPF UIElement from the visual tree to a FixedPage?
My MVVM application is using on-screen visual objects to render screen content to a printed document. My View has a ContentControl that uses DataTemplate resources to determine what to display, but when I try to add that content to a FixedPage…

Evil Dog Pie
- 2,300
- 2
- 23
- 46
2
votes
3 answers
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…

Alex Maker
- 1,529
- 2
- 19
- 27
2
votes
0 answers
Capture Changes to Parent Visual Tree
From within a WPF FrameworkElement, how can I capture any changes to the visual tree path from the root to the FrameworkElement? i.e. when the FrameworkElement, or any of its parents, is added to, removed from, or moved to another branch of a visual…

O. R. Mapper
- 20,083
- 9
- 69
- 114
2
votes
1 answer
Setting correct DataContext for TabItems within a dynamically populated TabControl
I am having trouble accessing the correct DataContext for TabItems with a dynamically populated TabControl.
Using the below code i bind the ItemsSource of my TabControl to an ObservableCollection on my MainViewModel.
Based on the Type…

DAVEWASLIN
- 159
- 21
2
votes
0 answers
Find child element from ListBox wp8
I am trying to find child element from Listbox. Listbox contains Itemtemplate. Here is my design.
I have created UserControl. In that I have added ListBox.
I am showing this control as pop up. Here is code for pop up
GlobalSettings.popup =…

Ajay
- 6,418
- 18
- 79
- 130
2
votes
2 answers
How does one increase the hit testing radius on a rectangle in WPF?
Let's say I have a rectangle like this:

Billy ONeal
- 104,103
- 58
- 317
- 552
2
votes
0 answers
walk the Model3DGroup tree
I have a complex 3D scene consisting of Model3DGroups that I need to analyze at runtime. Since Model3D 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?

bitbonk
- 48,890
- 37
- 186
- 278
2
votes
2 answers
Is there a way to move controls in the visual tree? (WPF)
I want to relocate some controls from one part in the visual tree to another.
can I do this?
and direction or hint on how to?

Inferis
- 4,582
- 5
- 37
- 47
1
vote
2 answers
Set the properties of an auto-generated ContentPresenter
Consider the following part of a visual tree in a Windows Phone SL application:
As you can see, a PanoramaItem template contains a reference to a static DataTemplateSelector. It is a simple class that dynamically feeds the data template based on a…

Maxim V. Pavlov
- 10,303
- 17
- 74
- 174
1
vote
1 answer
Can I remove a ChildWindow from the VisualTree and put it back in to achieve FullScreen?
I have a popup that is a ChildWindow. Inside that popup I have a UserControl (MediaPreviewView) that has a MediaElement and some buttons to control the video. My requirements state that I need a fullscreen button and show the video fullscreen when…

AlignedDev
- 8,102
- 9
- 56
- 91