title: Custom XML Data Provider (WPF)
body: <p>I want to create my own XML data provider derived from DataSourceProvider (similar XmlDataProvider).</p>
  
  <p>(i don't want use XmlDataProvider because i want return alternative data if XPath query is failed)</p>
  
  <p>But i can't understand how to access XPath property which set via Binding.XPath.</p>
  
  <p>For example, i have class:</p>
  
  <pre><code>public class MyXmlDataProvider : DataSourceProvider
  {
      private string _xPath;
      public string XPath
      {
          // The following code i spied from XmlDataProvider implementation using .Net Reflector
          get
          {
              return this._xPath;
          }
          set    // WHY binding do not call this setter? ((
          {
              if (this._xPath != value)
              {
                  this._xPath = value;
                  if (!base.IsRefreshDeferred)
                  {
                      base.Refresh();
                  }
              }
          }
      }
  
      private string _result;
      protected override void BeginQuery()
      {
          // .... getting result using XPath
  
          base.OnQueryFinished(_result);
      }
  }
  </code></pre>
  
  <p>XAML binding example (mydata - instance of MyXmlDataProvider class):</p>
  
  <pre><code>&lt;TextBlock Text="{Binding Source={StaticResource mydata}, XPath=/main/version}" /&gt;
  </code></pre>
  
  <p>Question is: How can i get Binding.XPath value in MyXmlDataProvider class?</p>