title: Binding Slider value to Textbox
body: <p>I'd like to dynamically create a Slider with its value bind to TextBox inside the DockPanel. When I'm trying to do so I cannot bind the slider value to the TextBox, and inside the TextBox I'm getting the following message: <em>{Binding ElementName=slValue, Path=Value, UpdateSourceTrigger=PropertyChanged}</em> instead of the Slider's value.</p>
  
  <p>Here's the code I've written so far:</p>
  
  <pre><code>double minimum = 0.0;
  double maximum = 100.0;
  double defaultValue = 5.0;
  DockPanel item = new DockPanel();
  item.VerticalAlignment = VerticalAlignment.Center;
  Slider slValue = new Slider()
  {
       Minimum = minimum,
       Maximum = maximum,
       TickFrequency = 1.0,
       Value = defaultValue,
       IsSnapToTickEnabled = true,
       Name = "slValue",
       Width = 100
  };
  TextBox slValueTB = new TextBox()
  {
       Text = "{Binding ElementName=slValue, Path=Value, UpdateSourceTrigger=PropertyChanged}",
       TextAlignment = TextAlignment.Right,
       Width = 40,
  };
  item.Children.Add(slValue);
  item.Children.Add(slValueTB);
  </code></pre>
  
  <p>And here's the xml code I'm trying to recreate dynamically:</p>
  
  <pre><code>        &lt;DockPanel VerticalAlignment="Center" Margin="10"&gt;
              &lt;TextBox Text="{Binding ElementName=slValue, Path=Value, UpdateSourceTrigger=PropertyChanged}" DockPanel.Dock="Right" TextAlignment="Right" Width="40" /&gt;
              &lt;Slider Minimum="0" Maximum="100" TickPlacement="BottomRight" TickFrequency="5" IsSnapToTickEnabled="True" Name="slValue" /&gt;
          &lt;/DockPanel&gt;
  </code></pre>