Esempio n. 1
0
        public QuestionPageViewModel(int questionId, IApplicationViewModel application = null, INetworkApi networkApi = null)
            : base(application)
        {
            NetworkApi    = networkApi ?? Api <INetworkApi>();
            LoadAnswers   = ReactiveCommand.CreateFromTask(LoadAnswersImpl, outputScheduler: RxApp.MainThreadScheduler);
            LoadQuestions = ReactiveCommand.CreateFromTask(LoadQuestionsImpl, outputScheduler: RxApp.MainThreadScheduler);
            Load          = ReactiveCommand.CreateCombined(new[] { LoadQuestions, LoadAnswers });

            Question = new QuestionDetailViewModel(questionId);
        }
Esempio n. 2
0
        private async Task LoadQuestionsImpl()
        {
            var result = await NetworkApi.QuestionWithDetail(Question.Id, Application.CurrentSite);

            Question = new QuestionDetailViewModel(result.Items.First());
        }