
I've got a DoubleEditBox in a ListBox's ItemTemplate, like this:
<ListBox ItemsSource="{Binding Offsets}" >
<ListBox.ItemTemplate>
<DataTemplate>
<actiedit:DoubleEditBox Format="F2" Minimum="-1" Maximum="1" SmallChange=".01" Value="{Binding Path=Lengthwise}" ValueChanged="DoubleEditBox_ValueChanged" />
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
The Offsets property is just:
public List<MyObj> Offsets
{
get { return _offsets; }
set { _offsets = value; RaisePropertyChanged(); }
}
private List<MyObj> _offsets = new List<MyObj>();
public class MyObj
{
public float Lengthwise { get; set; }
}
This works perfectly - however, every time a Lengthwise value changes, the ValueChanged event fires *twice*. If I change Lengthwise to double, then it works the same, but the event fires once.
Why would binding to float cause every event to be fired a duplicate time, but binding to double not (and is there a way to bind to float while avoiding these duplicate events?)