Linked Questions
17 questions linked to/from Data Binding in WPF User Controls
0 votes
0 answers
84 views
WPF TextBlock binding not updating with INotifyPropertyChanged [duplicate]
I have the following custom UserControl: <UserControl ... x:Class="Controls.CurrentUser"> <Border Background="#253f95" Margin="5"> <StackPanel ...
5 votes
3 answers
9k views
How to set DataContext to self
My UserControl requires binding to the ancestor (the ancestor being the MainWindow) and to itself (it's code behind). To bind to the ancestor, I'm using DataContext="{Binding RelativeSource={...
0 votes
2 answers
18k views
Binding between my usercontrol and ViewModel
Can not do Binding Random (MyViewModel) -> VMTestValue (MyViewModel) -> TestUserControl (MainWindow) "MyViewModel" is ViewModel for "MainWindow" All project: http://rusfolder.com/32608140 ...
7 votes
3 answers
12k views
WPF Bind to element in parent window
I'm trying to bind element's property in a child control to an element's property ina parent window, it doesn't work.. Here is png of what I'm trying to do: Here is the xaml that doesn't work: ...
4 votes
2 answers
5k views
Custom dependency property binding
I got some problem with custom dependency property binding. We have: Custom user control with one dependency property and binding to self: <UserControl x:Class="WpfApplication1.SomeUserControl" ...
4 votes
3 answers
5k views
Workaround for inability to bind to a property that belongs to a WindowsFormsHost Child object in C#/XAML app?
I have a C# WPF 4.51 app. As far as I can tell, you can not bind to a property belonging to an object that is the child of a WPF WindowsFormsHost control. (If I am wrong in this assumption please ...
0 votes
3 answers
2k views
Get data from a user control in wpf to an user control?
Basically I'm new to WPF. I have a user Control - A. Inside A, I have another user Control B. When a button on B is pressed, a value is to be passed to A. I`m trying WPF MVVM. Kindly help me. //------...
2 votes
2 answers
2k views
How do you handle nested bindings in WPF user controls containing lists?
I am trying to create a usercontrol in WPF that includes a content collection and struggling to get the binding to work correctly on the sub elements. I already looked at this example, but I'm one ...
0 votes
2 answers
2k views
databinding dictionary <string,int> to a dependency property
I need some help! I have build a custom control and added to it a DependencyProperty of type: Dictionary<string,int> and from the XAML where the control is held I do a data binding to bind to ...
1 vote
1 answer
2k views
Binding a ListView selected item to a user control
I have a Page which contains a ListView of users : <ListView ItemsSource="{Binding UserList}" SelectedItem="{Binding SelectedUser}"> <GridView> <GridViewColumn ...
0 votes
1 answer
2k views
WPF UserControl with ObservableCollection DependencyProperty not binding
I have a user control of a Line Series Chart and created a bunch of dependency properties for items on the chart; title, x-axis label, the data itself, etc... The data is an observable collection of ...
0 votes
2 answers
254 views
WPF MVVM Controls incorrectly sharing ViewModel
I have a control: DailyHours. That has a collection of custom TimeEdit controls I created. Each control is supposed to bind to the DailyHours view-model class. Instead it tries to find the values I ...
1 vote
1 answer
651 views
WFP - Reuse DataGrid columns and resources
I have an application with two DataGrid controls. And although their ItemsSource are bound to different collections, their item type, columns, styles and event handlers are exactly the same. As their ...
1 vote
1 answer
379 views
How to set databinding for a usercontrol?
I my project, I want to use a user control which is the combination of a textblock and a textbox. I can create some custom properties for the usercontrol like public string Caption { ...
0 votes
3 answers
431 views
Simple usercontrol and MVVM pattern: How to use?
Please help me I have public partial class OrderControl : UserControl { private OrderHeader orderHeader; public Customer selectedCustomer { get; set; } private Customer[] allCustomers; ...