How do I add the XMLNS for XAML row ?

Feb 28, 2008 at 8:12 AM
Hi,

I´ve found this in the MSDN documentation - For example the TextBlock class:
XMLNS for XAML: http://schemas.microsoft.com/winfx/xaml/presentation

I like this and want to add it to my own Presentation-base classes.

Looked around in the SandCastle xsl files and found the text: XMLNS for XAML and the template which creates it.
But I cannot get the text into the documentation.

In the assemblyinfo file this tag is added:
assembly: XmlnsDefinition

Do I need to add a tag to each class or add something more into the assemblyinfo ?

Best regards
--Tony
Feb 28, 2008 at 10:43 AM
Hi Tony,

According to this discussion, you must add the XAML usage syntax generator to the sandcastle.config file for the SyntaxComponent. Here's the relevant section for the VS 2005 presentation style in the January 2008 Release (note that I appended the XAML generate to the end of the generators element):

<!--Generate syntax-->
<component type="Microsoft.Ddue.Tools.IfThenComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
  <if condition="not(starts-with($key,'Overload:') or starts-with($key,'R:'))" />
  <then>
    <component type="Microsoft.Ddue.Tools.SyntaxComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
      <syntax input="/document/reference" output="/document/syntax" />
      <generators>
        <generator type="Microsoft.Ddue.Tools.VisualBasicDeclarationSyntaxGenerator" assembly="%DXROOT%\ProductionTools\SyntaxComponents.dll" />
        <generator type="Microsoft.Ddue.Tools.CSharpDeclarationSyntaxGenerator" assembly="%DXROOT%\ProductionTools\SyntaxComponents.dll" />
        <generator type="Microsoft.Ddue.Tools.CPlusPlusDeclarationSyntaxGenerator" assembly="%DXROOT%\ProductionTools\SyntaxComponents.dll" />
        <generator type="Microsoft.Ddue.Tools.ScriptSharpDeclarationSyntaxGenerator" assembly="%DXROOT%\ProductionTools\SyntaxComponents.dll" />
 
        <generator type="Microsoft.Ddue.Tools.XamlUsageSyntaxGenerator" assembly="%DXROOT%\ProductionTools\SyntaxComponents.dll">
          <filter files="%DXROOT%\Presentation\shared\configuration\xamlSyntax.config"/>
        </generator>
 
      </generators>
    </component>
  </then>
</component>
For all APIs that are applicable (i.e., XAML syntax applies) you're supposed to get a new XAML usage block under the syntax section (near C#, VB.NET, etc.). From what I can tell in the XSL transformations, the XMLNS for XAML string should appear automatically in this case. For those APIs that do not apply, the string will not be shown and the syntax block should simply state, Not Applicable.

Note however that I tried this using the VS 2005 presentation style and it didn't work at all (no XLMNS for XAML string or syntax block appeared in any of the auto-generated reference topics - even a custom WPF Window class). This might be a bug, so if you experience the same thing then I suggest adding it to the Issue Tracker.

- Dave
Feb 29, 2008 at 7:05 AM
Thanks for the answer Dave,

Unfortunately, it did not work.
I´m also using the vs2005 presentation style - I add this to the issue tracker. Hopefully there is a solution to this somewhere.

- Tony
Dec 9, 2009 at 2:17 PM

Here are the steps to show XAML usage.
1. Use AddXamlSyntaxData.xsl to transform reflection.org.
    "C:\Program Files\Sandcastle\\ProductionTools\XslTransform.exe" /xsl:"C:\Program Files\Sandcastle\\ProductionTransforms\AddXamlSyntaxData.xsl" /xsl:"C:\Program Files\Sandcastle\\ProductionTransforms\ApplyVSDocModel.xsl" /xsl:"C:\Program Files\Sandcastle\\ProductionTransforms\AddFriendlyFilenames.xsl" "C:\Program Files\Sandcastle\\Examples\colorpicker\vs2005\reflection.org" /out:"C:\Program Files\Sandcastle\\Examples\colorpicker\vs2005\reflection.xml" /arg:IncludeAllMembersTopic=true /arg:IncludeInheritedOverloadTopics=true

2. Add XamlUsageSyntaxGenerator to buildAssembler config file.
<!--Generate syntax-->
<component type="Microsoft.Ddue.Tools.IfThenComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
  <if condition="not(starts-with($key,'Overload:') or starts-with($key,'R:'))" />
  <then>
    <component type="Microsoft.Ddue.Tools.SyntaxComponent" assembly="%DXROOT%\ProductionTools\BuildComponents.dll">
      <syntax input="/document/reference" output="/document/syntax" />
      <generators>
        <generator type="Microsoft.Ddue.Tools.VisualBasicDeclarationSyntaxGenerator" assembly="%DXROOT%\ProductionTools\SyntaxComponents.dll" />
        <generator type="Microsoft.Ddue.Tools.CSharpDeclarationSyntaxGenerator" assembly="%DXROOT%\ProductionTools\SyntaxComponents.dll" />
        <generator type="Microsoft.Ddue.Tools.CPlusPlusDeclarationSyntaxGenerator" assembly="%DXROOT%\ProductionTools\SyntaxComponents.dll" />
        <generator type="Microsoft.Ddue.Tools.ScriptSharpDeclarationSyntaxGenerator" assembly="%DXROOT%\ProductionTools\SyntaxComponents.dll" />
         <generator type="Microsoft.Ddue.Tools.XamlUsageSyntaxGenerator" assembly="%DXROOT%\ProductionTools\SyntaxComponents.dll">
          <filter files="%DXROOT%\Presentation\shared\configuration\xamlSyntax.config"/>
        </generator>

       </generators>
    </component>
  </then>
</component>

3. Update xamlSyntax.config above to add the user assemblies.
  <xamlAssemblies>
    <assembly name="ColorPicker">
      <xmlns uri="
http://schemas.microsoft.com/xaml/sample">
        <clrNamespace name="Microsoft.Samples.CustomControls"/>
      </xmlns>
    </assembly>
    ...
  </xamlAssemblies>

Oct 15, 2010 at 6:56 PM

Steven,

Point 1:
Does that mean that each time we need to update the help file, we need to run this command again?

Point 3:
What do we need to put in the <xmlns uri="http://schemas.microsoft.com/xaml/sample"> as an URI?
Can we just create any URI?

Patrick