Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>How about static analysis of your Xaml performed as a post-build step?</p> <p>As part of .Net 4, Microsoft released a new <a href="http://msdn.microsoft.com/en-us/library/system.xaml.aspx" rel="nofollow noreferrer">System.Xaml</a> library to provide robust Xaml parsing and serialization support independent of WPF. They are now beginning to build all kinds of interesting things on top of it, some of which may help you out.</p> <p>In the <a href="http://code.msdn.microsoft.com/XAML" rel="nofollow noreferrer">XamlToolkit</a>, for example, you'll find the <a href="http://blogs.msdn.com/b/wpf/archive/2010/07/28/microsoft-xaml-toolkit-ctp-july-2010-xaml-dom.aspx" rel="nofollow noreferrer">XamlDOM</a> that enables you to do easy static analysis of Xaml files. And taking that a bit further, there's <a href="http://blogs.msdn.com/b/wpf/archive/2010/07/28/microsoft-xaml-toolkit-ctp-july-2010-fxcop-integration.aspx" rel="nofollow noreferrer">FxCop rules for XAML</a>.</p> <p>Of most interest is Rob Relyea's <a href="http://blogs.windowsclient.net/rob_relyea/archive/2010/08/29/bindingfinder-updates.aspx" rel="nofollow noreferrer">BindingFinder</a> that has the explicit goal of type checking Bindings in Xaml. This requires that you have type hints in your Xaml, like the <a href="http://msdn.microsoft.com/en-us/library/system.windows.datatemplate.datatype.aspx" rel="nofollow noreferrer">DataType</a> attribute in a DataTemplate, or the the new <a href="http://www.robfe.com/2009/12/the-curious-case-of-the-designdata-msbuild-target/" rel="nofollow noreferrer">d:DataContext attribute</a> on your Views (which Blend uses to provide design-time data). It then uses the XamlDOM to check that everything matches up.</p> <p><strong>Update:</strong> <a href="http://www.jetbrains.com/resharper/download/" rel="nofollow noreferrer">Resharper 6</a> now provides <a href="http://blog.functionalfun.net/2011/06/resharper-6-xaml-tip-intellisense-for.html" rel="nofollow noreferrer">intellisense for data bindings</a>, and warnings if you get your property paths wrong.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload