<p>I have just realized I've been coercing binding/dependency properties and not really fundamentally understanding the concept.</p>

<p>Heres the dependency property:</p>

<pre><code>public string Problem
{
    get { return (string)GetValue(ProblemProperty); }
    set { SetValue(ProblemProperty, value); }
}

public static readonly DependencyProperty ProblemProperty =
    DependencyProperty.Register(
    "Problem",
    typeof(string),
    typeof(TextBox));
</code></pre>

<p>The XAML is as so:</p>

<pre><code>&lt;TextBlock Text="{Binding Path=Problem}"/&gt;
</code></pre>

<p>I'm manually setting the <code>Problem</code> property to a value in the constructor of the object but it doesn't update the <code>TextBlock</code> accordingly . . . any ideas? I've tried <code>Mode="OneWay"</code> and <code>Mode="TwoWay"</code> on the binding and it still doesn't work.</p>

<p>I thought this was supposed to work automatically? Or am i fundamentally getting something wrong?</p>

<p>Thanks</p>

The problem your having is definitely related to your DataContext. The {Binding} extension needs to know where the property lives that you are binding to. The default location it looks at is the elements DataContext which by default is always set to the DataContext of it's parent element. If you walk the DataContext up the logical tree to the parent window, The DataContext would be null (because the DataContext of your window is null). Therefore your {Binding} on your textblock is saying "Bind my Text property to the Problem roperty of my DataContext...which is null.
There are a couple of ways to solve this. One would be to do just like Jobi mentioned and set the Element property of you binding to point to the Window where the DependencyProperty is defined like this:
```
```
<TextBlock Text="{Binding Path=Problem,ElementName=_window}" />
```
```
Another option would be to set the DataContext of your Window to point to itself. That way all the elements contained in it's content will all have the DataContext of the window.
```
```
<Window ....
        DataContext="{Binding RelativeSource={RelativeSource Self}}">
```
```
Now anytime you need to binding to properties defined in the window (like your Problem dependency property), then you can just do this:
```
```
<TextBlock Text="{Binding Problem}" />
```
```