-
Book Overview & Buying
-
Table Of Contents
Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C#
By :
Technically, there isn't an enormous difference between the composition and derivation approaches for building custom activities. When we built our GetUploadActivity earlier, the new activity did derive from the SequenceActivity class. Composition and derivation both use inheritance. Many of the topics we'll cover in this section we could also apply to GetUploadActivity.
Derivation versus composition is more a state of mind. In composition, we focus on arranging child activities inside a custom activity, and we build bigger activities
from smaller activities. With derivation, we focus on designing a single activity—its properties and execution model. The derivation approach is often the low‑level approach. Let's build a custom activity with derivation that writes to the console.
For this activity, we will start with a simple class file. No XAML, no designers, just the following C# code:
using System; using System.Workflow.ComponentModel; using System.ComponentModel...
Change the font size
Change margin width
Change background colour