visual-tree Questions

2

Solved

Sometimes right-clicking treeviewitem results unhandled InvalidOperationException. In code behind I select the right clicked row: static TreeViewItem VisualUpwardSearch(DependencyObject source) ...
Highams asked 12/7, 2016 at 9:39

1

I can't enable Live Visual Tree in Visual Studio 2017 for UWP app (C#). This tool was working on VS2015, but never worked for me in VS2017. It works with no problems for my WPF projects. I'm getti...
Recension asked 12/4, 2018 at 17:29

1

Solved

As the columns of a data grid aren't in the visual tree of datagrid I'm m using this approach of Binding Proxy to bind Visibility of a DataGridTextColumn. https://www.thomaslevesque.com/2011/03/21...
Phosphor asked 17/10, 2017 at 9:53

2

Solved

Based on some custom security settings, I alter window child controls to readonly and disabled. To accomplish this, I loop through child controls when the window loads. This works just fine. 99% ...
Ozan asked 16/5, 2011 at 22:35

2

Having {Binding ElementName=foo}, will it lookup visual or logical tree? Of logical and visual trees in WPF | Data See, Data Do When does the logical tree matter? When looking up a name, suc...
Keener asked 1/4, 2009 at 14:44

0

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, ...
Shinn asked 2/7, 2015 at 14:36

1

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 ...
Playroom asked 14/5, 2014 at 3:53

1

Solved

I would like to have a WPF container (panel, user control, etc.) that exposes a property to turn all children to read-only if set. This should pretty much be like setting a parent control to IsEnab...
Bonnett asked 3/12, 2013 at 16:59

2

Solved

Say I have two classes that can reference a third UI object (in this example a button). In addition, the parent class can contain an element of the child class. If they both are bound to the same c...
Ulaulah asked 1/10, 2012 at 9:55

3

Solved

Lately I've seen some comments about walking the visual tree being bad practice (here for instance), but I haven't seen or found a reason for why this would be bad practice. In a project I'm worki...
Lecompte asked 17/8, 2012 at 10:15

1

Solved

I have ItemsControl with Grid as ItemsPanelTemplate <ItemsControl ItemsSource="{Binding CellCollection}" Name="CellGrid"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Gr...
Mediacy asked 26/5, 2012 at 18:57

2

Solved

In a WPF app I want to move a UserControl from a ContentControl to another one in code: myContentControl2.Content = myUserControl; in this case I get an error: Specified element is already the ...
Wherry asked 30/1, 2012 at 10:18

4

Solved

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.ItemTe...
Karolynkaron asked 13/4, 2010 at 20:53

1

Solved

In WPF an element can have a Visibility of "Visible", but not be actually visible on the screen because it's parent (or parent of parent) has Visibility of Collapsed. I want to be able to know if...
Brander asked 26/10, 2011 at 18:30

1

Solved

I would like to remove a FrameworkElement from the visual tree. Since the FrameworkElement has a Parent property, it would be obvious to solve this problem by removing it from there: FrameworkElem...
Semester asked 9/12, 2010 at 9:52

2

Solved

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...
Aeronautics asked 12/1, 2010 at 18:7

3

Solved

Is there a way with WPF to get an array of elements under the mouse on a MouseMove event?
Hobby asked 5/9, 2008 at 13:28
1

© 2022 - 2024 — McMap. All rights reserved.