wpf-binding

WPF: Databinding and Combo Boxes

I have two classes Company CompanyKey CompanyName Person FirstName LastName CompanyKey The list items on the combo box is bound to a collection of CompanyObjects. How to I databind the selected item property of the Combobox to the Person.CompanyKey property? ...

ComboBox wpf not item not being selected

I am trying to bind a combo box to a list of objects, and it works great, besides the selected value, am I missing somethign? <ComboBox ItemsSource="{Binding OrderInfoVm.AllCountries}" SelectedValuePath="country_code" DisplayMemberPath="country_name" SelectedValue="{Binding OrderInfoVm.BillingCountry}" /> Basicall...

Bound Command not firing on another viewModel? What Am I doing wrong?

Hi I cannot seem to bind a command to a button.I have a treeview on the left showing Country City etc.. And I tabcontrol on the right. do I This uses 4 viewModels rootviewModel-ContinentViewModel-CountryViewModel-CityViewModel What I am building is based on http://www.codeproject.com/KB/WPF/TreeViewWithViewModel...

MVVM User Control Issue

I have a problem with commands in an MVVM application (I am only learning MVVM so go easy). MyClassViewModel is set to the datacontext for MainForm1, MyList is bound to UserControl1 datacontext and each item in the list is represented by UserControl2. I am trying to fire MyCommand in UserControl2 using the following: <CheckBox IsChe...

WPF: change binding properties for multiple controls

I'd like that all the Text bindings for the TextBoxes in my UserControl to have UpdateSourceTrigger=PropertyChanged, and ValidatesOnDataErrors=True How to do it ? I can think of a solution: use another class for bindings (a class inheriting Binding) but maybe there is another solution, maybe using a style or template ? ...

Binding IntervalType in WPFToolkit chart control

I am using the WPFToolkit to produce a ColumnSeries chart. I set the X-axis as a DateTimeAxes and I bind its IntervalType property with a value in my ViewModel class, but it doesn't work. I read about an identical issue here. Do you know if this problem was solved? Thank you. ...

WPF Hide DataGridColumn via a binding

For some reason I can't hide WPF Toolkit's DataGridColumn. I am trying to do the following: <dg:DataGridTemplateColumn Header="Item Description" Visibility="{Binding IsReadOnly}"> <dg:DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBox Text="{Binding Path=ItemDescription}" /> </DataTemplate> </dg:DataGridTemplat...

how to bind combobox of wpf datagrid

how to bind combobox of wpf datagrid ...

how do you implement Async Operations in C# and MVVM?

hi what is the easiest way to implement asynch operations on WPF and MVVM, lets say if user if user hits enter when on a field i want to launch a command and then return back while a thread will do some search operations and then come back and update the properties so notification can update the bindings. thanks! ...

How to bind Dictionary with ComboBox and textbox?

I have a Dictionary<String,Person>, where Person is a class, defined below String role; public class Person { public string firstname{ get; set; } public string lastname{ get; set; } public string city{ get; set; } } My question is how to bind the Dictionary key: String with a ComboBox, meanwhile. have the Dictionary va...

binding data to combo box column in gridview in wpf

How to bind data to a combox column in a grid view in listview's view. I have a Gridview in listview's view. Inside grid I have a grid column which contains a row of combo box. How to bind data to this combo box using DataTable or DataSet? Please help :-) ...

Binding the position and size of a UserControl inside a Canvas in WPF

Hi. We need to dynamically create (i.e. during runtime, via code-behind) UserControls and position them on a Canvas. We want to bind the position (Canvas.Left and Canvas.Top) and width of those sizable (!) and draggable (!) UserControls to a ObservableCollection<>. That measn when the user drags or resizes the control, the datasource get...

In my listview the PropertyChanged event never triggers the list to be redrawn

Hi everybody. First of all, I've to admin that I'm absolutely new to WPF! I think I've a problem with WPF Bindings or "PropertyChanged" notifications... I have this XAML with a TextBlock and a listView <StackPanel Orientation="Horizontal"> <TextBlock Margin="2" Name="UpdatesOperationResultcaption" Text="Operatio...

WPF Binding in Style

Hi, I'm trying to set together a simple textbox with some watermark text in the background. My code is based on the example from Philip Patrick's blog. I'm trying to tweak it so that the text displayed in the background is retrieved from the ToolTip property on the TextBox. Currently this works: <TextBox ToolTip="Type a name here...">...

Draw or create databound UserControls dynamically at runtime in WPF

I'm trying to createa time-tracking application in WPF. The user is supposed to draw elements that represent a timespan (timespan = bar) onto a Canvas. Now, exisiting bars are added when they are databound to a collection (each collection item contains the width and left position of the bar on the Canvas). The 'bar' Usercontrol has a de...

databinding IList

Hi I wonder what is the problem when i databind to an IList.. For some reason i can't bind to an Observablecollection and when i databing my grid (a Devexpress grid) to my IList i have many refresh issues. <c:GridControlEx x:Name="grdCT" DataSource="{Binding CDTransf}"> Where ...

Binding to two values

Hi All, Is it possible to bind a label content to two values. For eg, I want a single label whose content is displayed as below, UserName= Firstname, Lastname where Firstname and Lastname, both are values from database. If I would be using to labels I would bind as Content={Binding Firstname} for one and Content={Binding Lastname} for...

Get binding target from source?

I have a ListView whose ItemsSource is bound to an ObservableCollection. The collection is filled with "WaypointItem" objects (a small class we defined with the info for the listview). The WaypointItem is our binding source for each row, but is there any magic way to get a reference to all objects (targets) binding to this class from wi...

WPF designer gives exception when databinding a label to a checkbox

I'm sure it's something stupid, but I'm playing around with databinding. I have a checkbox and a label on a form. What I'm trying to do is simply bind the Content of the label to the checkbox's IsChecked value. What I've done runs fine (no compilation errors and acts as expected), but if I touch the label in the XAML, the designer tro...

Using data binding on value which is a FrameworkElement

One of my data sources produces a collection of values which are typed to the following interface public interface IData { string Name { get; } FrameworkElement VisualElement { get; } } I'd like to use data binding in WPF to display a collection of IData instances in a TabControl where the Name value becomes the header of the ...