2 // Copyright (c) Microsoft Corporation. All rights reserved.
5 namespace System.Activities.Presentation.Toolbox
7 using System.Activities.Presentation;
8 using System.Activities.XamlIntegration;
9 using System.ComponentModel;
10 using System.Reflection;
13 using System.Windows.Markup;
17 /// ActivityTemplateFactory is the XAML representation for an IActivityTemplateFactory. This class is for XAML serialization purpose only and is not expected to be used by developers.
19 [ContentProperty("Implementation")]
20 public abstract class ActivityTemplateFactory : IActivityTemplateFactory
23 /// Gets or sets the a factory method that create an activity as the implementation.
25 [XamlDeferLoad(typeof(FuncDeferringLoader), typeof(ActivityTemplateFactory))]
29 protected virtual Func<Activity> Implementation
36 /// Create an activity by calling Implementation.
38 /// <param name="target">A reference to the user interface - not used.</param>
39 /// <returns>The activity created by the implementation method or null if implementation is not set.</returns>
40 public Activity Create(DependencyObject target)
42 if (this.Implementation != null)
44 return this.Implementation();