This documentation is archived and is not being maintained.

Interop with 3.5 Rule Set

This topic applies to Windows Workflow Foundation 4 (WF4).

This sample demonstrates the use of the Interop activity to integrate with a custom activity in .NET Framework 3.5 using Policy and rules. It passes data to the custom activity by binding .NET Framework version 4 variables to the dependency properties exposed by the custom activity.


  1. Visual Studio 2010

  2. .NET Framework version 4

  3. .NET Framework version 3.5


Interop activity, Policy activity in .NET Framework 3.5 with dependency properties


The sample demonstrates one of the integration scenarios for integrating with a .NET Framework 3.5 activity. This sample includes a .NET Framework 3.5 custom activity that invokes a Policy activity.


Opening TravelRuleSet.cs in the designer shows a custom sequential activity that contains a Policy activity as follows

Interop Activity

Double-click the DiscountPolicy policy activity to examine the rules. The Rules editor appears to show the rules.

Rule Set Editor

Right-click the DiscountPolicy activity and select the View Code option to examine the code-beside C# code that goes with this activity. Observe the dependency property setting for DiscountLevel. This is equivalent to an Argument in .NET Framework 4.

public static DependencyProperty DiscountLevelProperty = DependencyProperty.Register("DiscountLevel", typeof(int), typeof(TravelRuleSet));

[CategoryAttribute("DiscountLevel Category")]
public int DiscountLevel
return ((int)base.GetValue(TravelRuleSet.DiscountLevelProperty)));
base.SetValue(TravelRuleSet.DiscountLevelProperty, value);


This is a .NET Framework 4 sequential workflow project that uses the Interop activity to integrate with the custom rule set created in the TravelRuleLibrary project. Variables are created on the top-level Sequence as follows.


Solution Explorer

Lastly, the Interop activity is used to integrate with the TravelRuleSet. The variables that were declared earlier on the Sequence are used to bind to the dependency properties.

Activity Type


Ee829487.Important(en-us,VS.100).gif Note:
The samples may already be installed on your computer. Check for the following (default) directory before continuing.


If this directory does not exist, go to Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4 to download all Windows Communication Foundation (WCF) and WF samples. This sample is located in the following directory.