Yes, CacheMetadata in your activity is where you should be doing your validation. Validation is a concept which applies to the workflow runtime as well as the designer. (You can see this from the fact that you can still attempt to run workflows, compiled or declarative, which have validation errors, but an exception will be thrown when you do.)
Example:
protected override void CacheMetadata(ActivityMetadata metadata)
{
if (this.Body == 0) metadata.[AddValidationError](
new ValidationError(
"You forgot to supply a body for (this activity)",
/*iswarning = */ true,
"Body"));
}
(See ActivityMetadata.AddValidationError[1]
)
Your secondary question is is there support for adding validation from the ActivityDesigner side? The answer is 'no, not really' - it would be possible for to do some custom WPF and data binding which adds some 'custom validation' on top of the ActivityDesigner, maybe even use AttachedPropertiesService to define your own SatisfiesConstraints property on your activity class. But it's extra work, and it's not going to tie in with the runtime validation consistently, so it's a limited value idea.