private void MediaElement_ClipClickThrough(object sender, ClipEventArgs e)
 {
     if (AdClickThrough != null)
     {
         var adContext = new AdContext(e.Context);
         AdClickThrough(this, adContext);
     }
 }
        private void MediaElement_ClipProgressUpdate(object sender, ClipPlaybackEventArgs e)
        {
            AdProgress adProgress;
#if SILVERLIGHT3
            if (AdProgressUpdated != null && SystemExtensions.TryParse(e.Progress.ToString(), true, out adProgress))
#else
            if (AdProgressUpdated != null && Enum.TryParse(e.Progress.ToString(), true, out adProgress))
#endif
            {
                var adContext = new AdContext(e.Context);
                AdProgressUpdated(this, adContext, adProgress);
            }
        }
 private void MediaElement_ClipError(object sender, ClipEventArgs e)
 {
     if (AdError != null)
     {
         var adContext = new AdContext(e.Context);
         AdError(this, adContext);
     }
 }
 private void MediaElement_ClipStateChanged(object sender, ClipEventArgs e)
 {
     var adContext = new AdContext(e.Context);
     AdStateChanged.IfNotNull(i => i(this, adContext));
 }