Example #1
0
        private void OnLectureVideoClick(object sender, RoutedEventArgs e)
        {
            if (videoLazyBlock != null)
            {
                return;
            }

            var lecture = (Coursera.Lecture)((Button)sender).DataContext;

            videoLazyBlock = new LazyBlock <string>(
                "video",
                null,
                lecture.VideoUrl,
                _ => false,
                new LazyBlockUI <string>(
                    this,
                    videoUrl =>
            {
                try
                {
                    var launcher   = new MediaPlayerLauncher();
                    launcher.Media = new Uri(videoUrl, UriKind.Absolute);
                    launcher.Show();
                }
                catch (Exception ex)
                {
                    LittleWatson.ReportException(ex, string.Format("Opening video for lecture '{0}' of course '{1}' ({2})", lecture.Title, pivot.Title, videoUrl));
                    LittleWatson.CheckForPreviousException(false);
                }
            },
                    () => false,
                    null),
                false,
                null,
                _ => videoLazyBlock = null,
                null);
        }
Example #2
0
 private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
 {
     LittleWatson.ReportException(e.Exception, "NavigationFailed: " + e.Uri);
 }
Example #3
0
 public void OnException(string message, Exception e)
 {
     LittleWatson.ReportException(e, message);
     LittleWatson.CheckForPreviousException(false);
 }