Linked Questions
68 questions linked to/from How do I use WPF bindings with RelativeSource?
2 votes
2 answers
930 views
Visibility of a Button in DataGrid [duplicate]
I have a DataGrid with three columns. There is a delete button in the third column. Its visibility depends on boolean property called 'ControlsEnabled'. DataGrid is populated by items in '...
-3 votes
1 answer
960 views
WPF - Change Textbox value according to another Textbox value [duplicate]
Ok. I have a 'Person' class with such properties: PersonId, Name and Age. So far I've added 3 different people and set the DataContext from a List. My validation rules are working ok. What I want to ...
126 votes
7 answers
141k views
Access parent DataContext from DataTemplate
I have a ListBox which binds to a child collection on a ViewModel. The listbox items are styled in a DataTemplate based on a property on the parent ViewModel: <Style x:Key="...
58 votes
2 answers
137k views
WPF Binding to parent DataContext
We have a WPF application with a standard MVVM pattern, leveraging Cinch (and therefore MefedMVVM) for View -> ViewModel resolution. This works well, and I can bind the relevant controls to properties ...
8 votes
2 answers
6k views
Is there a way to associate a Command with a WPF Toolkit DataGridHyperlinkColumn?
Is there any way I can associate a Command with a DataGridHyperlinkColumn? I've tried this: <DataGridHyperlinkColumn Header="Client Name" Binding="{Binding ShortName}"> <...
13 votes
3 answers
3k views
Bind a fill property in a path to a Foreground property from the ContentControl in a style
I have silverlight problem I'v used two days to fight: a template with a style controls a button. In the concrete button I have a canvas with paths as content. The problem is that I want the paths ...
4 votes
2 answers
3k views
Binding of TextBlock inside Custom Control to dependency property of the same Custom Control
I have a custom control with a TextBlock inside it: <Style TargetType="{x:Type local:CustControl}"> <Setter Property="Template"> <Setter.Value> <...
8 votes
2 answers
7k views
Tree traversal - starting at leaves with only parent pointers?
Is it conceptually possible to have a tree where you traverse it by starting at a given leaf node (rather than the root node) and use parent pointers to get to the root? I ask this since I saw ...
3 votes
5 answers
4k views
Binding IsEnabled to the parent ViewModel instead of the UserControl ViewModel
I developed a user control in SilverLight that contains several child controls. Textboxes, ComboBoxes and so on. The problem is, when I include that UserControl into a parent view and set the ...
6 votes
3 answers
3k views
UserControl using parent elements in wpf?
When you have a usercontrol in wpf can it reach outside to its parent elements? For instance my user control just lists some generic things which are held inside the control which is encapsulated ...
2 votes
2 answers
3k views
How to bind to properties of a UserControl inside another UserControl?
I have a simple UserControl that displays an icon and text: <UserControl x:Class="IconLabel" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://...
0 votes
1 answer
4k views
How to Bind a specific ObservableCollection item's property to a CustomControl's ControlTemplate
I have a custom control with an observable-collection of "states", sort of like a multiple-state-button. Only the necessary code is here to avoid confusion: public class MyMultiStateBtn : ...
2 votes
1 answer
2k views
How to bind a property from code-behind while the rest are bound to DataContext?
My goal is to bind an element property in XAML to a property of the code behind class, while the DataContext still is a ViewModel. The reason is, that I have some only UI-cosmetic properties in XAML ...
1 vote
2 answers
3k views
How can one binding work, but not the other?
Not sure how much it matters, but I am using devexpress grid and defining a celltemplate for one of the columns. The issue is that when I bind with a "slidercontrol" it works, but when I bind to a ...
2 votes
2 answers
4k views
DataGridComboBoxColumn SelectionChanged event in MVVM
I've got a DataGrid which contains a DataGridComboBoxColumn. What I want to do is to (dis)enable other columns based on the value of this combobox. For that, I handle the SelectionChanged event via an ...