title: Dynamic grid columns and access to StaticResources
body: <p>In my grid I have a static columns, and when I click to a button I add some dynamic columns :</p>
  
  <pre><code>class ItemConstraintColumn : DataGridTemplateColumn
          {
              public ItemConstraintColumn(ReportEventItemConstraint _ic)
              {
                  StringBuilder sb = new StringBuilder();
                  sb.Append("&lt;DataTemplate ");
                  sb.Append("xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' ");
                  sb.Append("xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' ");
                  sb.Append("xmlns:local='clr-namespace:MyNameSpace;assembly=MyAssembly'&gt; ");
                  sb.Append("&lt;local:SignalControl DataContext=\"{Binding Source={StaticResource SignalControlVM}}\" /&gt;");
                  sb.Append("&lt;/DataTemplate&gt;");
  
                  CellTemplate = (DataTemplate)XamlReader.Load(sb.ToString());
                  Header = _ic.Name;
              }
          }
  </code></pre>
  
  <p>The problem is I can't access to the StaticResource declared in my Xaml page, so I can't bind my control ...
  Can you please tell me what's wrong with that ?
  Thanks</p>