Sarva Siddartha

Sarva Siddartha

  • NA
  • 16
  • 5.9k

Slider Control to maintain Volume

Dec 15 2015 2:21 AM
Hello,
 
I am just making an simple media player application. In that I am trying to keep a Slider in order to maintain the volume of the audio. But I am getting an exception like object reference not set to instance of a object
 
The code is like below:
 
//volrocker is name of the slider
//me is the name of the media player 
private void volrocker_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
{
if (me.IsMuted)
{
me.IsMuted = false;
}
if (me.Volume > 0)
{
me.Volume -= volrocker.Value;
}
}
 
Help me in writing the code.......... 
 

Answers (1)