I have following class
public class ButtonChange
{
private int _buttonState;
public void SetButtonState(int state)
{
_buttonState = state;
}
}
I want to fire an event whenever _buttonState value changes, finaly I want to define an event handler in ButtonChange
Will you guys help me please??
P.S : I dont want to use INotifyPropertyChanged
How about:
If you wanted the
StateChangedevent handler to know the new state, you could derive your own class fromEventArgs, e.g.ButtonStateEventArgsand then use an event type ofEventHandler<ButtonStateEventArgs>.Note that this implementation doesn’t try to be thread-safe.