How do bind to more than one property in WPF?
I know that you can use the ItemStringFormat="{0} my hard coded string"
to describe a string value but I am interested in something like this ItemStringFormat="{0} ({1})"
where item zero is a property and item one is a property in the bound class.
public class ExchangeRate
{
public int ID { get; set; }
public string Code { get; set; }
public string Description { get; set; }
public decimal Rate { get; set; }
}
<ComboBox Margin="5,0" Name="Currency" ItemsSource="{Binding}" DisplayMemberPath="Description" SelectedValuePath="Code"/>
This will give me a list with all the currency descriptions but what i want is something like this
"US Dollar (USD)"
where is "US Dollar" is the property Description and "USD" is the prorpety Code