public EditConversation() { SlideIndex = new SlideIndexConverter(activeSlideList); UrlForSlide = new UrlForSlideConverter(); InitializeComponent(); activeSlides.ItemsSource = activeSlideList; loadConversation(Globals.conversationDetails.Slides); }
public SlideDisplay() { refresher = new DispatcherTimer(); refresher.Interval = new TimeSpan(0, 0, 5); refresher.Tick += new EventHandler(refresherTick); refresher.Start(); thumbnailList = new ObservableCollection<Slide>(); thumbnailList.CollectionChanged += OnThumbnailCollectionChanged; SlideIndex = new SlideIndexConverter(thumbnailList); myMaxSlideIndex = -1; TeachersCurrentSlideIndex = -1; IsNavigationLocked = calculateNavigationLocked(); InitializeComponent(); DataContext = this; slides.PreviewKeyDown += new KeyEventHandler(KeyPressed); Commands.SyncedMoveRequested.RegisterCommand(new DelegateCommand<int>(MoveToTeacher)); Commands.MoveTo.RegisterCommand(new DelegateCommand<Location>((loc) => MoveTo(loc, true), (loc) => slideInConversation(loc))); //Commands.ForcePageRefresh.RegisterCommand(new DelegateCommand<int>((slideIndex) => MoveTo(slideIndex, true), slideInConversation)); Commands.UpdateConversationDetails.RegisterCommand(new DelegateCommand<ConversationDetails>(Display)); Commands.AddSlide.RegisterCommand(new DelegateCommand<object>(addSlide, canAddSlide)); Commands.MoveToNext.RegisterCommand(new DelegateCommand<object>(moveToNext, isNext)); Commands.MoveToPrevious.RegisterCommand(new DelegateCommand<object>(moveToPrevious, isPrevious)); Commands.JoinConversation.RegisterCommand(new DelegateCommand<ConversationDetails>(JoinConversation)); Commands.ReceiveTeacherStatus.RegisterCommand(new DelegateCommand<TeacherStatus>(receivedStatus, (_unused) => { return StateHelper.mustBeInConversation(); })); Commands.EditConversation.RegisterCommand(new DelegateCommand<object>(EditConversation)); Commands.UpdateNewSlideOrder.RegisterCommand(new DelegateCommand<int>(reorderSlides)); Commands.LeaveLocation.RegisterCommand(new DelegateCommand<object>(resetLocationLocals)); var paste = new CompositeCommand(); paste.RegisterCommand(new DelegateCommand<object>(HandlePaste)); slides.InputBindings.Add(new KeyBinding(paste, Key.V, ModifierKeys.Control)); InputBindings.Add(new KeyBinding(paste, Key.V, ModifierKeys.Control)); }