title: How to handle the Slider.ValueChanged event in a view model?
body: <p>I have a <strong><em>PlayerV.xaml</em></strong> View with a Slider inside:</p>
  
  <pre><code>&lt;Slider Value="{Binding CurrentProgress}"/&gt;
  </code></pre>
  
  <p>and have a button:</p>
  
  <pre><code>&lt;Button Content="next song" Command="{Binding playNext}"/&gt;
  </code></pre>
  
  <p>Button works correct. Button's <strong><em>playNext</em></strong> command is contained in <strong><em>PlayerVM.cs</em></strong></p>
  
  <p>I want slider's ValueChanged to call a function which is stored in <strong><em>PlayerVM.cs</em></strong>:</p>
  
  <p>[1]:<code>&lt;Slider Value="{Binding CurrentProgress}" ValueChanged="{Binding playNext}"/&gt;</code></p>
  
  <p>I know [1] has an incorrect syntax, I used it for sake of clarity of explanation.</p>
  
  <p>====Additional Explanation====</p>
  
  <p>I know I can write:</p>
  
  <pre><code>&lt;Slider ValueChanged="Slider_ValueChanged" Value="{Binding CurrentProgress}" /&gt;
  </code></pre>
  
  <p>And in <strong><em>PlayerV.xaml.cs</em></strong> there will be</p>
  
  <pre><code>public partial class MainWindow : Window
  {
      public MainWindow()
      {
          InitializeComponent();
      }
      private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs&lt;double&gt; e)
      {
          //some logic (actions) 
      }    
  }
  </code></pre>
  
  <p>But I don't want any logic in there. I want it to be in <strong><em>PlayerVM.cs</em></strong> (like button's command handler functions).
  How to do that?
  Also in my App.xaml.cs startup function is:</p>
  
  <pre><code>private void OnStartup(object sender, StartupEventArgs e)
  {
      MainWindow _mainWindow = new MainWindow();
      PlayerVM playerVM = new PlayerVM();
      _mainWindow.DataContext = playerVM;
      _mainWindow.Show();
   }
  </code></pre>