title: DepedencyProperty within a MarkupExtension
body: <p>Is it possible to have a <code>DependencyProperty</code> within a <code>MarkupExtension</code> derived class?</p>
  
  <pre><code>public class GeometryQueryExtension : MarkupExtension
  {
      public XmlDataProvider Source { get; set; }
  
      public string XPath { get; set; }
  
      public static readonly DependencyProperty ArgumentProperty = DependencyProperty.RegisterAttached(
          "Argument",
          typeof(string),
          typeof(GeometryQueryExtension)); // this wont work because GeometryQueryExtension is not a DependencyProperty
  
      public string Argument
      {
          get
          {
              return (string)GetValue(ArgumentProperty); // this wont even compile because GeometryQueryExtension doesnt derive from a class which has GetValue
          }
          set
          {
              SetValue(ArgumentProperty,value);// this wont even compile because GeometryQueryExtension doesnt derive from a class which has SetValue
          }
      }
  }
  </code></pre>
  
  <p>The extension is used in the following snippet.</p>
  
  <pre><code>&lt;Label.Content&gt;
      &lt;local:GeometryQueryExtension Source="{StaticResource shapesDS}"&gt;
          &lt;local:GeometryQueryExtension.XPath&gt;
              /Shapes/Geometry/{0}
          &lt;/local:GeometryQueryExtension.XPath&gt;
          &lt;local:GeometryQueryExtension.Argument&gt;
              &lt;Binding XPath="Geometry"/&gt; &lt;!-- will throw exception when processing this bind --&gt;
          &lt;/local:GeometryQueryExtension.Argument&gt;
      &lt;/local:GeometryQueryExtension&gt;
  &lt;/Label.Content&gt;
  </code></pre>
  
  <p>Is it even possible to build such an extension or am i just barking up the wrong tree ?
  (the code above wont compile and run, but i posted it here to best illustrate the problem).</p>