Exemplo n.º 1
0
        private bool OnPageIndexReceived(Event ev)
        {
            if (!(IsStudent && LessonExists))
            {
                return(true);
            }

            Lesson lesson = null;

            Application.Current.Dispatcher.BeginInvoke(
                new Action(
                    () =>
            {
                lesson = (MainPage.LessonPage.DataContext as Lesson);
                lesson.TeacherPageIndex = (int)ev.get <int>();

                // If the receiver is ok to switch slide, we update his current page
                if (lesson.IsSync.HasValue && lesson.IsSync.Value && Catalog.CurrentPageName != "QuestionsPage")
                {
                    lesson.ChangeCurrentPage(lesson.TeacherPageIndex);
                }
            }
                    ),
                DispatcherPriority.Normal
                );

            return(true);
        }