Can the trigger react to property changing?

Nov 25, 2010 at 10:55 PM
Edited Nov 25, 2010 at 10:55 PM

Hi,

I was thinking of a way to react with the WF by sending commands from the main program.

Is there some way that I can define trigger that would react to property changing? I could use that to transition to another state using some condition afterwards:

externalTypeInstance.SomeProperty = EventType.Edit;

where ExternalType implements INotifyPropertyChanged, EventType is an enum (but could be anything). When the property changes, the trigger fires and checks for a condition.

Or, if there's some other way that I can send commands/events/data to workflow at runtime could you point me to it?

 

The way I'm using the StateMachine is in a WinForm with 6-10 buttons - each button makes an action and transitions the form to some state, and for each state only some buttons are visible. Currently, we have state machine implemented through state pattern in the code, and it's very difficult to see the transitions clearly.

Coordinator
Jan 3, 2011 at 11:35 PM

Check out the WF4 State Machine Driven WPF UI sample http://code.msdn.microsoft.com/WF4SMUI

It does what you are suggesting (but uses WPF - principles are similar for WinForms though)