Monthly Archives: November 2012

Code Snippets – Disable Warning 4014

I use code snippets extensively. I don’t think it makes sense to do without them if you do any XAML work, though what you use them for is actually the code behind where lots of boilerplate code is necessary. My snippets collection consists mostly of modified Dr WPF’s dependency property snippets and various types of observable property snippets. Today I am working on cleaning up some code in WinRT XAML Toolkit and decided a snippet to disable warnings could be helpful, so here it is (also added to my collection on dropbox). Just use the sw shortcut for this Suppress Warning snippet.

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="">
  <CodeSnippet Format="1.0.0">
      <Title>Suppress Warning</Title>
      <Description>Surrounds with a #pragma warning disable/restore block.</Description>
      <Author>Filip Skakun</Author>
          <ToolTip>Comma separated warning list.</ToolTip>
      <Code Language="csharp">
        <![CDATA[#pragma warning disable $warninglist$
#pragma warning restore $warninglist$]]>