Esempio n. 1
0
        public ViewModel()
        {
            m_genderFilterOptions = new string[] { "All", "Male", "Female" };

            m_archive = new Archive("students.xml");

            IEnumerable<Student> initStudents = m_archive.Load();
            m_students = initStudents == null ?
                new ObservableCollection<Student>() : new ObservableCollection<Student>(initStudents);

            m_view = CollectionViewSource.GetDefaultView(m_students);

            m_saveCommand = new SaveCommand(this);
            m_removeCommand = new RemoveCommand(this);

            this.CurrentSelectGender = "All";
        }
Esempio n. 2
0
        // *************************************************************** //
        #region [ constructor ]

        public ViewModel()
        {
            m_genderFilterOptions = new string[] { "All", "Male", "Female" };

            m_archive = new Archive("students.xml");

            IEnumerable <Student> initStudents = m_archive.Load();

            m_students = initStudents == null ?
                         new ObservableCollection <Student>() : new ObservableCollection <Student>(initStudents);

            m_view = CollectionViewSource.GetDefaultView(m_students);

            m_saveCommand   = new SaveCommand(this);
            m_removeCommand = new RemoveCommand(this);

            this.CurrentSelectGender = "All";
        }