title: Bindings on a ContentControl do not update the data
body: <p>I have the code:</p>
  
  <pre><code>&lt;TextBox Width="200" Text="{Binding Value}"&gt;&lt;/TextBox&gt;
  </code></pre>
  
  <p>Which works. However the "Value" can be different types. So if I have an bool I want to show a checkbox. I rewrote it as as follow, which kinda works:</p>
  
  <pre><code>&lt;ContentControl Content="{Binding Value}"&gt;
      &lt;ContentControl.Resources&gt;
          &lt;DataTemplate DataType="{x:Type sys:Boolean}"&gt;
              &lt;CheckBox IsChecked="{Binding Path=.}"&gt;&lt;/CheckBox&gt;
          &lt;/DataTemplate&gt;
          &lt;DataTemplate DataType="{x:Type sys:Double}"&gt;
              &lt;TextBox Width="200" Text="{Binding Path=.}"&gt;&lt;/TextBox&gt;
          &lt;/DataTemplate&gt;
      &lt;/ContentControl.Resources&gt;
  &lt;/ContentControl&gt;
  </code></pre>
  
  <p>But now the property isn't updated like before. I have tried setting Mode=Twoway, but it still do not work.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>It worked perfectly fine when I only had the textbox, editing the text of the textbox updated the model. However when I tried doing this with the second code (ContentControl) it just doesn't work.</p>
  
  <p><strong>Code</strong></p>
  
  <p>I'm using Mvvm-light togheter with bindings. The "Value" is bound to an instance of Property</p>
  
  <pre><code>    [JsonObject]
      public class Property&lt;T&gt; : INotifyPropertyChanged
      {
          [JsonProperty]
          public String name;
  
          public Property(String name, T value)
          {
              this._value = value;
              this.name = name;
          }
  
          [JsonIgnore]
          public T Value {
              get { return _value; }
              set {
                  _value = value;
                  hot = true;
                  NotifyPropertyChanged("Value");
              }
          }
  
          [JsonProperty(PropertyName = "value")]
          private T _value;
  
          [JsonIgnore]
          public String Name { get { return name; } set { name = value; } }
  
          [JsonProperty]
          public bool hot = false;
  
          public event PropertyChangedEventHandler PropertyChanged;
          private void NotifyPropertyChanged(string propertyName)
          {
              var handler = PropertyChanged;
              if (handler != null)
              {
                  handler(this, new PropertyChangedEventArgs(propertyName));
              }
          }
      }
  </code></pre>