public CoursesListViewModel()
        {
            /*AddCourseCommand*/
            AddCourseCommand = new RelayCommand <string[]>(AddMoreOne, CheckToAddCourse);

            RemoveCourseCommand = new RelayCommand <CourseItemViewModel>(RemoveCourse);

            r_CourseCheck = new CourseItemViewModel();

            SaveCommand = new RelayCommand(Save);

            CalAverage = new CalculateAvg();

            Items = new ObservableCollection <CourseItemViewModel>();
            var toAdd = new CourseItemViewModel()
            {
                CourseName = "Fore to see long text input.", Mark = 77, Points = 2f, Year = 2, Semester = eSemester.C
            };


            toAdd = new CourseItemViewModel()
            {
                CourseName = "One for me", Mark = 96, Points = 2, Year = 2, Semester = eSemester.B
            };
            Items.Add(toAdd);
            CalAverage.AddMarkAndPoints(toAdd.Mark, toAdd.Points);


            toAdd = new CourseItemViewModel()
            {
                CourseName = "Two for you :)", Mark = 81, Points = 4.5f, Year = 1, Semester = eSemester.A
            };
            Items.Add(toAdd);
            CalAverage.AddMarkAndPoints(toAdd.Mark, toAdd.Points);


            toAdd = new CourseItemViewModel()
            {
                CourseName = "Third is here ", Mark = 83, Points = 3.5f, Year = 3, Semester = eSemester.A
            };
            Items.Add(toAdd);
            CalAverage.AddMarkAndPoints(toAdd.Mark, toAdd.Points);


            toAdd = new CourseItemViewModel()
            {
                CourseName = "Fore to see long text input.", Mark = 77, Points = 2f, Year = 2, Semester = eSemester.C
            };
            Items.Add(toAdd);
            CalAverage.AddMarkAndPoints(toAdd.Mark, toAdd.Points);



            bool testingSave = false;
            //if (testingSave)
            //{
            //    try
            //    {

            //        foreach (CourseItemViewModel item in Items)
            //        {
            //            CalAverage.SubstractMarkAndPoints(item.Mark, item.Points);
            //        }

            //        Items = StaticSaverTest.DataMeneger.LoadData();

            //        // Items.Sum(x => x.Points).Select(n => new { TotalMark = n.Mark, TotalPoints = n.Points });

            //        var sums = Items.GroupBy(q => 1)
            //        .Select(g => new
            //        {
            //            TotalMark = g.Sum(q => q.Mark),
            //            TotalPoint = g.Sum(q => q.Points),
            //            // etc etc
            //        })
            //        .Single();

            //        //CalAverage.AddMarkAndPoints(sums.TotalMark,sums.TotalPoint);

            //        foreach (CourseItemViewModel item in Items)
            //        {
            //            CalAverage.AddMarkAndPoints(item.Mark, item.Points);
            //        }


            //        //StaticSaverTest.DataMeneger.SaveData(Items);
            //    }
            //    catch (Exception ex)
            //    {

            //    }
            //}
        }
 public void RemoveCourse(CourseItemViewModel i_ToDelete)
 {
     // BM : To remember to delete from the total Average
     Items.Remove(i_ToDelete);
     CalAverage.SubstractMarkAndPoints(i_ToDelete.Mark, i_ToDelete.Points);
 }