title: WPF - How to bind to a Dependency Property of custom class
body: <p>I'm once again in WPF binding hell :) I have a public class (<code>Treatment</code>) as follows:</p>
  
  <pre><code>public class Treatment()  
  {  
  ...    
      public Ticker SoakTimeActual;   
  ...  
  }
  </code></pre>
  
  <p>Within <code>Ticker</code> is a Dependency Property:</p>
  
  <pre><code>public class Ticker : FrameworkElement
  {     
      // Value as string
      public static readonly DependencyProperty DisplayIntervalProperty = DependencyProperty.Register("DisplayInterval", typeof(string), typeof(Ticker), null);
      public string DisplayInterval
      {
          get { return (string)GetValue(DisplayIntervalProperty); }
          set { SetValue(DisplayIntervalProperty, value); }
      }
      ...
  }
  </code></pre>
  
  <p>In my app, a single <code>Treatment</code> object is created and is meant to be easily accessible in XAML (in <code>app.xaml</code> ):</p>
  
  <pre><code>&lt;Application.Resources&gt;
     &lt;ResourceDictionary&gt;
        &lt;u:Treatment
           x:Key="currentTreatment" /&gt;
     &lt;/ResourceDictionary&gt;
  &lt;/Application.Resources&gt;
  </code></pre>
  
  <p>Now, I need to bind to the <code>DisplayInterval</code> dependency property of <code>SoakTimeActual</code> to display this text in its current state. Here is my attempt, which doesn't work:</p>
  
  <pre><code>&lt;TextBlock              
     Text="{Binding Source={StaticResource currentTreatment}, Path=SoakTimeActual.DisplayInterval}"/&gt;
  </code></pre>
  
  <p>This, of course, compiles ok, but will not display anything. I'm assuming I've made a mistake with change notification or <code>DataContext</code> or both. </p>
  
  <p>Any insight is appreciated!</p>