protected override Task OnInitializedAsync()
        {
            question = new QuestionManagerModel
            {
                QuestionType = QuestionType,
                State        = Utility.QuestionState.Question
            };

            // set default options
            if (string.IsNullOrEmpty(QuestionId))
            {
                question.Options.AddRange(new List <QuestionManagerOptionsModel> {
                    new QuestionManagerOptionsModel {
                        IsDefault = true, TemporaryId = 1, Text = "choice #1"
                    },
                    new QuestionManagerOptionsModel {
                        IsDefault = true, TemporaryId = 2, Text = "choice #2"
                    },
                    new QuestionManagerOptionsModel {
                        IsDefault = true, TemporaryId = 3, Text = "choice #3"
                    }
                });
            }

            return(base.OnInitializedAsync());
        }
示例#2
0
 public static QuestionItem Map(this QuestionManagerModel model)
 {
     return(new QuestionItem {
     });
 }
 private async Task HandleSubmit(QuestionManagerModel question)
 {
     await OnSubmitCallBack.InvokeAsync(question);
 }
示例#4
0
        public async Task HandleSubmit(QuestionManagerModel question)
        {
            var model = question.Map();

            await OnSubmitCallBack.InvokeAsync(model);
        }