My Combobox:
<pmControls:pmComboBox Grid.Row="3" Grid.Column="1" Margin="3"
SelectedItem="{Binding Applicable_For,Mode=Two Way}" DisplayMemberPath="Applicable_For"
SelectedValuePath="Applicable_For">
<pmControls:pmComboBoxItem Content="Parcel" ></pmControls:pmComboBoxItem>
<pmControls:pmComboBoxItem Content="Property"></pmControls:pmComboBoxItem>
</pmControls:pmComboBox>
Have Added 2 static items to combobox as parcel and property and want to get these values
using binding .
I have given binding to SelectedItem and my binding field is Applicable_For.
Using above code am getting value as null in Applicable_For.
EDIT: I have added Mode=Two Way for Selected Item which I have forgot before.
But not it getting value as namespace like ‘PropMgmt.Controls.pmComboBoxItem’
Please Help..
Instead of adding static items to combo box you can create a collection for it. for ex. Create class like:
Then in your view model add following code:
Then in xaml add following:
Hope this solve your problem.