On Sep 13, 7:12*pm, Peter Duniho <NpOeStPe...@NnOwSlPiAnMk.com> wrote:
> On 9/13/11 1:22 PM, dves...@gmail.com wrote:
>
> Fortunately, it should not be difficult to treat consecutive invocations
> of the event handler when the Current property has not really changed,
> simply by keeping track of what the property was the last time the event
> was raised and comparing it to the current Current value.
>
> In any case, I do recommend submitting a bug on the Connect web site, to
> at least see what Microsoft says about it. *Maybe they'd even offer a
> better work-around than I have.
>
> In the meantime, you can console yourself with the fact that this guy is
> seeing the event being raised not three times, but FOUR:http://social.msdn.microsoft.com/for...atacontrols/th...
>
> And no one ever replied to his question at all. *
>
> Pete
Thanks, Peter. When the property changes, I do some expensive
processing that's not _quite_ expensive enough to stick in a non-GUI
thread...unless it happens 3 times.
I worked around it by setting the datasource first, then subscribing
to the event. In the event handler and immediately after subscribing
to the event, I call a function that does the work, so I avoid the
initial glut of events.