Class Workflow
Provides a WorkflowSource that loads workflows from various sources.
public class Workflow : WorkflowSource
- Inheritance
-
Workflow
- Inherited Members
Remarks
Note that this class exists as the implementation for WorkflowSource to enable converting various sources into loaded workflows, primarily from XAML. It is not necessary to otherwise create or load workflows for execution (i.e., via the WorkflowXamlServices methods).
Once loaded, the workflow should be executed via RootActivity.
Properties
RootActivity
Gets the root activity of the workflow.
public override IActivity RootActivity { get; }
Property Value
Methods
Create(IActivity)
Creates a new Workflow from a given root activity.
public static Workflow Create(IActivity rootActivity)
Parameters
rootActivity
IActivityThe root activity.
Returns
Exceptions
- ArgumentNullException
rootActivity
is null.
Create(Stream)
public static Workflow Create(Stream stream)
Parameters
Returns
Exceptions
- ArgumentNullException
stream
is null.- InvalidOperationException
The loaded XAML does not contain a workflow.
- Exception
The workflow object graph could not be created. Potential causes include: the file content is not well-formed and valid XML, or the file content is not valid XAML at the language level, or the XAML types that are specified in the source XAML did not resolve to backing types in the relevant XAML namespaces. The specific possible exceptions are not documented, but they include XmlException, various exceptions derived from XamlException, and various exceptions derived from IOException.
Create(Uri, string)
public static Workflow Create(Uri uri, string originalString = null)
Parameters
uri
UrioriginalString
stringThe original string representation of this source (e.g., the source file name), or null to use the string representation of
uri
.
Returns
Remarks
Pack URIs specifying resources
are supported as long as they are in an absolute form like: pack://application:,,,/YourAssemblyShortName;component/Subfolder/ResourceFile.xaml
Other workflows referenced from the workflow via relative WorkflowSource references are supported.
Exceptions
- ArgumentNullException
uri
is null.- InvalidOperationException
The loaded XAML does not contain a workflow.
- Exception
The workflow object graph could not be created. Potential causes include: the file content is not well-formed and valid XML, or the file content is not valid XAML at the language level, or the XAML types that are specified in the source XAML did not resolve to backing types in the relevant XAML namespaces. The specific possible exceptions are not documented, but they include XmlException, various exceptions derived from XamlException, and various exceptions derived from IOException.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.