private void AddChoice(IChoice choice = null)
        {
            if (choice == null)
            {
                choice = Factory.CreateChoice();
                choice.ChoiceLetter = lastChoiceLetter++;

                quastionSlide.Choices.Add(choice);
            }

            IChoiceEditor choiceEditor = choice.OnEditorGUI();

            choiceEditor.Initailize(Presentation, choice, quastionSlide.CorrectChoice);
            choiceEditor.SetChoiceStyle(Resource.GetChoiceColors()[row]);

            ChoiceEditors.Add(choiceEditor);

            choiceEditor.OnChoiceSelected += ChoiceEditor_OnChoiceSelected;

            var choiceEditorControl = (Control)choiceEditor;

            choiceEditorControl.Margin = new Thickness(0, 0, 0, 25);

            //Add To grid
            SlideChoiceGrid.Children.Add(choiceEditorControl);
            Grid.SetRow(choiceEditorControl, row);
            row++;

            SlideUpdated?.Invoke(this, EventArgs.Empty);
        }
        private void SlideImage_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            var command = new ReadImageToPresentationCommand();

            Action <IImageReader> action = (imageReader) => {
                quastionSlide.Image = imageReader.ImageName;
                SlideImage.Source   = imageReader.Image;
            };

            command.Execute(Presentation, action);

            SlideUpdated?.Invoke(this, EventArgs.Empty);
        }
Example #3
0
        private void SlideImage_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            var command = new ReadImageToPresentationCommand();

            void action(IImageReader imageReader)
            {
                slide.Image       = imageReader.ImageName;
                SlideImage.Source = imageReader.Image;
            }

            command.Execute(presentation, action);

            SlideUpdated?.Invoke(this, EventArgs.Empty);
        }