Re-hosting the WF Designer with WF4.5 Designer Features

At first I thought that I could just re-host the WF Designer in WF4.5 the same way it is done in WF4 and inherit the new WF Designer changes within WF4.5, that were mentioned in my previous post. This is not the case! Although the designer will be re-hosted you need the following code for gain the new designer features...

wfDesigner = new WorkflowDesigner();

wfDesigner.Context.Services.GetService<DesignerConfigurationService>().AnnotationEnabled = true;

wfDesigner.Context.Services.GetService<DesignerConfigurationService>().TargetFrameworkName = new

System.Runtime.Versioning.FrameworkName(".NET Framework", new Version(4, 5));

wfDesigner.Load(new Sequence());

The FrameworkName must eather be '.NET Framework' or '.NETFramework' and make sure that the WF Designer Load method is called last. After adding these changes to the code, the designer will reflect the new features.

Currently rated 1.9 by 30 people

  • Currently 1.866667/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 5/16/2012 at 1:39 PM
Actions: E-mail | Kick it! | DZone it! |
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed
Comments are closed