private void UpdateQuality(MediaQuality quality)
 {
     switch (quality)
     {
         case MediaQuality.StandardDefinition:
             this.GoToVisualState("SD");
             AutomationProperties.SetName(this, MediaPlayer.GetResourceString("StandardDefinitionLabel"));
             break;
         case MediaQuality.HighDefinition:
             this.GoToVisualState("HD");
             AutomationProperties.SetName(this, MediaPlayer.GetResourceString("HighDefinitionLabel"));
             break;
     }
 }
 /// <summary>
 /// Provides notification that the MediaQuality has changed.
 /// </summary>
 /// <param name="oldValue">The previous media quality.</param>
 /// <param name="newValue">The new media quality.</param>
 protected virtual void OnMediaQualityChanged(MediaQuality oldValue, MediaQuality newValue)
 {
     UpdateQuality(newValue);
 }