Beispiel #1
0
        /// <summary>
        /// Constuctor which initializes component on page (each category on seperate page).
        /// </summary>
        /// <param name="category">Contains information about category (e.g. category ID, suvery ID, etc.)</param>
        public CategoryPivotItem(Category category)
        {
            _category = category;
            if (_category is NormalCategory)
            {
                CategoryControl         categoryControl         = new CategoryControl();
                NormalCategoryViewModel normalCategoryViewModel = new NormalCategoryViewModel(((NormalCategory)_category));
                normalCategoryViewModel.AddQuestionsToListBox(categoryControl.QuestionsList);

                Header  = ((NormalCategory)_category).Name;
                Content = categoryControl;
            }
            else if (_category is ConditionCategory)
            {
                ConditionCategoryControl categoryControl = new ConditionCategoryControl();

                categoryControl.DataContext = new ConditionCategoryControlViewModel((ConditionCategory)_category);

                Header  = category.Name;
                Content = categoryControl;
            }
        }
        /// <summary>
        /// Constuctor which initializes component on page (each category on seperate page).
        /// </summary>
        /// <param name="category">Contains information about category (e.g. category ID, suvery ID, etc.)</param>
        public CategoryPivotItem(Category category)
        {
            _category = category;
            if (_category is NormalCategory)
            {
                CategoryControl categoryControl = new CategoryControl();
                NormalCategoryViewModel normalCategoryViewModel = new NormalCategoryViewModel(((NormalCategory)_category));
                normalCategoryViewModel.AddQuestionsToListBox(categoryControl.QuestionsList);

                Header = ((NormalCategory)_category).Name;
                Content = categoryControl;
            }
            else if (_category is ConditionCategory)
            {
                ConditionCategoryControl categoryControl = new ConditionCategoryControl();

                categoryControl.DataContext = new ConditionCategoryControlViewModel((ConditionCategory)_category);

                Header = category.Name;
                Content = categoryControl;
            }
        }