PropertyChanged event is called multiple times when cancel is called

PropertyChanged event is called multiple times when cancel is called

Old forum URL: forums.lhotka.net/forums/t/7542.aspx


alef posted on Monday, August 31, 2009

In the UI I'm using the cslaActionExtender control and I want to trap the event when the user has clicked on the Cancel button.

I was trying this to subscribe to the PropertyChanged event (event parameter PropertyName will be "") but this event is called twice. (Csla.Core.UndoableBase.UndoChanges(int parentEditLevel=1 and Csla.Core.UndoableBase.UndoChanges(int parentEditLevel=1).

So finally I don't known how to trap the Cancel event only once?

 

miguelcastro67 replied on Monday, August 31, 2009

What you want to do is first identify the Cancel button through its CommandName property (in the CSLA category). Then you tap into the Clicking or Clicked (before/after) event of the action extender. The CommandName of the button that caused this event to fire on the extender will be available in the event argument.
This should help you out.
Miguel

alef replied on Tuesday, September 01, 2009

Thanks. This solves my problem.
Just for curiosity. Why is the PropertyChanged event called two times?

Copyright (c) Marimer LLC