Populating and Linking to Attached Property Topics

Jul 17, 2009 at 8:32 PM

I'm a little confused as to how I can populate the documentation for attached property topics as well as link back to them. E.g. if I have an attached property field called MyAttachedProperty with the usual Get and Set static methods then topics are generated for the field, the methods and a "property". How do I actually provide the documentation for the latter? Are there some special tags I need to be aware of? Also, in the documentation for the attached property "field" I'd like to link to the attached property topic, e.g. "Identifies the MyAttached attached property". Unfortunately if I use "MyClass.MyAttached" as the cref the C# compiler warns (CS1574) that it cannot be resolved. If I ignore the warning then the text only appears as bold in the generated documentation; there's no link. I can see that a topic is being created in the build output but I simply don't know how to reference or populate it. Here's an example of the build output:

Info: BuildAssembler: Building topic M:MyNamespace.MyClass.GetMyAttached(System.Windows.DependencyObject)
Info: BuildAssembler: Building topic P:MyNamespace.MyClass.MyAttached
Info: BuildAssembler: Building topic F:MyNamespace.MyClass.MyAttachedProperty
Info: BuildAssembler: Building topic M:MyNamespace.MyClass.SetMyAttached(System.Windows.DependencyObject,System.Windows.DependencyObject)

It's the second entry I want to link to and document. Any ideas?


Jul 21, 2009 at 6:20 PM

I've managed to get the attached property topics documented by creating separate XML documentation files. As long as the assembly and member tags are correct in the additional XML documentation files then this appears to work. To link back these topics I use the property prefix with the fully qualified name., e.g.

<summary>Identifies the <see cref="P:MyNamespace.MyClass.MyAttached">MyAttached</see> attached property.</summary>

This stops the C# compiler from complaining and the resulting documentation does indeed contain a link.