Ejemplo n.º 1
0
        public void Execute(IWindowManager windowManager, IQuestionDialog questionDialog)
        {
            var question = new Question(
                null,
                Text,
                _possibleAnswers
                );

            questionDialog.Setup(
                Caption,
                new[] {question}
                );

            questionDialog.WasShutdown += delegate{
                if(_handleResult != null)
                    _handleResult(question.Answer);
                else if(question.Answer == Answer.No || question.Answer == Answer.Cancel)
                {
                    Completed(this, new CancelResult());
                    return;
                }

                Completed(this, null);
            };

            windowManager.ShowDialog(questionDialog, null, null);
        }
        public void Initialize(AcceptCancelDialog control)
        {
            var title = RandomData.LoremIpsum(5, 8);
            var text = RandomData.LoremIpsum(10, 80);

            InitializeDialog(
                control, 
                () => DialogViewModel.QuestionDialog(title, text));

            questionDialog = ContentViewModel as IQuestionDialog;
            questionDialog.Show();
        }