public StudentPackBlockPreview(UserGroup userGroup, IViewNavigateService navigateService)
        {
            _navigateService = navigateService;
            InitializeComponent();
            _userGroup = userGroup;

            foreach (ProblemsPack pack in userGroup.ProblemsPacks)
            {
                var taskPreview = new ProblemTasksPreview(_userGroup, pack.Title, _navigateService);
                PackListPanel.Children.Add(taskPreview);
                PanelViewer.ScrollToRightEnd();
            }
        }
Esempio n. 2
0
        private void ButtonAddPack(object sender, RoutedEventArgs e)
        {
            if (IsUpdPack)
            {
                DataProvider.ProblemsPackRepository.Update(Group.Title, CreatePack());
                PanelViewer.ScrollToRightEnd();
                Close();
            }
            else
            {
                var pack = CreatePack();
                Group.ProblemsPacks.Add(pack);
                DataProvider.ProblemsPackRepository.Create(Group.Title, new ProblemsPack(PackTitle, pack.Problems));

                PanelViewer.ScrollToRightEnd();
                Close();
            }
        }