public AssignmentViewModel(List<Group> groups)
        {
            _groups = groups;

            GroupsForCombobox = new ObservableCollection<ComboBoxGroupPair>();
            foreach (var group in groups)
            {
                GroupsForCombobox.Add(new ComboBoxGroupPair() {
                    GroupObject = group ,
                    GroupString =
                        group.Index + ". " +
                        PrettyFormatter.dayFormatter(Convert.ToInt32(group.Course.Day_of_week)) + " " +
                        group.Course.Starting_time + " " +
                        PrettyFormatter.parityFormatter(group.Course.Week_parity) + " " +
                        "(" + group.Room.Name + ")"
                });
            }

            StudentsForDatagrid = new ObservableCollection<Student>();
            TargetGroupPairs = new ObservableCollection<ComboBoxGroupPair>();

            _assignmentWindow = new AssignmentWindow();
            _assignmentWindow.DataContext = this;
            _assignmentWindow.ShowDialog();
        }
        public AssignmentViewModel(List <Group> groups)
        {
            _groups = groups;

            GroupsForCombobox = new ObservableCollection <ComboBoxGroupPair>();
            foreach (var group in groups)
            {
                GroupsForCombobox.Add(new ComboBoxGroupPair()
                {
                    GroupObject = group,
                    GroupString =
                        group.Index + ". " +
                        PrettyFormatter.dayFormatter(Convert.ToInt32(group.Course.Day_of_week)) + " " +
                        group.Course.Starting_time + " " +
                        PrettyFormatter.parityFormatter(group.Course.Week_parity) + " " +
                        "(" + group.Room.Name + ")"
                });
            }

            StudentsForDatagrid = new ObservableCollection <Student>();
            TargetGroupPairs    = new ObservableCollection <ComboBoxGroupPair>();

            _assignmentWindow             = new AssignmentWindow();
            _assignmentWindow.DataContext = this;
            _assignmentWindow.ShowDialog();
        }
예제 #3
0
        private void Participation_List_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            string     assignment        = Participation_List.SelectedItem.ToString();
            Assignment currentAssignment = totalAssignments.First(item => item.Name.Equals(assignment));

            AssignWin = new AssignmentWindow(currentAssignment, this);
            Hide();
            AssignWin.Show();
        }
예제 #4
0
        private void GlobalPopulate(MainWindow main, string AccessToken, string username)
        {
            #region setting variables
            this.MainView    = main;
            this.AccessToken = AccessToken;
            this.User        = username;
            StudentInfoHandler.ACCESS_TOKEN = this.AccessToken;
            NotificationLogic.ACCESS_TOKEN  = this.AccessToken;
            #endregion

            InitializeComponent();

            #region notification Setup
            ResizeMainWindowToOriginal();
            notifyDev          = new NotificationDevelopment();
            notifyDev.MainView = this.MainView;
            notifyDev.NotificationSetup();
            #endregion

            #region Important windows
            DE         = new DistractionEliminator(this);
            assignment = new AssignmentWindow();
            #endregion

            #region Timers
            notifyTimer = new NotificationTimer(this);
            notifyTimer.StartTimer();
            NotificationLogic.currentList = currentAssignmentsJson;

            MasterCalendar.IsTodayHighlighted = true;
            #endregion
            //Methods of importance
            #region API Data setup
            Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(async() =>
            {
                await RetrieveData();
                ConvertJsonToObservable();
                CalendarAssignmentDate();
                PopulateClassComboBox();
            }));

            //ProcessRing.IsActive = false;
            OnStartUp = false;
            #endregion
        }