Did Sandcastle (2.4.10522.00) full support XAML SYNTAX?

Aug 10, 2009 at 2:39 AM

I want to generate help file for my WPF library and want to know whether current version of Sandcastle (2.4.10522.00) has supported XAML Syntax very well?
I tried to generate a help for a wpf demo library and found some properties can not be generated with XAML Syntax.

For example:

public static readonly DependencyProperty LengthProperty = DependencyProperty.Register("Length", typeof(int), typeof(MyControl), new UIPropertyMetadata(0));

I checked the following source code and found:
SyntaxComponnet -> XamlUsageSyntaxGenerator -> DoesParentSupportXaml will check whether the parent class has a default constructor or not through : HasDefaultConstructor method.
And in that method, this XPath will be checked
private XPathExpression hasDefaultConstructorExpression = XPathExpression.Compile("boolean(typedata/@defaultConstructor)");

But that method will always retrun empty.
I checked the reflection schema: reflection.xsd. And there is no definition of typedata/@defaultConstructor.

 It seems the features for XAML supports have not finished yet, am I right?
If yes, when this feature (XAML Syntax) can be provided ?  (Now, more WPF applications are developed and I think this one will be requested more and more.)

If no, are there some tips for generate the XAML syntax with correct results?




Aug 10, 2009 at 2:52 AM

>>Jamebo : If no, are there some tips for generate the XAML syntax with correct results?
Is XamlAttachedMembersAddIn enabled in your MRefBuilder.config file?

Best regards,

Aug 10, 2009 at 3:00 AM
Edited Aug 10, 2009 at 3:41 AM

Yes, the addin is enabled in my MRefBuilder.config, like this:

      <addin type="Microsoft.Ddue.Tools.XamlAttachedMembersAddIn" assembly="MRefBuilder.exe" />
      <addin type="Microsoft.Ddue.Tools.ExtensionMethodAddIn" assembly="MRefBuilder.exe" />

And xaml stytax for attached property/event can be generated, like this:

XAML Attribute Usage
<object MyControl.RowCount="int" .../>

But for the dependency property(a LengthProperty with int type ), the result is:

public int Length { get; set; }
Visual Basic (Declaration)
Public Property Length As Integer
Visual Basic (Usage)
Dim instance As MyControl
Dim value As Integer

value = instance.Length

instance.Length = value
You cannot set this property in XAML.


Best Regards


Aug 12, 2009 at 2:56 AM

Let me answer this question by myself after reading the source code.

Sandcastle has implemented the xaml sytax in this build. The key file is AddXamlSyntaxData.xsl whichi is located in \ProductionTransforms folder.

Through this tramsform, the orginal reflection.xml  will be converted and can get xaml sytax output.

Now, it seems all about xaml are okay for sandcastle (xaml syntax and xaml example source code).



Aug 12, 2009 at 7:08 AM

Hello jamebo, I use Sandcastle May 2008 release (Version 2.4.10520) and Help File Builder Ver.

I don't seem to able to get the xaml syntax code block out, is there anything besides adding the XamlUsageSyntaxGenerator to the <Sandcastle install>\Presentation\vs2005\configuration\sandcastle.config file (I use VS2005 presentation):

<component type="Microsoft.Ddue.Tools.SyntaxComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
              <syntax input="/document/reference" output="/document/syntax" />

                                ((Other generators...))

   <generator type="Microsoft.Ddue.Tools.XamlUsageSyntaxGenerator" assembly="%DXROOT%\ProductionTools\SyntaxComponents.dll">
    <filter files="%DXROOT%\Presentation\shared\configuration\xamlSyntax.config"/>

Since you mention you use 2.4.10522, perhaps I should use a later build. Is there a later build after 2.4.10520?


Aug 12, 2009 at 8:05 AM

I just noticed you had to add the assemblies and namespaces to the <Sandcastle install>\Presentation\Shared\configuration\xamlSyntag.config. Xaml syntax code blocks are now produced.

I'm sorry for the fuss! please forget my question.