title: Can't manage with TextBox.Text binding with Template assigned
body: <p>I have model Partner:</p>
  
  <pre><code>public class Partner
  {
      public Guid Id { get; set; }
      public string Title { get; set; }
      public string Comment { get; set; }
  
      public override string ToString()
      {
          return Title;
      }
  }
  </code></pre>
  
  <p>view with this xaml:</p>
  
  <pre><code>&lt;Window x:Class="WpfExtandedTextBox.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
          xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
          xmlns:ModelViews="clr-namespace:WpfExtandedTextBox"
          d:DataContext="{d:DesignInstance ModelViews:ViewModel}"
          mc:Ignorable="d"
          Title="MainWindow" Height="450" Width="800" Loaded="Window_Loaded"&gt;
  
      &lt;Window.Resources&gt;
          &lt;ControlTemplate x:Key="entityTextBoxTemplate" TargetType="TextBox"&gt;
              &lt;StackPanel Orientation="Horizontal"&gt;
  
                  &lt;TextBox MinWidth="200" Text="{Binding Partner.Title, Mode=TwoWay}"/&gt;
                  &lt;TextBlock MaxWidth="0" Visibility="Hidden" Text="{Binding Partner.Id, Mode=TwoWay}"/&gt;
  
                  &lt;Button x:Name="OpenPartnerList" Content="..." Click="OpenPartnerList_Click"/&gt;
                  &lt;Button x:Name="OpenPartner" Content="O" Click="OpenPartner_Click"/&gt;
                  &lt;Button x:Name="ClearPartner" Content="X" Click="ClearPartner_Click"/&gt;
  
              &lt;/StackPanel&gt;
          &lt;/ControlTemplate&gt;
      &lt;/Window.Resources&gt;
  
      &lt;StackPanel Orientation="Vertical" &gt;
  
          &lt;TextBox x:Name="TextBoxSelectedPartner" Template="{StaticResource entityTextBoxTemplate}" HorizontalAlignment="Center" VerticalAlignment="Center" /&gt;
          &lt;!--&lt;Button x:Name="ChoosePartner" Click="ChoosePartner_Click" Content="Choose partner"/&gt;
          &lt;DataGrid ItemsSource="{Binding Partners}" AutoGenerateColumns="True" /&gt;--&gt;
  
      &lt;/StackPanel&gt;
  
  &lt;/Window&gt;
  </code></pre>
  
  <p>and view model:</p>
  
  <pre><code>public class ViewModel : BaseViewModel
      {
          private List&lt;Partner&gt; partners;
          public List&lt;Partner&gt; Partners
          {
              get { return this.partners; }
          }
  
          private Partner partner;
          public Partner Partner
          {
              get { return this.partner; }
              set
              {
                  this.partner = value;
                  NotifyPropertyChanged();
              }
          }
  
          public ViewModel()
          {
              AppDbContext db = new AppDbContext();
              this.partners = db.Partners.ToList();
              db.Dispose();
          }
      }
  </code></pre>
  
  <p>I'd like to create TextBox with 3 buttons:
  1 - for choosing Partner from some list
  2 - for opening window with Partner's details
  3 - for clearing TextBox</p>
  
  <p>For this purpose I've created ControlTemplate "entityTextBoxTemplate": TextBox is for storing Partner.Title and hidden TextBlock is for storing Partner.Id. I assume that after choosing a Partner from list TextBox and TextBlock will be filled with Title and Id respectively, but it doesn't work and I don't know why. Can anybody help me to solve this issue?</p>
  
  <p>Updated:
  Partner is populated in this code:</p>
  
  <pre><code>private void PartnerListView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
      {
          viewModel.Partner = ((PartnerListView)sender).SelectedPartner;
      }
  </code></pre>
  
  <p>Updated 2:</p>
  
  <p>My BaseViewModel:</p>
  
  <pre><code>public class BaseViewModel
      {
          public event PropertyChangedEventHandler PropertyChanged;
  
          public void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
          {
              PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
          }
      }
  </code></pre>
  
  <p>My fixed BaseViewModel:</p>
  
  <pre><code>public class BaseViewModel : INotifyPropertyChanged
      {
          public event PropertyChangedEventHandler PropertyChanged;
  
          public void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
          {
              PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
          }
      }
  </code></pre>
  
  <p>I just forgot to specify implemented interface: ": INotifyPropertyChanged"</p>