title: Slider.Value changes on adjusting Minimum when it shouldn't
body: <p><strong>In short:</strong><br>
  Under certain circumstances setting Slider.Minimum will adjust Slider.Value although the current Value is bigger then the new Minimum.</p>
  
  <p><strong>Code:</strong> (should be reproducible)<br>
  <em>MainWindow.xaml:</em></p>
  
  <pre><code>&lt;Window x:Class="WpfApplication1.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="MainWindow" Height="350" Width="525"&gt;
      &lt;DockPanel&gt;
          &lt;Slider Name="MySlider" DockPanel.Dock="Top" AutoToolTipPlacement="BottomRight" /&gt;
          &lt;Button Name="MyButton1" DockPanel.Dock="Top" Content="shrink borders"/&gt;
          &lt;Button Name="MyButton2" DockPanel.Dock="Top" VerticalAlignment="Top" Content="grow borders"/&gt;
      &lt;/DockPanel&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p><em>MainWindow.xaml.cs:</em></p>
  
  <pre><code>using System.Windows;
  using System.Windows.Controls;
  
  namespace WpfApplication1
  {
      public partial class MainWindow : Window
      {
          public MainWindow()
          {
              InitializeComponent();
  
              MySlider.ValueChanged += (sender, e) =&gt;
              {
                  System.Diagnostics.Debug.WriteLine("Value changed: " + e.NewValue);
              };
  
              System.ComponentModel.DependencyPropertyDescriptor.FromProperty(Slider.MinimumProperty, typeof(Slider)).AddValueChanged(MySlider, delegate
              {
                  System.Diagnostics.Debug.WriteLine("Minimum changed: " + MySlider.Minimum);
              });
  
              System.ComponentModel.DependencyPropertyDescriptor.FromProperty(Slider.MaximumProperty, typeof(Slider)).AddValueChanged(MySlider, delegate
              {
                  System.Diagnostics.Debug.WriteLine("Maximum changed: " + MySlider.Maximum);
              });
  
              MySlider.Value = 1;
  
              MySlider.Minimum = 0.5;
              MySlider.Maximum = 20;
  
              MyButton1.Click += (sender, e) =&gt;
              {
                  MySlider.Minimum = 1.6;
                  MySlider.Maximum = 8;
              };
  
              MyButton2.Click += (sender, e) =&gt;
              {
                  MySlider.Minimum = 0.5;
                  MySlider.Maximum = 20;
              };
          }
      }
  }
  </code></pre>
  
  <p><strong>Steps to reproduce:</strong><br>
  1. Run in Debug mode.<br>
  2. Move Slider to the far right.<br>
  3. Press "shrink borders" Button.<br>
  4. Press "grow borders" Button.  </p>
  
  <p><strong>Expected Output:</strong></p>
  
  <pre><code>Value changed: 1
  Minimum changed: 0,5
  Maximum changed: 20
  //Multiple times "Value changed"
  Value changed: 20
  Minimum changed: 1,6
  Value changed: 8
  Maximum changed: 8
  Minimum changed: 0,5
  Maximum changed: 20
  </code></pre>
  
  <p>Slider stays at 8.</p>
  
  <p><strong>Actual Output:</strong></p>
  
  <pre><code>Value changed: 1
  Minimum changed: 0,5
  Maximum changed: 20
  //Multiple times "Value changed"
  Value changed: 20
  Minimum changed: 1,6
  Value changed: 8
  Maximum changed: 8
  Value changed: 1
  Minimum changed: 0,5
  Maximum changed: 20
  </code></pre>
  
  <p>(Note the additional "Value changed: 1")<br>
  Slider jumps to 1.</p>
  
  <p><strong>Sidenote:</strong><br>
  Binding Slider.Value OneWayToSource (or TwoWay) to a double property, fixes the issue.</p>
  
  <p><strong>Question:</strong><br>
  Why is this happening?</p>
  
  <p><strong>Theory:</strong><br>
  I'm pretty sure it has something to do with <a href="http://drwpf.com/blog/2010/05/05/value-coercion-for-the-masses/">Value Coercion</a>. It seems like the following happens:<br>
  1. Setting Value to 1 programmatical sets Value's "base value". It is between the default values for Minimum and Maximum, so the "effective value" is exactly the same.<br>
  2. Setting Minimum and Maximum does not change anything, because Value is still in between them.<br>
  3. Manually pulling the Slider to the right apparently changes the "effective value" but for some weird reason not the "base value".<br>
  4. Increasing the borders again, calls the coercion callback, which realizes, that the (wrong) "base value" is between the new Minimum and Maximum and changes the "effective value" back to it.</p>
  
  <p>Assuming this is indeed what is happening, leads us to the following question:<br>
  Why is manually pulling the Slider (3.) not affecting the "base value"?</p>