Binding does not work with a ViewModel
<p>I want to change the Fill of a Rectangle depending on a boolean. I have the following classes.</p>

<p><strong>Base class that extends INotifyPropertyChanged:</strong></p>

<pre><code>public class PropertyChangedBase : INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;

    protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
</code></pre>

<p><strong>Model:</strong></p>

<pre><code>public class ChangingVariable : PropertyChangedBase
{
    public ChangingVariable()
    {
        Variable = true;
    }

    private bool _variable;

    public bool Variable
    {
        get
        {
            return _variable;
        }

        set
        {
            if (_variable.CompareTo(value) != 0)
            {
                _variable = value;
                OnPropertyChanged();
            }
        }
    }
}
</code></pre>

<p><strong>ViewModel:</strong></p>

<pre><code>public class BooleanRectangleViewModel : PropertyChangedBase
{
    public ChangingVariable Model { get; set; }
}
</code></pre>

<p>This is my View that does <em>not</em> work (Fill is gray):</p>

<p>xaml:</p>

<pre><code>&lt;UserControl.DataContext&gt;
    &lt;viewModels:BooleanRectangleViewModel x:Name="ViewModel"/&gt;
&lt;/UserControl.DataContext&gt;

&lt;Rectangle x:Name="Rectangle"&gt;
    &lt;Rectangle.Style&gt;
        &lt;Style TargetType="{x:Type Rectangle}"&gt;
            &lt;Setter Property="Fill" Value="Gray" /&gt;
            &lt;Style.Triggers&gt;
                &lt;DataTrigger Binding="{Binding Model.Variable}" Value="true"&gt;
                    &lt;Setter Property="Fill" Value="GreenYellow" /&gt;
                &lt;/DataTrigger&gt;
            &lt;/Style.Triggers&gt;
        &lt;/Style&gt;
    &lt;/Rectangle.Style&gt;
&lt;/Rectangle&gt;
</code></pre>

<p>cs:</p>

<pre><code>public partial class BooleanRectangleView
{
    public BooleanRectangleView()
    {
        InitializeComponent();
        ViewModel.Model = new ChangingVariable();
    }
}
</code></pre>

<p>However when I change it such that the data context is the Model instead of the ViewModel, it works (Fill is green):</p>

<p>xaml:</p>

<pre><code>&lt;UserControl.DataContext&gt;
    &lt;models:ChangingVariable x:Name="ViewModel" /&gt;
&lt;/UserControl.DataContext&gt;

&lt;Rectangle x:Name="Rectangle"&gt;
    &lt;Rectangle.Style&gt;
        &lt;Style TargetType="{x:Type Rectangle}"&gt;
            &lt;Setter Property="Fill" Value="Gray" /&gt;
            &lt;Style.Triggers&gt;
                &lt;DataTrigger Binding="{Binding Variable}" Value="true"&gt;
                    &lt;Setter Property="Fill" Value="GreenYellow" /&gt;
                &lt;/DataTrigger&gt;
            &lt;/Style.Triggers&gt;
        &lt;/Style&gt;
    &lt;/Rectangle.Style&gt;
&lt;/Rectangle&gt;
</code></pre>

<p>cs:</p>

<pre><code>public partial class BooleanRectangleView
{
    public BooleanRectangleView()
    {
        InitializeComponent();
        ViewModel = new ChangingVariable();
    }
}
</code></pre>

<p>Why does it not work with the ViewModel inbetween?</p>