Exemple #1
0
        public void LoadModel(SectionModel[] sectionModels)
        {
            Items.Clear();

            if (sectionModels == null)
            {
                return;
            }

            foreach (var sectionModel in sectionModels)
            {
                var section = new SubSectionEntryViewModel(this);
                section.LoadModel(sectionModel);
                Items.Add(section);
            }
        }
Exemple #2
0
        private void DoMoveSectionDown(SubSectionEntryViewModel section)
        {
            var index = Items.IndexOf(section);

            Items.Move(index, index + 1);
        }
Exemple #3
0
        private bool CanMoveSectionDown(SubSectionEntryViewModel section)
        {
            var index = Items.IndexOf(section);

            return(index < Items.Count - 1);
        }
Exemple #4
0
        private bool CanMoveSectionUp(SubSectionEntryViewModel section)
        {
            var index = Items.IndexOf(section);

            return(index > 0);
        }
Exemple #5
0
 private void DoRemoveSection(SubSectionEntryViewModel section)
 {
     Items.Remove(section);
 }