Class WorkflowXamlServices
Provides services (static methods) for loading workflows from XAML.
public static class WorkflowXamlServices
- Inheritance
-
WorkflowXamlServices
- Inherited Members
Methods
Load(Stream, IExpressionEnvironment?)
Loads a workflow from a given XAML stream.
public static IActivity Load(Stream stream, IExpressionEnvironment? expressionEnvironment = null)
Parameters
streamStreamThe XAML stream from which to load the workflow.
expressionEnvironmentIExpressionEnvironmentAn optional expression environment. If provided, expressions will be compiled as they are encountered during loading. Otherwise, they will be compiled at runtime when first needed.
Returns
- IActivity
The root activity of the loaded workflow.
Exceptions
- ArgumentNullException
streamis 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.
Load(TextReader, IExpressionEnvironment?)
Loads a workflow via a given XAML text reader.
public static IActivity Load(TextReader textReader, IExpressionEnvironment? expressionEnvironment = null)
Parameters
textReaderTextReaderThe XAML text reader to use to load the workflow.
expressionEnvironmentIExpressionEnvironmentAn optional expression environment. If provided, expressions will be compiled as they are encountered during loading. Otherwise, they will be compiled at runtime when first needed.
Returns
- IActivity
The root activity of the loaded workflow.
Exceptions
- ArgumentNullException
textReaderis 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.
Load(string, IExpressionEnvironment?)
Loads a workflow from a XAML file.
public static IActivity Load(string fileName, IExpressionEnvironment? expressionEnvironment = null)
Parameters
fileNamestringThe file name of the XAML file.
expressionEnvironmentIExpressionEnvironmentAn optional expression environment. If provided, expressions will be compiled as they are encountered during loading. Otherwise, they will be compiled at runtime when first needed.
Returns
- IActivity
The root activity of the loaded workflow.
Exceptions
- ArgumentNullException
fileNameis 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.
Load(Uri, IExpressionEnvironment?)
Loads a workflow from XAML from a given Uri.
public static IActivity Load(Uri uri, IExpressionEnvironment? expressionEnvironment = null)
Parameters
uriUriThe Uri from which to load the XAML workflow.
expressionEnvironmentIExpressionEnvironmentAn optional expression environment. If provided, expressions will be compiled as they are encountered during loading. Otherwise, they will be compiled at runtime when first needed.
Returns
- IActivity
The root activity of the loaded workflow.
Remarks
Pack URIs specifying resources are
supported as long as they are in an absolute form like: pack://application:,,,/YourAssemblyShortName;component/Subfolder/ResourceFile.xaml
Exceptions
- ArgumentNullException
uriis 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.
Load(XmlReader, IExpressionEnvironment?)
Loads a workflow via a given XML reader.
public static IActivity Load(XmlReader xmlReader, IExpressionEnvironment? expressionEnvironment = null)
Parameters
xmlReaderXmlReaderThe XML reader to use to load the workflow.
expressionEnvironmentIExpressionEnvironmentAn optional expression environment. If provided, expressions will be compiled as they are encountered during loading. Otherwise, they will be compiled at runtime when first needed.
Returns
- IActivity
The root activity of the loaded workflow.
Exceptions
- ArgumentNullException
xmlReaderis 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.
Parse(string, IExpressionEnvironment?)
Parses and loads a workflow from a XAML string.
public static IActivity Parse(string xaml, IExpressionEnvironment? expressionEnvironment = null)
Parameters
xamlstringThe XAML string.
expressionEnvironmentIExpressionEnvironmentAn optional expression environment. If provided, expressions will be compiled as they are encountered during loading. Otherwise, they will be compiled at runtime when first needed.
Returns
- IActivity
The root activity of the loaded workflow.
Exceptions
- ArgumentNullException
xamlis null.- InvalidOperationException
The loaded XAML does not contain a workflow.
- Exception
The workflow object graph could not be created. Potential causes include: the content is not well-formed and valid XML, or the 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.