WorkflowMarkupSerializer.XCodeProperty 字段

定义

表示嵌入到 XAML x:Code 元素中的代码示例。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 

字段值

DependencyProperty

示例

下面的示例是 XAML 代码,该代码包含将在工作流编译期间进行编译的代码示例。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)   
      {  
      }  
  ]

注解

仅在设计期间,通过对象模型以编程方式发出工作流时使用此属性。This property is used only at design time, while programmatically emitting a workflow using the object model. 该属性包含使用 CodeTypeMemberCollection 元素填充的 CodeSnippetTypeMember 集合。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. 此依赖项属性是名为 XProperty 或 XEvent 的公共静态字段,其中 X 是对应的属性。This dependency property is the public static field named XProperty or XEvent , where X is the corresponding property.

适用于