I am currently in the process of creating a documentation for my C# code. I've done a lot of ordinary source code and set up doxygen to create HTML out of it. Finally I arrived at the UI which is done in WPF, so both XAML and source code. Now my question is, what is the best way to document these files? Comments are possible in XAML but not that useful as they cannot be nested. Also I don't know if Doxygen can possibly handle XAML documentation. So should everything be documented in the xaml.cs files?
2 Answers
I found a more or less good solution. At first, you have to add the file extension to FILE_PATTERNS, so *.xaml in my case. Doxygen uses the extension to determine what parser to use. I guess the default is C. Next you add your documentation like this:
<!-->
/** \file
* \brief A brief file description.
*
* A more elaborated file description.
*/ -->
The < !-- and --> are the comment section for xaml files. When Doxygen parses the file it removes the documentation without adding it. That's why there is a > to fool the Doxygen parser that the comment is already finished. I know this is ugly but the worst that can happen is that my descriptions are lost in the documentation but still available in the files. So as long as there is no better way of doing it I will stick with this.

- 8,285
- 3
- 19
- 32

- 238
- 2
- 13
The file level comment works fine.
I also got class working in XAML files:
<!-->
/** \file
* \brief Global resources via the nexus_client.Generic class.
*
* All user configurable parameters defined here.
*/ -->
<ResourceDictionary
x:Class="nexus_client.Generic"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:core="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:nexus_client">
<!-->
/** \class nexus_client.Generic
* \brief Global resources via the nexus_client.Generic class.
*
* All user configurable parameters defined here.
*/ -->
Now I'm trying to document properties:
<!-->
/** \property nexus_client.Generic.OEBackgroundBrushBuy
* \brief Background colours for Order Entry Views based on the side (Buy, Sell) - Buy Side
*
*/ -->
But this does not work. Also tried \var but no go.
I can see that doxygen is parsing this comment block as there is an error message:
/local/home/oberss2/working/branches/RIV-1158-Nexus-1.2.1/nexus_client/nexus_client/Themes/Generic.xaml:136: Warning: documented symbol `nexus_client Generic OEBackgroundBrushBuy' was not declared or defined.
I can't see why it would treat a property any differently than a class in a XAML file, neither have been declared.

- 27
- 2
-
I haven't maintained my documentation lately but maybe I will give it another try with your information and report back. Thank you! – Marcel Bonzelet Apr 24 '17 at 07:49