Custom dependency behavior providing alternative to-Finish constraints within Gantt Chart Library and Project Management Library for WPF

By design and by default, to-Finish dependency types generate before constraints (i.e. the dependent task cannot finish after the predecessor's start/finish). Sometimes, this may be inconsistent with your requirements, which might require after constraints for to-Finish dependency types (i.e. the dependent task cannot finish before the predecessor's start/finish).

To show you how you can resolve this issue, we have prepared sample code that disables the original dependency behavior and defines a new, custom dependency behavior: Custom Dependency Behavior sample.

Note that the code in this sample doesn't remove event handlers that are used to listen to task and predecessor property and collection changes, as it only intends to show that you can write completely custom dependency behaviors for our controls in your applications. Moreover, in this sample we have disabled drag and drop operations for creating dependency lines between tasks (setting dependencies as read only for the chart area, allowing, though, predecessor edits from the Predecessors grid view column), because the custom behavior doesn't automatically update task values to original preferred values when a dependency was temporarily created (during the drag operation, while hovering a successor task bar) and hasn't actually got applied eventually (i.e. dragging the dependency away). Finally, please note that you might want to also handle schedule and assignment object changes and trigger dependency coercion when such events occur, too.