WorkflowMarkupSerializer.XCodeProperty Field
In this article
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a code example, embedded into XAML x:Code
element.
public: static initonly System::Workflow::ComponentModel::DependencyProperty ^ XCodeProperty;
public static readonly System.Workflow.ComponentModel.DependencyProperty XCodeProperty;
staticval mutable XCodeProperty : System.Workflow.ComponentModel.DependencyProperty
Public Shared ReadOnly XCodeProperty As DependencyProperty
The following example is XAML code that contains a code example that would be compiled during workflow compilation.
<CodeActivity x:Name="codeActivity1" ExecuteCode="methodName1">
<x:Code><![CDATA[
void methodName1(object sender, EventArgs e)
{
}
]]></x:Code>
</CodeActivity>
The following example shows how to set the same value for the XCodeProperty dependency property programmatically.
CodeActivity code1 = new CodeActivity();
code1.SetValue(WorkflowMarkupSerializer.XCodeProperty,
new CodeTypeMemberCollection(
new CodeTypeMember[] {
new CodeSnippetTypeMember("void methodName1(object sender, EventArgs e) { }")
}));
This property is used only at design time, while programmatically emitting a workflow using the object model. The property contains a CodeTypeMemberCollection
collection filled with CodeSnippetTypeMember
elements. After compilation, the code is compiled as a part of the generated type.
You indirectly access each public property and event of this type by the resolution of a corresponding dependency property. This dependency property is the public static field named XProperty or XEvent, where X is the corresponding property.
Applies to
Product | Versions |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: