MindFusion.Scheduling for Silverlight Programmer's Guide
Dependencies

The dependencies represent relationships between the activities in the project. Dependencies are represented in the object model by the IDependencyViewModel interface. The dependencies in the project can be obtained from the Dependencies property of the IProjectViewModel.

Creating New Dependencies

New dependencies can be created by calling the CreateDependency method. This method takes as argument the source and target activities of the dependency being created. These parameters cannot be null (Nothing in Visual Basic). Creating a new dependency through the ViewModel is automatically reflected back to the Model if the Model implements the IList interface. The type of the newly created Model dependency is specified by the DependencyType property of the project.

The following sample code creates and initializes a new dependency in an existing project:

C#  Copy Code

var dependency = project.CreateDependency(sourceActivity, targetActivity);
dependency.DependencyType = DependencyType.FinishToFinish;

Visual Basic  Copy Code

Dim dependency = project.CreateDependency(sourceActivity, targetActivity)
dependency.DependencyType = DependencyType.FinishToFinish

Deleting Dependencies

Dependencies are deleted through the RemoveDependency method. Dependency deletion is automatically reflected back to the Model if the Model implements the IList interface.

Modifying Dependencies

Dependencies can be modified through the properties exposed by the IDependencyViewModel interface.

Undo and Redo

All of the above operations are undoable. Check Undo and Redo for additional information.