R
ryan baldwin
I have a WPF combobox in which I'm binding the SelectedIndex to a model
class I've developed. Assume something similar to the following (but
with different names, etc... this is a simplified version):
<ComboBox Name="myCombo" ItemsSource="{Binding ComboSource}"
SelectedIndex="{Binding IndexOfCombo, Mode=OneWay}" />
In my model I occasionally will set IndexOfCombo back to 0, and will
then publish a NotifyPropertyChanged for IndexOfCombo. This sets the
selected index of the combobox to 0 as I would expect.... UNLESS the
user has already selected something int he combobox. For whatever
reason, it's as though the combobox will ignore the
NotifyPropertyChanged if the user has selected an item in the combobox.
Is this behaviour expected? Is there a way to prohibit the combobox
from ignoring the NotifyPropertyChanged event? I'm very confused as to
why this is happening.
Any help would be gracefully accepted, as this issue has burned my
entire morning...
Thanks!
- ryan.
class I've developed. Assume something similar to the following (but
with different names, etc... this is a simplified version):
<ComboBox Name="myCombo" ItemsSource="{Binding ComboSource}"
SelectedIndex="{Binding IndexOfCombo, Mode=OneWay}" />
In my model I occasionally will set IndexOfCombo back to 0, and will
then publish a NotifyPropertyChanged for IndexOfCombo. This sets the
selected index of the combobox to 0 as I would expect.... UNLESS the
user has already selected something int he combobox. For whatever
reason, it's as though the combobox will ignore the
NotifyPropertyChanged if the user has selected an item in the combobox.
Is this behaviour expected? Is there a way to prohibit the combobox
from ignoring the NotifyPropertyChanged event? I'm very confused as to
why this is happening.
Any help would be gracefully accepted, as this issue has burned my
entire morning...
Thanks!
- ryan.