<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Matt W's Windows Workflow Place : designer</title><link>http://blogs.msdn.com/mwinkle/archive/tags/designer/default.aspx</link><description>Tags: designer</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Inspection, Default Services and Items (WF4 EditingContext Intro Part 6)</title><link>http://blogs.msdn.com/mwinkle/archive/2009/12/23/inspection-default-services-and-items-wf4-editingcontext-intro-part-6.aspx</link><pubDate>Wed, 23 Dec 2009 01:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9940348</guid><dc:creator>mwinkle</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/mwinkle/comments/9940348.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mwinkle/commentrss.aspx?PostID=9940348</wfw:commentRss><description>
&lt;STYLE id=toolsplat_features_updated_29733_Styles&gt;






&lt;!--table
	{mso-displayed-decimal-separator:"\.";
	mso-displayed-thousand-separator:"\,";}
.xl1529733
	{padding-top:1px;
	padding-right:1px;
	padding-left:1px;
	mso-ignore:padding;
	color:black;
	font-size:11.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:calibri, sans-serif;
	mso-font-charset:0;
	mso-number-format:general;
	text-align:general;
	vertical-align:bottom;
	mso-background-source:auto;
	mso-pattern:auto;
	white-space:nowrap;}
.xl6529733
	{padding-top:1px;
	padding-right:1px;
	padding-left:1px;
	mso-ignore:padding;
	color:#006100;
	font-size:11.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:calibri, sans-serif;
	mso-font-charset:0;
	mso-number-format:general;
	text-align:general;
	vertical-align:bottom;
	background:#c6efce;
	mso-pattern:black none;
	white-space:nowrap;}
.xl6629733
	{padding-top:1px;
	padding-right:1px;
	padding-left:1px;
	mso-ignore:padding;
	color:#9c0006;
	font-size:11.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:calibri, sans-serif;
	mso-font-charset:0;
	mso-number-format:general;
	text-align:general;
	vertical-align:bottom;
	background:#ffc7ce;
	mso-pattern:black none;
	white-space:nowrap;}
--&gt;&lt;/STYLE&gt;

&lt;STYLE id=toolsplat_features_updated_16386_Styles&gt;







&lt;!--table
	{mso-displayed-decimal-separator:"\.";
	mso-displayed-thousand-separator:"\,";}
.xl1516386
	{padding-top:1px;
	padding-right:1px;
	padding-left:1px;
	mso-ignore:padding;
	color:black;
	font-size:11.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:calibri, sans-serif;
	mso-font-charset:0;
	mso-number-format:general;
	text-align:general;
	vertical-align:bottom;
	mso-background-source:auto;
	mso-pattern:auto;
	white-space:nowrap;}
.xl6516386
	{padding-top:1px;
	padding-right:1px;
	padding-left:1px;
	mso-ignore:padding;
	color:#006100;
	font-size:11.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:calibri, sans-serif;
	mso-font-charset:0;
	mso-number-format:general;
	text-align:general;
	vertical-align:bottom;
	background:#c6efce;
	mso-pattern:black none;
	white-space:nowrap;}
.xl6616386
	{padding-top:1px;
	padding-right:1px;
	padding-left:1px;
	mso-ignore:padding;
	color:#9c0006;
	font-size:11.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:calibri, sans-serif;
	mso-font-charset:0;
	mso-number-format:general;
	text-align:general;
	vertical-align:bottom;
	background:#ffc7ce;
	mso-pattern:black none;
	white-space:nowrap;}
--&gt;&lt;/STYLE&gt;

&lt;P&gt;This part 6 of my 6&amp;nbsp; part series on the EditingContext.&lt;/P&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/mwinkle/archive/2009/12/21/introduction-to-the-wf4-designer-editing-context-part-1.aspx" mce_href="http://blogs.msdn.com/mwinkle/archive/2009/12/21/introduction-to-the-wf4-designer-editing-context-part-1.aspx"&gt;Introduction&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/mwinkle/archive/2009/12/21/sharing-functionality-between-designers-wf4-editingcontext-intro-part-2.aspx" mce_href="http://blogs.msdn.com/mwinkle/archive/2009/12/21/sharing-functionality-between-designers-wf4-editingcontext-intro-part-2.aspx"&gt;Sharing Functionality between Designers&lt;/A&gt;&amp;nbsp; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/mwinkle/archive/2009/12/22/host-provided-capabilities-wf4-editingcontext-intro-part-3.aspx" mce_href="http://blogs.msdn.com/mwinkle/archive/2009/12/22/host-provided-capabilities-wf4-editingcontext-intro-part-3.aspx"&gt;Host provided capabilities&lt;/A&gt;&amp;nbsp;&amp;nbsp; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/mwinkle/archive/2009/12/22/providing-callbacks-for-the-host-wf4-editingcontext-intro-part-4.aspx" mce_href="http://blogs.msdn.com/mwinkle/archive/2009/12/22/providing-callbacks-for-the-host-wf4-editingcontext-intro-part-4.aspx"&gt;Providing callbacks for the host&lt;/A&gt;&amp;nbsp; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/mwinkle/archive/2009/12/22/subscription-notification-engine-wf4-editingcontext-intro-part-5.aspx" mce_href="http://blogs.msdn.com/mwinkle/archive/2009/12/22/subscription-notification-engine-wf4-editingcontext-intro-part-5.aspx"&gt;Subscription/Notification engine&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/mwinkle/archive/2009/12/23/inspection-default-services-and-items-wf4-editingcontext-intro-part-6.aspx" mce_href="http://blogs.msdn.com/mwinkle/archive/2009/12/23/inspection-default-services-and-items-wf4-editingcontext-intro-part-6.aspx"&gt;Inspection, Default Services and Items (you are here)&lt;/A&gt; 
&lt;P&gt;I want to wrap up this series of posts by posting some code for an activity designer that functions more as a diagnostic tool, and will display all of the Items and services of the EditingContext within the designer.&amp;nbsp; This will be useful from an investigation perspective, and hopefully as a diagnostic tool.&amp;nbsp; We will use this to help us understand what are the services that are available out of the box in VS, as well as in a rehosted application.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;We first need to create an empty activity to attach a designer to.&lt;/P&gt;&lt;PRE class=csharpcode&gt;&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System;
&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Collections.Generic;
&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Linq;
&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Text;
&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Activities;
&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.ComponentModel;

&lt;SPAN class=kwrd&gt;namespace&lt;/SPAN&gt; blogEditingContext
{
    [Designer(&lt;SPAN class=kwrd&gt;typeof&lt;/SPAN&gt;(DiagnosticDesigner))]
    &lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;sealed&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;class&lt;/SPAN&gt; Diagnosticator : CodeActivity
    {
        &lt;SPAN class=rem&gt;// Define an activity input argument of type string&lt;/SPAN&gt;
        &lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; InArgument&amp;lt;&lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt;&amp;gt; Text { get; set; }

        &lt;SPAN class=rem&gt;// If your activity returns a value, derive from CodeActivity&amp;lt;TResult&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class=rem&gt;// and return the value from the Execute method.&lt;/SPAN&gt;
        &lt;SPAN class=kwrd&gt;protected&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;override&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;void&lt;/SPAN&gt; Execute(CodeActivityContext context)
        {
            &lt;SPAN class=rem&gt;// Obtain the runtime value of the Text input argument&lt;/SPAN&gt;
            &lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt; text = context.GetValue(&lt;SPAN class=kwrd&gt;this&lt;/SPAN&gt;.Text);
        }
    }
}&lt;/PRE&gt;
&lt;STYLE type=text/css&gt;





.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/STYLE&gt;

&lt;P&gt;Now, let’s create our designer.&amp;nbsp; We could do fancy treeviews or object browser style UI’s, but as this is a blog post, I want to provide you with the basics, and then let you figure out how that is most useful to you.&amp;nbsp; So, we will just create a designer that writes out to debug output the relevant information.&amp;nbsp; &lt;/P&gt;&lt;PRE class=csharpcode&gt;&lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;sap:ActivityDesigner&lt;/SPAN&gt; &lt;SPAN class=attr&gt;x:Class&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="blogEditingContext.DiagnosticDesigner"&lt;/SPAN&gt;
    &lt;SPAN class=attr&gt;xmlns&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/SPAN&gt;
    &lt;SPAN class=attr&gt;xmlns:x&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/SPAN&gt;
    &lt;SPAN class=attr&gt;xmlns:sap&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"&lt;/SPAN&gt;
    &lt;SPAN class=attr&gt;xmlns:sapv&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Grid&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;Button&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Click&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Button_Click"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;Debug.WriteLine Context Data&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;Button&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;Grid&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;sap:ActivityDesigner&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;STYLE type=text/css&gt;







.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/STYLE&gt;

&lt;P&gt;And now the code&lt;/P&gt;&lt;PRE class=csharpcode&gt;&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Diagnostics;
&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Linq;
&lt;SPAN class=kwrd&gt;using&lt;/SPAN&gt; System.Windows;

&lt;SPAN class=kwrd&gt;namespace&lt;/SPAN&gt; blogEditingContext
{
    &lt;SPAN class=rem&gt;// Interaction logic for DiagnosticDesigner.xaml&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;partial&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;class&lt;/SPAN&gt; DiagnosticDesigner
    {
        &lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; DiagnosticDesigner()
        {
            InitializeComponent();
        }

        &lt;SPAN class=kwrd&gt;private&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;void&lt;/SPAN&gt; Button_Click(&lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; sender, RoutedEventArgs e)
        {
            &lt;SPAN class=rem&gt;// the goal here is to output meaningful and useful information about &lt;/SPAN&gt;
            &lt;SPAN class=rem&gt;// the contents of the editing context here. &lt;/SPAN&gt;
            &lt;SPAN class=kwrd&gt;int&lt;/SPAN&gt; level = Debug.IndentLevel;
            Debug.WriteLine(&lt;SPAN class=str&gt;"Items in the EditingContext"&lt;/SPAN&gt;);
            Debug.IndentLevel++;
            &lt;SPAN class=kwrd&gt;foreach&lt;/SPAN&gt; (var item &lt;SPAN class=kwrd&gt;in&lt;/SPAN&gt; Context.Items.OrderBy(x =&amp;gt; x.ItemType.ToString()))
            {
                Debug.WriteLine(item.ItemType);
            }

            Debug.IndentLevel = level;
            Debug.WriteLine(&lt;SPAN class=str&gt;"Services in the EditingContext"&lt;/SPAN&gt;);
            &lt;SPAN class=kwrd&gt;foreach&lt;/SPAN&gt; (var service &lt;SPAN class=kwrd&gt;in&lt;/SPAN&gt; Context.Services.OrderBy(x =&amp;gt; x.ToString()))
            {
                Debug.WriteLine(service);
            }
        }
    }
}&lt;/PRE&gt;
&lt;STYLE type=text/css&gt;







.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/STYLE&gt;

&lt;P&gt;Let’s break this down.&amp;nbsp; The work here happens in the button click where we simply order by types’ string representations and output them to the debug writer (a more robust implementation might use a trace writer that could be configured in the app, but for this purpose, this will be sufficient. &lt;/P&gt;
&lt;P&gt;So, what output do we get?&lt;/P&gt;
&lt;H1&gt;&lt;/H1&gt;
&lt;H1&gt;VS Standard Services and Items&lt;/H1&gt;
&lt;P&gt;We determine this by using the activity in a freshly opened WF project&lt;/P&gt;
&lt;H2&gt;Items&lt;/H2&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;
&lt;TABLE border=0 cellSpacing=0 cellPadding=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width=64&gt;System.Activities.Presentation.Hosting.AssemblyContextControlItem&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Hosting.ReadOnlyState&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Hosting.WorkflowCommandExtensionItem&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.View.Selection&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.WorkflowFileItem&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/P&gt;
&lt;H2&gt;Services&lt;/H2&gt;
&lt;TABLE border=0 cellSpacing=0 cellPadding=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width=64&gt;System.Activities.Presentation.Debug.IDesignerDebugView&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.DesignerPerfEventProvider&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.FeatureManager&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Hosting.ICommandService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Hosting.IMultiTargetingSupportService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Hosting.WindowHelperService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.IActivityToolboxService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.IIntegratedHelpService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.IWorkflowDesignerStorageService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.IXamlLoadErrorService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Model.AttachedPropertiesService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Model.ModelTreeManager&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Services.ModelService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Services.ViewService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.UndoEngine&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Validation.IValidationErrorService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Validation.ValidationService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.View.ActivityTypeDesigner+DisplayNameUpdater&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.View.DesignerView&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.View.IExpressionEditorService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.View.ViewStateService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.View.VirtualizedContainerService&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;&lt;/H1&gt;
&lt;H1&gt;Basic Rehosted Application Standard Services and Items&lt;/H1&gt;
&lt;H2&gt;Items&lt;/H2&gt;
&lt;TABLE border=0 cellSpacing=0 cellPadding=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width=64&gt;System.Activities.Presentation.Hosting.ReadOnlyState&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Hosting.WorkflowCommandExtensionItem&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.View.Selection&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;H2&gt;Services&lt;/H2&gt;
&lt;TABLE border=0 cellSpacing=0 cellPadding=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width=64&gt;System.Activities.Presentation.DesignerPerfEventProvider&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.FeatureManager&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Hosting.WindowHelperService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Model.AttachedPropertiesService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Model.ModelTreeManager&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Services.ModelService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Services.ViewService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.UndoEngine&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.Validation.ValidationService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.View.DesignerView&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.View.ViewStateService&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;System.Activities.Presentation.View.VirtualizedContainerService&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;H1&gt;Comparison Table View&lt;/H1&gt;
&lt;DIV align=center x:publishsource="Excel"&gt;
&lt;TABLE style="WIDTH: 507pt; BORDER-COLLAPSE: collapse; TABLE-LAYOUT: fixed" border=0 cellSpacing=0 cellPadding=0 width=676&gt;
&lt;COLGROUP&gt;
&lt;COL style="WIDTH: 396pt; mso-width-source: userset; mso-width-alt: 19309" width=528&gt;
&lt;COL style="WIDTH: 48pt" width=64&gt;
&lt;COL style="WIDTH: 63pt; mso-width-source: userset; mso-width-alt: 3072" width=84&gt;&lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; WIDTH: 396pt; FONT-FAMILY: calibri; BACKGROUND: #4f81bd; HEIGHT: 15pt; COLOR: white; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 700; TEXT-DECORATION: none; mso-pattern: #4f81bd none; text-underline-style: none; text-line-through: none" class=xl1529733 height=20 width=528 align=left class="xl1529733"&gt;Items&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; WIDTH: 48pt; FONT-FAMILY: calibri; BACKGROUND: #4f81bd; COLOR: white; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 700; TEXT-DECORATION: none; mso-pattern: #4f81bd none; text-underline-style: none; text-line-through: none" class=xl1529733 width=64 align=left class="xl1529733"&gt;VS&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; WIDTH: 63pt; FONT-FAMILY: calibri; BACKGROUND: #4f81bd; COLOR: white; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 700; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: #4f81bd none; text-underline-style: none; text-line-through: none" class=xl1529733 width=84 align=left class="xl1529733"&gt;Rehosted&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1529733 height=20 align=left class="xl1529733"&gt;
&lt;P align=left&gt;System.Activities.Presentation.Hosting.AssemblyContextControlItem&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6529733 align=left class="xl6529733"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #ffc7ce; COLOR: #9c0006; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6629733 align=left class="xl6629733"&gt;
&lt;P align=left&gt;No&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1529733 height=20 align=left class="xl1529733"&gt;
&lt;P align=left&gt;System.Activities.Presentation.Hosting.ReadOnlyState&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6529733 align=left class="xl6529733"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6529733 align=left class="xl6529733"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1529733 height=20 align=left class="xl1529733"&gt;
&lt;P align=left&gt;System.Activities.Presentation.Hosting.WorkflowCommandExtensionItem&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6529733 align=left class="xl6529733"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6529733 align=left class="xl6529733"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1529733 height=20 align=left class="xl1529733"&gt;
&lt;P align=left&gt;System.Activities.Presentation.View.Selection&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6529733 align=left class="xl6529733"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6529733 align=left class="xl6529733"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM: #4f81bd 0.5pt solid; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1529733 height=20 align=left class="xl1529733"&gt;
&lt;P align=left&gt;System.Activities.Presentation.WorkflowFileItem&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6529733 align=left class="xl6529733"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: #4f81bd 0.5pt solid; FONT-FAMILY: calibri; BACKGROUND: #ffc7ce; COLOR: #9c0006; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6629733 align=left class="xl6629733"&gt;
&lt;P align=left&gt;No&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;DIV align=center x:publishsource="Excel"&gt;
&lt;TABLE style="WIDTH: 507pt; BORDER-COLLAPSE: collapse; TABLE-LAYOUT: fixed" border=0 cellSpacing=0 cellPadding=0 width=676&gt;
&lt;COLGROUP&gt;
&lt;COL style="WIDTH: 396pt; mso-width-source: userset; mso-width-alt: 19309" width=528&gt;
&lt;COL style="WIDTH: 48pt" width=64&gt;
&lt;COL style="WIDTH: 63pt; mso-width-source: userset; mso-width-alt: 3072" width=84&gt;&lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; WIDTH: 396pt; FONT-FAMILY: calibri; BACKGROUND: #4f81bd; HEIGHT: 15pt; COLOR: white; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 700; TEXT-DECORATION: none; mso-pattern: #4f81bd none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 width=528 class="xl1516386"&gt;Services&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; WIDTH: 48pt; FONT-FAMILY: calibri; BACKGROUND: #4f81bd; COLOR: white; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 700; TEXT-DECORATION: none; mso-pattern: #4f81bd none; text-underline-style: none; text-line-through: none" class=xl1516386 width=64 class="xl1516386"&gt;VS&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; WIDTH: 63pt; FONT-FAMILY: calibri; BACKGROUND: #4f81bd; COLOR: white; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 700; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: #4f81bd none; text-underline-style: none; text-line-through: none" class=xl1516386 width=84 class="xl1516386"&gt;Rehosted&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.Debug.IDesignerDebugView&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #ffc7ce; COLOR: #9c0006; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6616386 class="xl6616386"&gt;
&lt;P align=left&gt;No&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.DesignerPerfEventProvider&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.FeatureManager&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.Hosting.ICommandService&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #ffc7ce; COLOR: #9c0006; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6616386 class="xl6616386"&gt;
&lt;P align=left&gt;No&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.Hosting.IMultiTargetingSupportService&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #ffc7ce; COLOR: #9c0006; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6616386 class="xl6616386"&gt;
&lt;P align=left&gt;No&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.Hosting.WindowHelperService&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.IActivityToolboxService&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #ffc7ce; COLOR: #9c0006; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6616386 class="xl6616386"&gt;
&lt;P align=left&gt;No&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.IIntegratedHelpService&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #ffc7ce; COLOR: #9c0006; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6616386 class="xl6616386"&gt;
&lt;P align=left&gt;No&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.IWorkflowDesignerStorageService&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #ffc7ce; COLOR: #9c0006; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6616386 class="xl6616386"&gt;
&lt;P align=left&gt;No&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.IXamlLoadErrorService&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #ffc7ce; COLOR: #9c0006; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6616386 class="xl6616386"&gt;
&lt;P align=left&gt;No&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.Model.AttachedPropertiesService&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.Model.ModelTreeManager&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.Services.ModelService&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.Services.ViewService&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.UndoEngine&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.Validation.IValidationErrorService&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #ffc7ce; COLOR: #9c0006; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6616386 class="xl6616386"&gt;
&lt;P align=left&gt;No&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.Validation.ValidationService&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.View.ActivityTypeDesigner+DisplayNameUpdater&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #ffc7ce; COLOR: #9c0006; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6616386 class="xl6616386"&gt;
&lt;P align=left&gt;No&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.View.DesignerView&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.View.IExpressionEditorService&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #ffc7ce; COLOR: #9c0006; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6616386 class="xl6616386"&gt;
&lt;P align=left&gt;No&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.View.ViewStateService&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 15pt" height=20&gt;
&lt;TD style="BORDER-BOTTOM: #4f81bd 0.5pt solid; BORDER-LEFT: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; HEIGHT: 15pt; COLOR: black; FONT-SIZE: 11pt; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; text-underline-style: none; text-line-through: none" class=xl1516386 height=20 class="xl1516386"&gt;
&lt;P align=left&gt;System.Activities.Presentation.View.VirtualizedContainerService&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: #4f81bd 0.5pt solid; BORDER-RIGHT-STYLE: none; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: #4f81bd 0.5pt solid; FONT-FAMILY: calibri; BACKGROUND: #c6efce; COLOR: #006100; FONT-SIZE: 11pt; BORDER-LEFT-STYLE: none; BORDER-TOP: #4f81bd 0.5pt solid; FONT-WEIGHT: 400; BORDER-RIGHT: #4f81bd 0.5pt solid; TEXT-DECORATION: none; mso-pattern: black none; text-underline-style: none; text-line-through: none" class=xl6516386 class="xl6516386"&gt;
&lt;P align=left&gt;Yes&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
&lt;H1&gt;&amp;nbsp;&lt;/H1&gt;
&lt;H1&gt;&amp;nbsp;&lt;/H1&gt;
&lt;H1&gt;&amp;nbsp;&lt;/H1&gt;
&lt;H1&gt;&amp;nbsp;&lt;/H1&gt;
&lt;H1&gt;Conclusion&lt;/H1&gt;
&lt;P&gt;This wraps up our series on the editing context.&amp;nbsp; We’ve gone through the basics of why we need it, what we can do with it, and then we moved how to use it, from both the very simple to the very complex.&amp;nbsp; We’ve finished with a diagnostic tool to help understand what all items I can bind to.&lt;/P&gt;
&lt;P&gt;What’s Next From Here?&lt;/P&gt;
&lt;P&gt;A few ideas for the readers who have read all of these:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Wire up a few attached properties to reflect back through to some interesting data (like if it is selected).&amp;nbsp; These attached properties could then be used directly by your UI (via the binding in XAML) to let your designers display and react to changes in the data &lt;/LI&gt;
&lt;LI&gt;Think about ideas for services you might want to add in VS without depending on an activity to inject it (and send me mail, I am trying to compile a list of interesting things) &lt;/LI&gt;
&lt;LI&gt;Are there service/item implementations you want to override in VS? &lt;/LI&gt;
&lt;LI&gt;Is there a service/item you expect to see that is not there? &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Thanks for now!&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9940348" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/mwinkle/attachment/9940348.ashx" length="22510" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/mwinkle/archive/tags/designer/default.aspx">designer</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/wf4/default.aspx">wf4</category></item><item><title>WF4 Design Time AttachedPropertiesService and Attached Properties</title><link>http://blogs.msdn.com/mwinkle/archive/2009/12/06/wf4-design-time-attachedpropertiesservice-and-attached-properties.aspx</link><pubDate>Sun, 06 Dec 2009 04:51:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9933077</guid><dc:creator>mwinkle</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/mwinkle/comments/9933077.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mwinkle/commentrss.aspx?PostID=9933077</wfw:commentRss><description>&lt;p&gt;I’ve been meaning to throw together some thoughts on attached properties and how they can be used within the designer.&amp;#160; Basically, you can think about attached properties as injecting some additional “stuff” onto an instance that you can use elsewhere in your code. &lt;/p&gt;  &lt;h1&gt;Motivation&lt;/h1&gt;  &lt;p&gt;In the designer, we want to be able to have behavior and view tied to interesting aspects of the data.&amp;#160; For instance, we would like to have a view updated when an item becomes selected.&amp;#160; In WPF, we bind the style based on the “isSelectionProperty.”&amp;#160; Now, our data model doesn’t have any idea of selection, it’s something we’d like the view level to “inject” that idea on any model item so that a subsequent view could take advantage of.&amp;#160; You can kind of view Attached Properties as a nice syntactic sugar to not have to keep a bunch of lookup lists around.&amp;#160; As things like WPF bind to the object very well, and not so much a lookup list, this ends up being an interesting model.&lt;/p&gt;  &lt;p&gt;To be clear, you could write a number of value converters that take the item being bound, look up in a lookup list somewhere, and return the result that will be used.&amp;#160; The problem we found is that we were doing this in a bunch of places, and we really wanted to have clean binding statements inside our WPF XAML, rather than hiding a bunch of logic in the converters. &lt;/p&gt;  &lt;h1&gt;How Does it Work&lt;/h1&gt;  &lt;p&gt;First, some types.&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="548"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="200"&gt;Name&lt;/td&gt;        &lt;td valign="top" width="346"&gt;Description&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.model.attachedpropertiesservice(VS.100).aspx"&gt;&lt;a href="http://bit.ly/6dvvwh"&gt;AttachedPropertiesService&lt;/a&gt;&lt;/a&gt;&lt;/td&gt;        &lt;td valign="top" width="346"&gt;Service in editing context for managing AttachedProperties&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.model.attachedproperty(VS.100).aspx"&gt;&lt;a href="http://bit.ly/4MioTX"&gt;AttachedProperty&lt;/a&gt;&lt;/a&gt;&lt;/td&gt;        &lt;td valign="top" width="346"&gt;Base attached property type (abstract)&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee473952(VS.100).aspx"&gt;&lt;a href="http://bit.ly/4NYHil"&gt;AttachedProperty&amp;lt;T&amp;gt;&lt;/a&gt;&lt;/a&gt;&lt;/td&gt;        &lt;td valign="top" width="346"&gt;Strongly typed attached property with interesting getter/setter programmability&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;in diagram form:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/WF4DesignTimeAttachedPropertiesServicean_124AC/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/WF4DesignTimeAttachedPropertiesServicean_124AC/image_thumb.png" width="712" height="376" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;One thing that might look a little funny to some folks who have used attached properties in other contexts (WF3, WPF, XAML), is the “&lt;a href="http://bit.ly/5DvhJs"&gt;IsBrowsable&lt;/a&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.model.attachedproperty.isbrowsable(VS.100).aspx"&gt;&lt;/a&gt;” property.&amp;#160; The documentation is a little sparse right now, but what this will do is determine how discoverable the property is.&amp;#160; If this is set to true, the attached property will show up in the Properties collection of the ModelItem to which the AP is attached.&amp;#160; What this means is that it can show up in the Property grid, you can bind WPF statements directly to it, as if it were a real property of the object.&amp;#160; Attached properties by themselves have no actual storage representation, so these exist as design time only constructs. &lt;/p&gt;  &lt;h2&gt;Getter/ Setter? &lt;/h2&gt;  &lt;p&gt;One other thing that you see on the &lt;a href="http://msdn.microsoft.com/en-us/library/ee473952(VS.100).aspx"&gt;&lt;/a&gt;&lt;a href="http://bit.ly/4NYHil"&gt;AttachedProperty&amp;lt;T&amp;gt;&lt;/a&gt;&lt;/a&gt; is the &lt;a href="http://bit.ly/5woYQg"&gt;Getter&lt;/a&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee473895(VS.100).aspx"&gt;&lt;/a&gt; and &lt;a href="http://bit.ly/75yEyX"&gt;Setter&lt;/a&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee473838(VS.100).aspx"&gt;&lt;/a&gt; properties.&amp;#160; These are of type Func&amp;lt;ModelItem,T&amp;gt; and Action&amp;lt;ModelItem,T&amp;gt; respectively.&amp;#160; What these allow you to do is perform some type of computation whenever the get or set is called against the AttachedProperty.&amp;#160; Why is this interesting?&amp;#160; Well, let’s say that you’d like to have a computed value retrieved, such as “IsPrimarySelection” checking with the Selection context item to see if an item is selected.&amp;#160; Or, customizing the setter to either store the value somewhere more durable, or updating a few different values.&amp;#160; The other thing that happens is that since all of these updates go through the ModelItem tree, any changes will be propagated to other listeners throughout the designer. &lt;/p&gt;  &lt;h1&gt;Looking at Some Code&lt;/h1&gt;  &lt;p&gt;Here is a very small console based app that shows how you can program against the attached properties.&amp;#160; An interesting exercise for the reader would be to take this data structure, put it in a WPF app and experiment with some of the data binding. &lt;/p&gt;  &lt;p&gt;First, two types:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Dog
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Name { get; set; }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Noise { get; set; }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; Age { get; set; }
   
}

&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Cat
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Name { get; set; }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Noise { get; set; }
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; Age { get; set; }
}&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Ignore no common base type, that actually makes this a little more interesting, as we will see. &lt;/p&gt;

&lt;p&gt;Now, let’s write some code.&amp;#160; First, let’s initialize and &lt;a href="http://bit.ly/81kTQz"&gt;EditingContext&lt;/a&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.editingcontext(VS.100).aspx"&gt;&lt;/a&gt; and &lt;a href="http://bit.ly/5mJyPi"&gt;ModelTreeManager&lt;/a&gt;.&amp;#160; &lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;     &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Main(&lt;span class="kwrd"&gt;string&lt;/span&gt;[] args)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;        {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;            EditingContext ec = &lt;span class="kwrd"&gt;new&lt;/span&gt; EditingContext();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;            ModelTreeManager mtm = &lt;span class="kwrd"&gt;new&lt;/span&gt; ModelTreeManager(ec);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;            mtm.Load(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt;[] { &lt;span class="kwrd"&gt;new&lt;/span&gt; Dog { Name = &lt;span class="str"&gt;&amp;quot;Sasha&amp;quot;&lt;/span&gt;, Noise = &lt;span class="str"&gt;&amp;quot;Snort&amp;quot;&lt;/span&gt;, Age = 5 },&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;                                    &lt;span class="kwrd"&gt;new&lt;/span&gt; Cat { Name=&lt;span class="str"&gt;&amp;quot;higgs&amp;quot;&lt;/span&gt;, Noise=&lt;span class="str"&gt;&amp;quot;boom&amp;quot;&lt;/span&gt;, Age=1 } });&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;            dynamic root = mtm.Root;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;            dynamic dog = root[0];&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;            dynamic cat = root[1];&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;            ModelItem dogMi = root[0] &lt;span class="kwrd"&gt;as&lt;/span&gt; ModelItem;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;            ModelItem catMi = root[1] &lt;span class="kwrd"&gt;as&lt;/span&gt; ModelItem;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note, lines 7-9 will not work in Beta2 (preview of coming attractions).&amp;#160; To get lines 10-11 working in beta2, cast root to ModelItemCollection and then use the indexers to extract the values&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, let’s build an attached property, and we will assign it only to type “dog”&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="rem"&gt;// Add an attached Property&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;AttachedProperty&amp;lt;&lt;span class="kwrd"&gt;bool&lt;/span&gt;&amp;gt; ap = &lt;span class="kwrd"&gt;new&lt;/span&gt; AttachedProperty&amp;lt;&lt;span class="kwrd"&gt;bool&lt;/span&gt;&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    IsBrowsable = &lt;span class="kwrd"&gt;true&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    Name = &lt;span class="str"&gt;&amp;quot;IsAnInterestingDog&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;    Getter = (mi =&amp;gt; mi.Properties[&lt;span class="str"&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;].ComputedValue.ToString() == &lt;span class="str"&gt;&amp;quot;Sasha&amp;quot;&lt;/span&gt;),&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    OwnerType = &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(Dog)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;};&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;ec.Services.Publish&amp;lt;AttachedPropertiesService&amp;gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; AttachedPropertiesService());&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;AttachedPropertiesService aps = ec.Services.GetService&amp;lt;AttachedPropertiesService&amp;gt;();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;aps.AddProperty(ap);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;Console.WriteLine(&lt;span class="str"&gt;&amp;quot;---- Enumerate properties on dog (note new property)----&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;dogMi.Properties.ToList().ForEach(mp =&amp;gt; Console.WriteLine(&lt;span class="str"&gt;&amp;quot; Property : {0}&amp;quot;&lt;/span&gt;, mp.Name));&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;Console.WriteLine(&lt;span class="str"&gt;&amp;quot;---- Enumerate properties on cat (note  no new property) ----&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;catMi.Properties.ToList().ForEach(mp =&amp;gt; Console.WriteLine(&lt;span class="str"&gt;&amp;quot; Property : {0}&amp;quot;&lt;/span&gt;, mp.Name));&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Let’s break down what happened here.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Line2-8, create an AttachedProperty&amp;lt;bool&amp;gt;&lt;/li&gt;

  &lt;ul&gt;
    &lt;li&gt;We set &lt;a href="http://bit.ly/5DvhJs"&gt;IsBrowsable&lt;/a&gt; to true, we want to see it in the output&lt;/li&gt;

    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.model.attachedproperty.name(VS.100).aspx"&gt;&lt;a href="http://bit.ly/5a2cJS"&gt;Name&lt;/a&gt;&lt;/a&gt;, that’s what it will be projected as&lt;/li&gt;

    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.model.attachedproperty.ownertype(VS.100).aspx"&gt;&lt;a href="http://bit.ly/5GiqA1"&gt;OwnerType&lt;/a&gt;&lt;/a&gt;, we only want this to apply to Dog’s, not Cat’s or Objects or whatever.&lt;/li&gt;

    &lt;li&gt;Finally, &lt;a href="http://bit.ly/5woYQg"&gt;Getter&lt;/a&gt;, and look what we do here, we operate on the model item to do some computation and return a bool (in this case, we look to see if the name property equals “Sasha”&lt;/li&gt;
  &lt;/ul&gt;

  &lt;li&gt;Line 9-11 create an &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.model.attachedpropertiesservice(VS.100).aspx"&gt;&lt;/a&gt;&lt;a href="http://bit.ly/6dvvwh"&gt;AttachedPropertiesService&lt;/a&gt;&lt;/a&gt; and add it to the editing context.&lt;/li&gt;

  &lt;li&gt;Lines 13-17 output the properties, and let’s see what that looks like:&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;---- Enumerate properties on dog (note new property)----&lt;/pre&gt;

  &lt;pre&gt; Property : Name&lt;/pre&gt;

  &lt;pre class="alt"&gt; Property : Noise&lt;/pre&gt;

  &lt;pre&gt; Property : Age&lt;/pre&gt;

  &lt;pre class="alt"&gt; Property : IsAnInterestingDog&lt;/pre&gt;

  &lt;pre&gt;---- Enumerate properties on cat (note  no new property) ----&lt;/pre&gt;

  &lt;pre class="alt"&gt; Property : Name&lt;/pre&gt;

  &lt;pre&gt; Property : Noise&lt;/pre&gt;

  &lt;pre class="alt"&gt; Property : Age&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Ok, so that’s interesting, we’ve injected a new property, only on the dog type.&amp;#160; If I got dogMI.Properties[“IsAnInterestingDog”], I would have a value that I could manipulate (albeit returned via the getter).&lt;/p&gt;

&lt;p&gt;Let’s try something a little different:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;AttachedProperty&amp;lt;&lt;span class="kwrd"&gt;bool&lt;/span&gt;&amp;gt; isYoungAnimal = &lt;span class="kwrd"&gt;new&lt;/span&gt; AttachedProperty&amp;lt;&lt;span class="kwrd"&gt;bool&lt;/span&gt;&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;    IsBrowsable = &lt;span class="kwrd"&gt;false&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;    Name = &lt;span class="str"&gt;&amp;quot;IsYoungAnimal&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;    Getter = (mi =&amp;gt; &lt;span class="kwrd"&gt;int&lt;/span&gt;.Parse(mi.Properties[&lt;span class="str"&gt;&amp;quot;Age&amp;quot;&lt;/span&gt;].ComputedValue.ToString()) &amp;lt; 2)&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;};&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;aps.AddProperty(isYoungAnimal);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;&lt;span class="rem"&gt;// expect to not see isYoungAnimal show up&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;Console.WriteLine(&lt;span class="str"&gt;&amp;quot;---- Enumerate properties on dog  (note isYoungAnimal doesn't appear )----&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;dogMi.Properties.ToList().ForEach(mp =&amp;gt; Console.WriteLine(&lt;span class="str"&gt;&amp;quot; Property : {0}&amp;quot;&lt;/span&gt;, mp.Name));&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;Console.WriteLine(&lt;span class="str"&gt;&amp;quot;---- Enumerate properties on cat (note isYoungAnimal doesn't appear )----&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;catMi.Properties.ToList().ForEach(mp =&amp;gt; Console.WriteLine(&lt;span class="str"&gt;&amp;quot; Property : {0}&amp;quot;&lt;/span&gt;, mp.Name));&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;Console.WriteLine(&lt;span class="str"&gt;&amp;quot;---- get attached property via GetValue ----&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;Console.WriteLine(&lt;span class="str"&gt;&amp;quot;getting non browsable attached property on dog {0}&amp;quot;&lt;/span&gt;, isYoungAnimal.GetValue(dogMi));&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;Console.WriteLine(&lt;span class="str"&gt;&amp;quot;getting non browsable attached property on cat {0}&amp;quot;&lt;/span&gt;, isYoungAnimal.GetValue(catMi));&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Let’s break this down:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Lines 1-6 create a new attached property&lt;/li&gt;

  &lt;ul&gt;
    &lt;li&gt;IsBrowsable is false&lt;/li&gt;

    &lt;li&gt;No OwnerType being set&lt;/li&gt;

    &lt;li&gt;The Getter does some computation to return true or false&lt;/li&gt;
  &lt;/ul&gt;

  &lt;li&gt;Lines 10-14 write out the properties (as above)&lt;/li&gt;

  &lt;li&gt;Lines 17-18 extract the value with &lt;em&gt;&lt;a href="http://bit.ly/67pRXJ"&gt;AttachedPropertyInstance.GetValue(ModelItem)&lt;/a&gt;&lt;/em&gt;&lt;em&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.model.attachedproperty.getvalue(VS.100).aspx"&gt;&lt;/a&gt;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s see the output there:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;--&lt;span class="rem"&gt;-- Enumerate properties on dog  (note isYoungAnimal doesn't appear )----&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt; Property : Name&lt;/pre&gt;

  &lt;pre class="alt"&gt; Property : Noise&lt;/pre&gt;

  &lt;pre&gt; Property : Age&lt;/pre&gt;

  &lt;pre class="alt"&gt; Property : IsAnInterestingDog&lt;/pre&gt;

  &lt;pre&gt;--&lt;span class="rem"&gt;-- Enumerate properties on cat (note isYoungAnimal doesn't appear )----&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt; Property : Name&lt;/pre&gt;

  &lt;pre&gt; Property : Noise&lt;/pre&gt;

  &lt;pre class="alt"&gt; Property : Age&lt;/pre&gt;

  &lt;pre&gt;--&lt;span class="rem"&gt;-- get attached property via GetValue ----&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;getting non browsable attached property &lt;span class="kwrd"&gt;on&lt;/span&gt; dog &lt;span class="kwrd"&gt;False&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;getting non browsable attached property &lt;span class="kwrd"&gt;on&lt;/span&gt; cat True&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;As we can see, we’ve now injected this behavior, and we can extract the value.&amp;#160; &lt;/p&gt;

&lt;p&gt;Let’s get a little more advanced and do something with the setter.&amp;#160; Here, if isYoungAnimal is set to true, we will change the age (it’s a bit contrived, but shows the dataflow on simple objects, we’ll see in a minute a more interesting case).&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="rem"&gt;// now, let's do something clever with the setter. &lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;Console.WriteLine(&lt;span class="str"&gt;&amp;quot;---- let's use the setter to have some side effect ----&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;isYoungAnimal.Setter = ((mi, val) =&amp;gt; { &lt;span class="kwrd"&gt;if&lt;/span&gt; (val) { mi.Properties[&lt;span class="str"&gt;&amp;quot;Age&amp;quot;&lt;/span&gt;].SetValue(10); } });&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;isYoungAnimal.SetValue(cat, &lt;span class="kwrd"&gt;true&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;Console.WriteLine(&lt;span class="str"&gt;&amp;quot;cat's age now {0}&amp;quot;&lt;/span&gt;, cat.Age);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;
  &lt;p&gt;&lt;/p&gt;

  &lt;p&gt;&lt;/p&gt;

  &lt;p&gt;&lt;/p&gt;

  &lt;p&gt;&lt;/p&gt;

  &lt;p&gt;Pay attention to what the Setter does now.&amp;#160; We create the method through which subsequent SetValue’s will be pushed.&amp;#160; Here’s that output:&lt;/p&gt;

  &lt;pre class="csharpcode"&gt;--&lt;span class="rem"&gt;-- let's use the setter to have some side effect ----&lt;/span&gt;
cat's age now 10&lt;/pre&gt;
  &lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

  &lt;p&gt;Finally, let’s show an example of how this can really function as some nice sugar to eliminate the need for a lot of value converters in WPF by using this capability as a way to store the relationship somewhere (rather than just using at a nice proxy to change a value):&lt;/p&gt;

  &lt;div class="csharpcode"&gt;
    &lt;pre&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="rem"&gt;// now, let's have a browesable one with a setter.&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&lt;span class="rem"&gt;// this plus dynamics are a mini &amp;quot;macro language&amp;quot; against the model items&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;List&amp;lt;Object&amp;gt; FavoriteAnimals = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;&lt;span class="kwrd"&gt;object&lt;/span&gt;&amp;gt;();&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;&lt;span class="rem"&gt;// we maintain state in FavoriteAnimals, and use the getter/setter func&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;&lt;span class="rem"&gt;// in order to query or edit that collection.  Thus changes to an &amp;quot;instance&amp;quot;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&lt;span class="rem"&gt;// are tracked elsewhere.&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;AttachedProperty&amp;lt;&lt;span class="kwrd"&gt;bool&lt;/span&gt;&amp;gt; isFavoriteAnimal = &lt;span class="kwrd"&gt;new&lt;/span&gt; AttachedProperty&amp;lt;&lt;span class="kwrd"&gt;bool&lt;/span&gt;&amp;gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;{&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;    IsBrowsable = &lt;span class="kwrd"&gt;false&lt;/span&gt;,&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    Name = &lt;span class="str"&gt;&amp;quot;IsFavoriteAnimal&amp;quot;&lt;/span&gt;,&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;    Getter = (mi =&amp;gt; FavoriteAnimals.Contains(mi)),&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;    Setter = ((mi, val) =&amp;gt; &lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;        {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;            &lt;span class="kwrd"&gt;if&lt;/span&gt; (val)&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;                FavoriteAnimals.Add(mi);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;            &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;            {&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;                FavoriteAnimals.Remove(mi);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;            }&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;        })&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;};&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;aps.AddProperty(isFavoriteAnimal);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;dog.IsFavoriteAnimal = &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;&lt;span class="rem"&gt;// remove that cat that isn't there&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;cat.IsFavoriteAnimal = &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;cat.IsFavoriteAnimal = &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;cat.IsFavoriteAnimal = &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Who are my favorite animal?&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;FavoriteAnimals.ForEach(o =&amp;gt; Console.WriteLine((o &lt;span class="kwrd"&gt;as&lt;/span&gt; ModelItem).Properties[&lt;span class="str"&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;].ComputedValue.ToString()));&lt;/pre&gt;
  &lt;/div&gt;
  &lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

  &lt;p&gt;Little bit of code, let’s break it down one last time:&lt;/p&gt;
&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Line 14 – Create a setter that acts upon the FavoriteAnimals collection to either add or remove the element&lt;/li&gt;

  &lt;li&gt;Line 28-32 – do a few different sets on this attached property&lt;/li&gt;

  &lt;ul&gt;
    &lt;li&gt;NOTE: you can’t do that in beta2 as the dynamic support hasn’t been turned on.&amp;#160; Rather you would have to do isFavoriteAnimal.SetValue(dogMi, true).&lt;/li&gt;
  &lt;/ul&gt;

  &lt;li&gt;Line 35 then prints the output to the console, and as expected we only see the dog there:&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;-- Who are my favorite animals?&lt;/span&gt;
Sasha&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;I will attach the whole code file at the bottom of this post, but this shows you how you can use the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Attached properties to create “computed values” on top of existing types&lt;/li&gt;

  &lt;li&gt;Attached properties to inject a new (and discoverable) property entry on top of the designer data model (in the form of a new property)&lt;/li&gt;

  &lt;li&gt;Using the Setter capability to both propagate real changes to the type, providing a nice way to give a cleaner interface, as well as use it as a mechanism to store data about the object outside of the object, but in a way that gives me access to it such that it seems like the object.&amp;#160; &lt;/li&gt;

  &lt;ul&gt;
    &lt;li&gt;This is some really nice syntactic sugar that we sprinkle on top of things&lt;/li&gt;
  &lt;/ul&gt;
&lt;/ul&gt;

&lt;h1&gt;What do I do now?&lt;/h1&gt;

&lt;p&gt;Hopefully this post gave you some ideas about how the attached property mechanisms work within the WF4 designer.&amp;#160; These give you a nice way to complement the data model and create nice bindable targets that your WPF Views can layer right on top of. &lt;/p&gt;

&lt;p&gt;A few ideas for these things:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Use the Setters to clean up a “messy” activity API into a single property type that you then build a custom editor for in the property grid.&amp;#160; &lt;/li&gt;

  &lt;li&gt;Use the Getters (and the integration into the ModelProperty collection) in order to create computational properties that are used for displaying interesting information on the designer surface.&lt;/li&gt;

  &lt;li&gt;Figure out how to bridge the gap to take advantage of the XAML attached property storage mechanism, especially if you author runtime types that look for attached properties at runtime.&amp;#160; &lt;/li&gt;

  &lt;li&gt;Use these, with a combination of custom activity designers to extract and display interesting runtime data from a tracking store&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h1&gt;Full Code Posting&lt;/h1&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Activities.Presentation;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Activities.Presentation.Model;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Linq;

&lt;span class="kwrd"&gt;namespace&lt;/span&gt; AttachedPropertiesBlogPosting
{
    &lt;span class="kwrd"&gt;class&lt;/span&gt; Program
    {
        &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Main(&lt;span class="kwrd"&gt;string&lt;/span&gt;[] args)
        {
            EditingContext ec = &lt;span class="kwrd"&gt;new&lt;/span&gt; EditingContext();
            ModelTreeManager mtm = &lt;span class="kwrd"&gt;new&lt;/span&gt; ModelTreeManager(ec);
            mtm.Load(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt;[] { &lt;span class="kwrd"&gt;new&lt;/span&gt; Dog { Name = &lt;span class="str"&gt;&amp;quot;Sasha&amp;quot;&lt;/span&gt;, Noise = &lt;span class="str"&gt;&amp;quot;Snort&amp;quot;&lt;/span&gt;, Age = 5 },
                                    &lt;span class="kwrd"&gt;new&lt;/span&gt; Cat { Name=&lt;span class="str"&gt;&amp;quot;higgs&amp;quot;&lt;/span&gt;, Noise=&lt;span class="str"&gt;&amp;quot;boom&amp;quot;&lt;/span&gt;, Age=1 } });
            dynamic root = mtm.Root;
            dynamic dog = root[0];
            dynamic cat = root[1];
            ModelItem dogMi = root[0] &lt;span class="kwrd"&gt;as&lt;/span&gt; ModelItem;
            ModelItem catMi = root[1] &lt;span class="kwrd"&gt;as&lt;/span&gt; ModelItem;
          
            &lt;span class="rem"&gt;// Add an attached Property&lt;/span&gt;
            AttachedProperty&amp;lt;&lt;span class="kwrd"&gt;bool&lt;/span&gt;&amp;gt; ap = &lt;span class="kwrd"&gt;new&lt;/span&gt; AttachedProperty&amp;lt;&lt;span class="kwrd"&gt;bool&lt;/span&gt;&amp;gt;
            {
                IsBrowsable = &lt;span class="kwrd"&gt;true&lt;/span&gt;,
                Name = &lt;span class="str"&gt;&amp;quot;IsAnInterestingDog&amp;quot;&lt;/span&gt;,
                Getter = (mi =&amp;gt; mi.Properties[&lt;span class="str"&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;].ComputedValue.ToString() == &lt;span class="str"&gt;&amp;quot;Sasha&amp;quot;&lt;/span&gt;),
                OwnerType = &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(Dog)
            };
            ec.Services.Publish&amp;lt;AttachedPropertiesService&amp;gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; AttachedPropertiesService());
            AttachedPropertiesService aps = ec.Services.GetService&amp;lt;AttachedPropertiesService&amp;gt;();
            aps.AddProperty(ap);

            Console.WriteLine(&lt;span class="str"&gt;&amp;quot;---- Enumerate properties on dog (note new property)----&amp;quot;&lt;/span&gt;);
            dogMi.Properties.ToList().ForEach(mp =&amp;gt; Console.WriteLine(&lt;span class="str"&gt;&amp;quot; Property : {0}&amp;quot;&lt;/span&gt;, mp.Name));

            Console.WriteLine(&lt;span class="str"&gt;&amp;quot;---- Enumerate properties on cat (note  no new property) ----&amp;quot;&lt;/span&gt;);
            catMi.Properties.ToList().ForEach(mp =&amp;gt; Console.WriteLine(&lt;span class="str"&gt;&amp;quot; Property : {0}&amp;quot;&lt;/span&gt;, mp.Name));


            
            AttachedProperty&amp;lt;&lt;span class="kwrd"&gt;bool&lt;/span&gt;&amp;gt; isYoungAnimal = &lt;span class="kwrd"&gt;new&lt;/span&gt; AttachedProperty&amp;lt;&lt;span class="kwrd"&gt;bool&lt;/span&gt;&amp;gt;
            {
                IsBrowsable = &lt;span class="kwrd"&gt;false&lt;/span&gt;,
                Name = &lt;span class="str"&gt;&amp;quot;IsYoungAnimal&amp;quot;&lt;/span&gt;,
                Getter = (mi =&amp;gt; &lt;span class="kwrd"&gt;int&lt;/span&gt;.Parse(mi.Properties[&lt;span class="str"&gt;&amp;quot;Age&amp;quot;&lt;/span&gt;].ComputedValue.ToString()) &amp;lt; 2)
            };

            aps.AddProperty(isYoungAnimal);

            &lt;span class="rem"&gt;// expect to not see isYoungAnimal show up&lt;/span&gt;
            Console.WriteLine(&lt;span class="str"&gt;&amp;quot;---- Enumerate properties on dog  (note isYoungAnimal doesn't appear )----&amp;quot;&lt;/span&gt;);
            dogMi.Properties.ToList().ForEach(mp =&amp;gt; Console.WriteLine(&lt;span class="str"&gt;&amp;quot; Property : {0}&amp;quot;&lt;/span&gt;, mp.Name));
            Console.WriteLine(&lt;span class="str"&gt;&amp;quot;---- Enumerate properties on cat (note isYoungAnimal doesn't appear )----&amp;quot;&lt;/span&gt;);
            catMi.Properties.ToList().ForEach(mp =&amp;gt; Console.WriteLine(&lt;span class="str"&gt;&amp;quot; Property : {0}&amp;quot;&lt;/span&gt;, mp.Name));

            Console.WriteLine(&lt;span class="str"&gt;&amp;quot;---- get attached property via GetValue ----&amp;quot;&lt;/span&gt;);
            Console.WriteLine(&lt;span class="str"&gt;&amp;quot;getting non browsable attached property on dog {0}&amp;quot;&lt;/span&gt;, isYoungAnimal.GetValue(dogMi));
            Console.WriteLine(&lt;span class="str"&gt;&amp;quot;getting non browsable attached property on cat {0}&amp;quot;&lt;/span&gt;, isYoungAnimal.GetValue(catMi));
            
            
            &lt;span class="rem"&gt;// now, let's do something clever with the setter. &lt;/span&gt;
            Console.WriteLine(&lt;span class="str"&gt;&amp;quot;---- let's use the setter to have some side effect ----&amp;quot;&lt;/span&gt;);
            isYoungAnimal.Setter = ((mi, val) =&amp;gt; { &lt;span class="kwrd"&gt;if&lt;/span&gt; (val) { mi.Properties[&lt;span class="str"&gt;&amp;quot;Age&amp;quot;&lt;/span&gt;].SetValue(10); } });
            isYoungAnimal.SetValue(cat, &lt;span class="kwrd"&gt;true&lt;/span&gt;);
            Console.WriteLine(&lt;span class="str"&gt;&amp;quot;cat's age now {0}&amp;quot;&lt;/span&gt;, cat.Age);

            &lt;span class="rem"&gt;// now, let's have a browesable one with a setter.&lt;/span&gt;
            &lt;span class="rem"&gt;// this plus dynamics are a mini &amp;quot;macro language&amp;quot; against the model items&lt;/span&gt;

            List&amp;lt;Object&amp;gt; FavoriteAnimals = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;&lt;span class="kwrd"&gt;object&lt;/span&gt;&amp;gt;();

            &lt;span class="rem"&gt;// we maintain state in FavoriteAnimals, and use the getter/setter func&lt;/span&gt;
            &lt;span class="rem"&gt;// in order to query or edit that collection.  Thus changes to an &amp;quot;instance&amp;quot;&lt;/span&gt;
            &lt;span class="rem"&gt;// are tracked elsewhere.&lt;/span&gt;
            AttachedProperty&amp;lt;&lt;span class="kwrd"&gt;bool&lt;/span&gt;&amp;gt; isFavoriteAnimal = &lt;span class="kwrd"&gt;new&lt;/span&gt; AttachedProperty&amp;lt;&lt;span class="kwrd"&gt;bool&lt;/span&gt;&amp;gt;
            {
                IsBrowsable = &lt;span class="kwrd"&gt;false&lt;/span&gt;,
                Name = &lt;span class="str"&gt;&amp;quot;IsFavoriteAnimal&amp;quot;&lt;/span&gt;,
                Getter = (mi =&amp;gt; FavoriteAnimals.Contains(mi)),
                Setter = ((mi, val) =&amp;gt; 
                    {
                        &lt;span class="kwrd"&gt;if&lt;/span&gt; (val)
                            FavoriteAnimals.Add(mi);
                        &lt;span class="kwrd"&gt;else&lt;/span&gt;
                        {
                            FavoriteAnimals.Remove(mi);
                        }
                    })
            };
            aps.AddProperty(isFavoriteAnimal);
            dog.IsFavoriteAnimal = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
            &lt;span class="rem"&gt;// remove that cat that isn't there&lt;/span&gt;
            cat.IsFavoriteAnimal = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
            cat.IsFavoriteAnimal = &lt;span class="kwrd"&gt;true&lt;/span&gt;;
            cat.IsFavoriteAnimal = &lt;span class="kwrd"&gt;false&lt;/span&gt;;
            Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Who are my favorite animals?&amp;quot;&lt;/span&gt;);
            FavoriteAnimals.ForEach(o =&amp;gt; Console.WriteLine((o &lt;span class="kwrd"&gt;as&lt;/span&gt; ModelItem).Properties[&lt;span class="str"&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;].ComputedValue.ToString()));
            Console.ReadLine();
        }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Dog
    {
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Name { get; set; }
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Noise { get; set; }
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; Age { get; set; }
    }

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Cat
    {
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Name { get; set; }
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Noise { get; set; }
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt; Age { get; set; }
    }
}&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9933077" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mwinkle/archive/tags/designer/default.aspx">designer</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/wf4/default.aspx">wf4</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/vs2010/default.aspx">vs2010</category></item><item><title>WF4 ViewStateService</title><link>http://blogs.msdn.com/mwinkle/archive/2009/12/06/wf4-viewstateservice.aspx</link><pubDate>Sun, 06 Dec 2009 01:33:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9933058</guid><dc:creator>mwinkle</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/mwinkle/comments/9933058.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mwinkle/commentrss.aspx?PostID=9933058</wfw:commentRss><description>&lt;p&gt;A comment posted by Notre asked for some more details about view state and attached property services, so I thought I would dive into those next.&amp;#160; I will follow-up in a subsequent post on the AttachedPropertyService, as there is a little bit more going on there.&lt;/p&gt;  &lt;h1&gt;Motivation&lt;/h1&gt;  &lt;p&gt;Why do I care about viewstate?&amp;#160; Well, usually it is because we want to write something down and store it for later that is not required for runtime.&amp;#160; A common example of viewstate is the position of nodes within a flowchart.&amp;#160; While not required to execute the flowchart, they are required to effectively view the flowchart.&amp;#160; &lt;/p&gt;  &lt;h1&gt;Where to write them down?&lt;/h1&gt;  &lt;p&gt;This was a question that caused a fair amount of debate on the team.&amp;#160; There are basically two places to write down things like view state in a file-based world.&amp;#160; &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;In the source document itself&lt;/li&gt;    &lt;li&gt;In a document that stays close to the source (usually referred to as a sidecar file)&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;We had customers asking for both.&amp;#160; The motivation for the first is that for things like flowchart, where I may always care about the visualization representation, I want to keep that metadata around and only deal with one element.&amp;#160; For the second, it is motivated by the reason that we want a clean source document that only describes the minimal artifact to run.&amp;#160; Now, there are certainly many stops along the spectrum (for instance, we might always want to keep annotations or source comments in the source document, and put positioning elsewhere).&amp;#160; For VS2010, we landed with a unified API to use, and we write in the source document.&amp;#160; This is something that is likely to change in future releases, as it does make things like textual diffs rather painful. &lt;/p&gt;  &lt;p&gt;So, that’s why we want to use it.&lt;/p&gt;  &lt;h1&gt;How do we use it?&lt;/h1&gt;  &lt;p&gt;We are going to create a simple activity designer that lets me write down a comment.&lt;/p&gt;  &lt;p&gt;A few simple steps:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Create a new VS Project, let’s create an Activity Library&lt;/li&gt;    &lt;li&gt;Add a Designer to that activity library &lt;/li&gt;    &lt;li&gt;Add an attribute to the activity pointing to the designer&lt;/li&gt;    &lt;li&gt;Add a new WorkflowConsoleApp Project&lt;/li&gt;    &lt;li&gt;Build&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/WF4WorkflowViewStateServiceandAttachedPr_13D08/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/WF4WorkflowViewStateServiceandAttachedPr_13D08/image_thumb_2.png" width="256" height="421" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now, let’s go and make our activity designer a little interesting.&lt;/p&gt;  &lt;p&gt;Let’s add a text box and a button.&amp;#160; We’ll make the text of the button something obvious like “commit comment” The XAML for the activity designer looks like this:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;sap:ActivityDesigner&lt;/span&gt; &lt;span class="attr"&gt;x:Class&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;simpleActivity.CommentingDesigner&amp;quot;&lt;/span&gt;
    &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt;
    &lt;span class="attr"&gt;xmlns:x&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;
    &lt;span class="attr"&gt;xmlns:sap&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation&amp;quot;&lt;/span&gt;
    &lt;span class="attr"&gt;xmlns:sapv&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Grid&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;stackPanel1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;VerticalAlignment&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Top&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;TextBox&lt;/span&gt;  &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;commentBlock&amp;quot;&lt;/span&gt;   &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Button&lt;/span&gt; &lt;span class="attr"&gt;Content&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Load View State&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;loadViewState&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Click&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;loadViewState_Click&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Button&lt;/span&gt; &lt;span class="attr"&gt;Content&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;Commit View State&amp;quot;&lt;/span&gt;  &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;button1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Click&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;button1_Click&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;StackPanel&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Grid&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;sap:ActivityDesigner&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Now, let’s add some code to the button (and to the initialization of the form) &lt;/p&gt;

&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.view.viewstateservice_members(VS.100).aspx"&gt;ViewStateService&lt;/a&gt; has a few useful methods on it.&amp;#160; I want to call out a subtle difference.&amp;#160; You will see &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.view.viewstateservice.storeviewstate(VS.100).aspx"&gt;StoreViewState&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.view.viewstateservice.storeviewstatewithundo(VS.100).aspx"&gt;StoreViewStateWithUndo&lt;/a&gt;.&amp;#160; The primary distinction as the name implies is that one will simply write the view state down and will bypass the undo/redo stack.&amp;#160; This is for view state like an expanded/collapsed view.&amp;#160; You don’t really want ctl-z to simply flip expanded versus collapsed for you.&amp;#160; But for something like flowchart, where changing some of the viewstate, like position, might be such a thing that you want support for undoing the action.&amp;#160; That’s the primary difference.&lt;/p&gt;

&lt;p&gt;So, our code for the button looks like this:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; button1_Click(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
{
    ViewStateService vss = &lt;span class="kwrd"&gt;this&lt;/span&gt;.Context.Services.GetService&amp;lt;ViewStateService&amp;gt;();
    vss.StoreViewStateWithUndo(&lt;span class="kwrd"&gt;this&lt;/span&gt;.ModelItem, &lt;span class="str"&gt;&amp;quot;comment&amp;quot;&lt;/span&gt;, commentBlock.Text);
}&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Now, on load, we want to be able to populate the value, so we will use the &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.view.viewstateservice.retrieveviewstate(VS.100).aspx"&gt;RetrieveViewState&lt;/a&gt; method in order to extract this.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; loadViewState_Click(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
{
    ViewStateService vss = &lt;span class="kwrd"&gt;this&lt;/span&gt;.Context.Services.GetService&amp;lt;ViewStateService&amp;gt;();
    commentBlock.Text = vss.RetrieveViewState(&lt;span class="kwrd"&gt;this&lt;/span&gt;.ModelItem, &lt;span class="str"&gt;&amp;quot;comment&amp;quot;&lt;/span&gt;) &lt;span class="kwrd"&gt;as&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;;
}&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Now, let’s go back to our workflow project and put an instance of this activity on the surface: &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/WF4WorkflowViewStateServiceandAttachedPr_13D08/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/WF4WorkflowViewStateServiceandAttachedPr_13D08/image_thumb.png" width="242" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Let’s add some viewstate information and commit it.&amp;#160; Now let’s look at the XAML:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;s4:NotRealInterestingActivity&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;{x:Null}&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;sap:VirtualizedContainerService&lt;/span&gt;.&lt;span class="attr"&gt;HintSize&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;200,99&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;sap:WorkflowViewStateService.ViewState&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;scg3:Dictionary&lt;/span&gt; &lt;span class="attr"&gt;x:TypeArguments&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;x:String, x:Object&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;x:String&lt;/span&gt; &lt;span class="attr"&gt;x:Key&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;comment&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;basic comment&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;x:String&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;scg3:Dictionary&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;sap:WorkflowViewStateService.ViewState&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;s4:NotRealInterestingActivity&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Ok, now, to show that we can pull this in, let’s change the text in the xaml and then reload our designer. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/WF4WorkflowViewStateServiceandAttachedPr_13D08/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/WF4WorkflowViewStateServiceandAttachedPr_13D08/image_thumb_1.png" width="244" height="224" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;

&lt;p&gt;You can muck around with ctl-z to see that this does get handled correctly via the undo.&amp;#160; &lt;/p&gt;

&lt;p&gt;The other important thing to note is that this takes an object, so your viewstate is not limited to strings, you can have more full featured objects if you’d like. Finally, the ViewStateService also has a &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.presentation.view.viewstateservice.viewstatechanged(VS.100).aspx"&gt;ViewStateChanged&lt;/a&gt; you can subscribe to in order to handle, dispatch, and react to view state changes in the designer. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9933058" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mwinkle/archive/tags/designer/default.aspx">designer</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/wf4/default.aspx">wf4</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/beta/default.aspx">beta</category></item><item><title>Types, Metatypes and Bears, Redux</title><link>http://blogs.msdn.com/mwinkle/archive/2009/10/23/types-metatypes-and-bears-redux.aspx</link><pubDate>Fri, 23 Oct 2009 16:16:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9912121</guid><dc:creator>mwinkle</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mwinkle/comments/9912121.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mwinkle/commentrss.aspx?PostID=9912121</wfw:commentRss><description>&lt;p&gt;I made a quick &lt;a href="http://blogs.msdn.com/mwinkle/archive/2009/06/10/types-metatypes-and-bears-oh-my.aspx"&gt;post a few months back&lt;/a&gt; where I tried to talk about the way the designer works and lets us design types, as well as simply configure instances of types.&lt;/p&gt;  &lt;p&gt;There were a couple of key points that I wanted to make there in that post:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The workflow designer can configure instances of activity graphs, &lt;em&gt;and&lt;/em&gt; create entire types as well &lt;/li&gt;    &lt;li&gt;Types are designed by editing an instance of a type that represents the type being designed, the metatype &lt;/li&gt;    &lt;li&gt;There is some XAML trickery required to serialize and deserialize this &lt;/li&gt;    &lt;li&gt;This same type of work is done to enable the &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.dynamicactivity%28VS.100%29.aspx"&gt;DynamicActivity&lt;/a&gt; capability &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;A few folks have noticed (and sent me mail), that things look a little different in Beta2.&amp;#160; While we are going to have a more thorough, “here’s everything that changed” doc, I want to go ahead and update at least some of the things that I’ve been talking about here.&lt;/p&gt;  &lt;h1&gt;What’s New&lt;/h1&gt;  &lt;p&gt;In reality, very little is new, we’ve primarily moved stuff around now.&amp;#160; One thing that you may remember is that the DesignTimeXamlReader was not public in beta1, and if you are looking around, you may not find it.&amp;#160; We have made this functionality public however.&amp;#160; Thus, see the “what’s changed&amp;quot; bit.&lt;/p&gt;  &lt;h1&gt;What’s Changed&lt;/h1&gt;  &lt;p&gt;We took a long look at things and realized we had a bunch of XAML stuff all over the place.&amp;#160; We felt it would be a good idea to try to consolidate that into one place in WF, so &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.xamlintegration.activityxamlservices(VS.100).aspx"&gt;System.Activities.XamlIntegration.ActivityXamlServices&lt;/a&gt; becomes your one stop shop for most things Activity and XAML related.&amp;#160; Let’s take a quick look and see what’s in there:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;ActivityXamlServices Members&lt;/p&gt;    &lt;p&gt;[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]&lt;/p&gt;    &lt;p&gt;Creates an instance of an activity tree described in XAML.&lt;/p&gt;    &lt;p&gt;The &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.xamlintegration.activityxamlservices%28VS.100%29.aspx"&gt;ActivityXamlServices&lt;/a&gt; type exposes the following members.&lt;/p&gt;    &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image001%5B4%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001[4]" border="0" alt="clip_image001[4]" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image001%5B4%5D_thumb.gif" width="1" height="1" /&gt;&lt;/a&gt; Methods       &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;         &lt;tr&gt;           &lt;td valign="top"&gt;             &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top"&gt;             &lt;p&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top"&gt;             &lt;p&gt;&lt;b&gt;Description&lt;/b&gt;&lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td valign="top"&gt;             &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image002%5B10%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002[10]" border="0" alt="clip_image002[10]" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image002%5B10%5D_thumb.gif" width="16" height="11" /&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image003%5B10%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image003[10]" border="0" alt="clip_image003[10]" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image003%5B10%5D_thumb.gif" width="13" height="10" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top"&gt;             &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.xamlintegration.activityxamlservices.createbuilderreader%28VS.100%29.aspx"&gt;CreateBuilderReader&lt;/a&gt;&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top"&gt;             &lt;p&gt;Overloaded. Maps an x:Class activity tree to an &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.activitybuilder%28VS.100%29.aspx"&gt;ActivityBuilder&lt;/a&gt; or &lt;a href="http://msdn.microsoft.com/en-us/library/ee149744%28VS.100%29.aspx"&gt;ActivityBuilder&amp;lt;(Of &amp;lt;(TResult&amp;gt;)&amp;gt;)&lt;/a&gt;.&lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td valign="top"&gt;             &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image002%5B11%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002[11]" border="0" alt="clip_image002[11]" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image002%5B11%5D_thumb.gif" width="16" height="11" /&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image003%5B11%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image003[11]" border="0" alt="clip_image003[11]" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image003%5B11%5D_thumb.gif" width="13" height="10" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top"&gt;             &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.xamlintegration.activityxamlservices.createbuilderwriter%28VS.100%29.aspx"&gt;CreateBuilderWriter&lt;/a&gt;&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top"&gt;             &lt;p&gt;Maps an &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.activitybuilder%28VS.100%29.aspx"&gt;ActivityBuilder&lt;/a&gt; or &lt;a href="http://msdn.microsoft.com/en-us/library/ee149744%28VS.100%29.aspx"&gt;ActivityBuilder&amp;lt;(Of &amp;lt;(TResult&amp;gt;)&amp;gt;)&lt;/a&gt; from the specified writer to an x:Class activity tree.&lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td valign="top"&gt;             &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image002%5B12%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002[12]" border="0" alt="clip_image002[12]" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image002%5B12%5D_thumb.gif" width="16" height="11" /&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image003%5B12%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image003[12]" border="0" alt="clip_image003[12]" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image003%5B12%5D_thumb.gif" width="13" height="10" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top"&gt;             &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.xamlintegration.activityxamlservices.createreader%28VS.100%29.aspx"&gt;CreateReader&lt;/a&gt;&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top"&gt;             &lt;p&gt;Overloaded. Maps an x:Class activity tree to an &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.dynamicactivity%28VS.100%29.aspx"&gt;DynamicActivity&lt;/a&gt; or &lt;a href="http://msdn.microsoft.com/en-us/library/dd465645%28VS.100%29.aspx"&gt;DynamicActivity&amp;lt;(Of &amp;lt;(TResult&amp;gt;)&amp;gt;)&lt;/a&gt;.&lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td valign="top"&gt;             &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image002%5B13%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002[13]" border="0" alt="clip_image002[13]" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image002%5B13%5D_thumb.gif" width="16" height="11" /&gt;&lt;/a&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image003%5B13%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image003[13]" border="0" alt="clip_image003[13]" src="http://blogs.msdn.com/blogfiles/mwinkle/WindowsLiveWriter/TypesMetatypesandBearsRedux_13C27/clip_image003%5B13%5D_thumb.gif" width="13" height="10" /&gt;&lt;/a&gt;&lt;/b&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top"&gt;             &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.xamlintegration.activityxamlservices.load%28VS.100%29.aspx"&gt;Load&lt;/a&gt;&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top"&gt;             &lt;p&gt;Overloaded. Creates an instance of a declarative workflow.&lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;       &lt;/tbody&gt;&lt;/table&gt;   &lt;/p&gt;    &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.xamlintegration.activityxamlservices_members%28VS.100%29.aspx#mainBody"&gt;Top&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.xamlintegration.activityxamlservices.load%28VS.100%29.aspx"&gt;Load&lt;/a&gt; is used to generally take some XAML and return an Activity which you can then use to execute.&amp;#160; If Load encounters a XAML stream for &amp;lt;Activity x:Class, it will subsequently generate a DynamicActivity.&amp;#160; This functions basically the same way WorkflowXamlServices.Load() did in beta1.&amp;#160; &lt;/p&gt;  &lt;p&gt;You also see &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.xamlintegration.activityxamlservices.createbuilderreader(VS.100).aspx"&gt;CreateBuilderReader&lt;/a&gt;, and &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.xamlintegration.activityxamlservices.createbuilderwriter(VS.100).aspx"&gt;CreateBuilderWriter&lt;/a&gt;, which are used to surface the DesignTimeXaml capabilities that we used in beta1.&amp;#160; These will return an instance of a XamlReader/Writer that handles the transformation between the metatype and the &amp;lt;Activity x:Class XAML.&amp;#160;&amp;#160; The metatype has changed names from ActivitySchemaType to &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.xamlintegration.activityxamlservices.createbuilderreader(VS.100).aspx"&gt;ActivityBuilder&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The table below should help summarize the uses and changes between beta1 and beta2.&amp;#160; In this area, I don’t expect any changes between what you see now, and what you will see in RTM.&lt;/p&gt;  &lt;table border="0" cellspacing="0" cellpadding="2" width="491"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="133"&gt;         &lt;p align="center"&gt;&lt;strong&gt;Task&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="178"&gt;         &lt;p align="center"&gt;&lt;strong&gt;Beta1&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td valign="top" width="178"&gt;         &lt;p align="center"&gt;&lt;strong&gt;Beta2&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="133"&gt;metatype (type to build types)&lt;/td&gt;        &lt;td valign="top" width="178"&gt;ActivitySchemaType&lt;/td&gt;        &lt;td valign="top" width="178"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.activitybuilder%28VS.100%29.aspx"&gt;ActivityBuilder&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="133"&gt;Mechanism to load DynamicActivity&lt;/td&gt;        &lt;td valign="top" width="178"&gt;WorkflowXamlServices.Load()&lt;/td&gt;        &lt;td valign="top" width="178"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.xamlintegration.activityxamlservices.load%28VS.100%29.aspx"&gt;ActivityXamlServices.Load()&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="133"&gt;Mechanism to load ActivityBuilder&lt;/td&gt;        &lt;td valign="top" width="178"&gt;use WorkflowDesigner.Load() to get an ActivitySchemaType&lt;/td&gt;        &lt;td valign="top" width="178"&gt;Use the reader from &lt;a href="http://msdn.microsoft.com/en-us/library/system.activities.xamlintegration.activityxamlservices.createbuilderreader%28VS.100%29.aspx"&gt;CreateBuilderReader()&lt;/a&gt; to pass into &lt;a href="http://msdn.microsoft.com/en-us/library/system.xaml.xamlservices.load(VS.100).aspx"&gt;XamlServices.Load()&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="133"&gt;Mechanism to save ActivityBuilder to XAML&lt;/td&gt;        &lt;td valign="top" width="178"&gt;Create a new DesignTimeXamlWriter, pass that to XamlServices.Save()&lt;/td&gt;        &lt;td valign="top" width="178"&gt;Use the writer returned from CreateBuilderWriter() to pass into &lt;a href="http://msdn.microsoft.com/en-us/library/system.xaml.xamlservices.save(VS.100).aspx"&gt;XamlServices.Save()&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="133"&gt;&amp;#160;&lt;/td&gt;        &lt;td valign="top" width="178"&gt;&amp;#160;&lt;/td&gt;        &lt;td valign="top" width="178"&gt;&amp;#160;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;To explore this, use CreateBuilderReader() and XamlServices.Load() on a workflow that you’ve built in the designer and poke around a bit to see what’s going on. &lt;/p&gt;  &lt;p&gt;Here is some sample code that walks through this:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;ActivityBuilder ab1 = &lt;span class="kwrd"&gt;new&lt;/span&gt; ActivityBuilder();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;ab1.Name = &lt;span class="str"&gt;&amp;quot;helloWorld.Foo&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;ab1.Properties.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; DynamicActivityProperty { Name = &lt;span class="str"&gt;&amp;quot;input1&amp;quot;&lt;/span&gt;, Type = &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(InArgument&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt;) });&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;ab1.Properties.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; DynamicActivityProperty { Name = &lt;span class="str"&gt;&amp;quot;input2&amp;quot;&lt;/span&gt;, Type = &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(InArgument&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt;) });&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;ab1.Properties.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; DynamicActivityProperty { Name = &lt;span class="str"&gt;&amp;quot;output&amp;quot;&lt;/span&gt;, Type = &lt;span class="kwrd"&gt;typeof&lt;/span&gt;(OutArgument&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt;) });&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;ab1.Implementation = &lt;span class="kwrd"&gt;new&lt;/span&gt; Sequence&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;{&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;    Activities =&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    {&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;        &lt;span class="kwrd"&gt;new&lt;/span&gt; WriteLine { Text = &lt;span class="str"&gt;&amp;quot;Getting Started &amp;quot;&lt;/span&gt; },&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;        &lt;span class="kwrd"&gt;new&lt;/span&gt; Delay { Duration = TimeSpan.FromSeconds(4) },&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;        &lt;span class="kwrd"&gt;new&lt;/span&gt; WriteLine { Text = &lt;span class="kwrd"&gt;new&lt;/span&gt; VisualBasicValue&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; { ExpressionText= &lt;span class="str"&gt;&amp;quot;input1 + input2&amp;quot;&lt;/span&gt; }},&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;        &lt;span class="kwrd"&gt;new&lt;/span&gt; Assign&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; { To = &lt;span class="kwrd"&gt;new&lt;/span&gt; VisualBasicReference&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; { ExpressionText = &lt;span class="str"&gt;&amp;quot;output&amp;quot;&lt;/span&gt; },&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  14:  &lt;/span&gt;                     Value = &lt;span class="kwrd"&gt;new&lt;/span&gt; VisualBasicValue&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; {ExpressionText= &lt;span class="str"&gt;&amp;quot;input1 + input2 + \&amp;quot;that's it folks\&amp;quot;&amp;quot;&lt;/span&gt; } }&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  15:  &lt;/span&gt;    }&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  16:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  17:  &lt;/span&gt;};&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  18:  &lt;/span&gt;StringBuilder sb = &lt;span class="kwrd"&gt;new&lt;/span&gt; StringBuilder();&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  19:  &lt;/span&gt;StringWriter tw = &lt;span class="kwrd"&gt;new&lt;/span&gt; StringWriter(sb);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  20:  &lt;/span&gt;XamlWriter xw = ActivityXamlServices.CreateBuilderWriter(&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  21:  &lt;/span&gt;    &lt;span class="kwrd"&gt;new&lt;/span&gt; XamlXmlWriter(tw, &lt;span class="kwrd"&gt;new&lt;/span&gt; XamlSchemaContext()));&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  22:  &lt;/span&gt;XamlServices.Save(xw , ab1);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  23:  &lt;/span&gt;&lt;span class="kwrd"&gt;string&lt;/span&gt; serializedAB = sb.ToString();&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  24:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  25:  &lt;/span&gt;DynamicActivity da2 = ActivityXamlServices.Load(&lt;span class="kwrd"&gt;new&lt;/span&gt; StringReader(serializedAB)) &lt;span class="kwrd"&gt;as&lt;/span&gt; DynamicActivity;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  26:  &lt;/span&gt;var result = WorkflowInvoker.Invoke(da2, &lt;span class="kwrd"&gt;new&lt;/span&gt; Dictionary&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;,&lt;span class="kwrd"&gt;object&lt;/span&gt;&amp;gt; { {&lt;span class="str"&gt;&amp;quot;input1&amp;quot;&lt;/span&gt;,&lt;span class="str"&gt;&amp;quot;hello&amp;quot;&lt;/span&gt;}, {&lt;span class="str"&gt;&amp;quot;input2&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;world&amp;quot;&lt;/span&gt; }});&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  27:  &lt;/span&gt;Console.WriteLine(&lt;span class="str"&gt;&amp;quot;result text is {0}&amp;quot;&lt;/span&gt;, result[&lt;span class="str"&gt;&amp;quot;output&amp;quot;&lt;/span&gt;]);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  28:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  29:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  30:  &lt;/span&gt;ActivityBuilder ab = XamlServices.Load(&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  31:  &lt;/span&gt;    ActivityXamlServices.CreateBuilderReader(&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  32:  &lt;/span&gt;        &lt;span class="kwrd"&gt;new&lt;/span&gt; XamlXmlReader(&lt;span class="kwrd"&gt;new&lt;/span&gt; StringReader(serializedAB)))) &lt;span class="kwrd"&gt;as&lt;/span&gt; ActivityBuilder;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  33:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  34:  &lt;/span&gt;Console.WriteLine(&lt;span class="str"&gt;&amp;quot;there are {0} arguments in the activity builder&amp;quot;&lt;/span&gt;, ab.Properties.Count);&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  35:  &lt;/span&gt;Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Press enter to exit&amp;quot;&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;  36:  &lt;/span&gt;Console.ReadLine();&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Good luck, and happy metatyping!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9912121" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mwinkle/archive/tags/Workflow/default.aspx">Workflow</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/designer/default.aspx">designer</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/wf4/default.aspx">wf4</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/beta/default.aspx">beta</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/xaml/default.aspx">xaml</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/vs2010/default.aspx">vs2010</category></item><item><title>You say XAML, I say XOML, PoTAYto, PoTAHto, let's call the whole thing off</title><link>http://blogs.msdn.com/mwinkle/archive/2008/01/30/you-say-xaml-i-say-xoml-potayto-potahto-let-s-call-the-whole-thing-off.aspx</link><pubDate>Wed, 30 Jan 2008 21:00:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7330706</guid><dc:creator>mwinkle</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/mwinkle/comments/7330706.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mwinkle/commentrss.aspx?PostID=7330706</wfw:commentRss><description>&lt;p&gt;With all due respect to &lt;a href="http://en.wikipedia.org/wiki/Let%27s_call_the_whole_thing_off"&gt;George and Ira Gershwin&lt;/a&gt;, I have a quick question for the readers of this blog.&amp;#160; In V1, we have an interesting scenario is talked about frequently, and that's the file extension of our xml form of workflow.&amp;#160; &lt;/p&gt;  &lt;p&gt;When we debuted at PDC05, there existed an XML representation of the workflow which conformed to a schema that the WF team had built, and it was called XOML.&amp;#160; Realizing that WPF was doing the same thing to serialize objects nicely to XML, we moved to that (XAML), but the file extensions had been cast in stone due to VS project setups.&amp;#160; So, we had XAML contained in a XOML file.&lt;/p&gt;  &lt;p&gt;Is this a problem for you?&amp;#160; I could see three possible solutions in the future &amp;lt;insert usual disclaimer, just gathering feedback&amp;gt;:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;XOML -- we have a legacy now, let's not change it&lt;/li&gt;    &lt;li&gt;XAML -- it's XAML, so change the file extension to match it (and introduce an overload to the XAML extension, which for now is associated with WPF)&lt;/li&gt;    &lt;li&gt;something else, say .WFXAML -- this reflects the purpose, is unique to declarative workflows and doesn't have any weird connotations (What does xoml stand for???).&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Is this an issue?&amp;#160; Is this something you would like to see changed?&amp;#160; Do any of these solutions sound like a good idea, bad idea, etc? &lt;/p&gt;  &lt;p&gt;Thanks, we appreciate your feedback :-) &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7330706" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mwinkle/archive/tags/wf/default.aspx">wf</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/designer/default.aspx">designer</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/queries/default.aspx">queries</category></item><item><title>mwinkle.SetState("newRole")</title><link>http://blogs.msdn.com/mwinkle/archive/2007/11/29/mwinkle-setstate-newrole.aspx</link><pubDate>Thu, 29 Nov 2007 21:46:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6600887</guid><dc:creator>mwinkle</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mwinkle/comments/6600887.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mwinkle/commentrss.aspx?PostID=6600887</wfw:commentRss><description>&lt;p&gt;I'm moving on from my role as the technical evangelist for WF, but not too far.&amp;#160; I've joined the product team, working as a program manager (PM) for the Connected Tools team.&amp;#160; The job of the connected tools team is to provide all of the tools for the technologies inside the Oslo effort, including the WF designer.&amp;#160; As such, I'll be focused on the programming model for activity designers to use when they create WF activities.&lt;/p&gt;  &lt;p&gt;Oslo is interesting, as it represents the first real chance to look at the stuff we did in V1 of WF and think about it and find out ways we can improve on the experience.&amp;#160; .NET 3.5 was a very &amp;quot;constrained&amp;quot; release for the WF team, as we had only shipped about 12 months prior, so we were primarily concerned with adding functionality to what we shipped (the WF/WCF integration, for instance).&amp;#160; For WF, Oslo will be our first chance to take in a lot of the feedback we have heard (and keep it coming) to move things to the next level.&amp;#160; I'm excited to be part of that effort, especially from the designer side of things, as I see a great opportunity to simplify a number of things that a lot of our customers have been doing.&lt;/p&gt;  &lt;p&gt;It was a tough decision to leave DPE (developer and platform evangelism).&amp;#160; The job of a TE is probably one of the closest to geek nirvana one can achieve.&amp;#160; It was a bit odd when I was looking into this new position to lead off by saying, &amp;quot;I'm leaving the best job I've had.&amp;quot;&amp;#160; I didn't do it because anything was wrong with the role, on the contrary, it is a perfect fit for anyone who is deeply passionate about technology and wants to drive that passion and excitement out to the rest of the world while working with an entire team of people focused on that goal.&amp;#160; My new role offered a really unique opportunity to have a large influence on the way people see WF (literally).&amp;#160; I'm also a bit crazy about making sure the tools are right, because that is going to be the bit of the technology most people will see first, and the way many people will interact with the product. Finally, when I look at the things I want to accomplish at Microsoft, shipping a product is a big item on that list.&amp;#160; &lt;/p&gt;  &lt;p&gt;As we're not talking publicly yet about a lot of the stuff we are doing in Oslo, I probably won't be blogging about it (that tends to be frowned upon for obvious reasons).&amp;#160; I'll still be posting about WF, and as always, am interested in your feedback (and will probably use the blog to solicit some as well).&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6600887" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mwinkle/archive/tags/wf/default.aspx">wf</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/Oslo/default.aspx">Oslo</category><category domain="http://blogs.msdn.com/mwinkle/archive/tags/designer/default.aspx">designer</category></item></channel></rss>