Hi I am trying to bind my ComboBox selected Item to a property in my view model where a setter will take this value and perform some other logic. Now my ComboBox is working correctly pulling items off an observablecollection Systems however I have been unable to bind the selectedItem which is a serial to a property. The selected item is not getting the string value of the ComboBox. Eveything else is ok the DataContext is assigned to the view in the code behind. Any ideas this is my viewModel:
public class CablingRequests : ObservableCollection<CablingRequest>
{
public ObservableCollection<CablingRequest> PendingRequests { get; set; }
public ObservableCollection<CablingRequest> ProcessedRequests { get; set; }
public ObservableCollection<CablingRequest> Systems { get; set; }
public ObservableCollection<CablingRequest> SelectedSystemConfiguration { get; set; }
private string _serial;
public string Serial
{
get { return _serial; }
set
{
if (_serial == value)
return;
_serial = value;
GetSelectedSystemConfiguration(_serial);
}
}
And my xaml code of the combobox:
<ComboBox x:Name="ComboBoxSerial" ItemsSource="{Binding Path=Systems}"
DisplayMemberPath="SerialNumber" SelectedValue="{Binding Path=Serial, Mode=TwoWay}"
IsSynchronizedWithCurrentItem="True" MinWidth="150" />