Example #1
0
        public ImportOptionWindowVM(DDIImportOption importOption)
        {
            menuItems = new ObservableCollection <CheckMenuItemVM>();

            CheckMenuItemVM curCategory = null;

            foreach (MenuElem elem in importOption.MenuElems)
            {
                CheckMenuItemVM menuItem = null;
                if (elem.IsCategory)
                {
                    menuItem = new CheckMenuItemVM(elem);
                    menuItems.Add(menuItem);
                    curCategory = menuItem;
                }
                else
                {
                    menuItem = new CheckMenuItemVM(elem);
                    curCategory.Add(menuItem);
                }
                menuItem.UpdateSelfCheckedStatus(true);
            }

            List <CheckMenuItemVM> leafMenuItems = LeafMenuItems;

            foreach (CheckMenuItemVM menuItem in leafMenuItems)
            {
                List <CheckMenuItemVM> relatedMenuItems = CheckMenuItemVM.FindByMenuElems(leafMenuItems, importOption.GetRelatedMenuElems(menuItem.MenuElem));
                menuItem.RelatedMenuItems.AddRange(relatedMenuItems);
            }
        }
        public SelectStudyUnitWindow(SelectStudyUnitWindowVM viewModel)
        {
            InitializeComponent();
            this.viewModel   = viewModel;
            viewModel.Window = this;
            DataContext      = viewModel;

            DDIImportOption importOption = viewModel.ImportOption;

            if (!importOption.CanSelectFromStudyUnit)
            {
                grid.RowDefinitions[0].Height = new GridLength(0);
            }
        }
Example #3
0
        public SelectStudyUnitWindowVM(EDOModel fromModel, EDOModel toModel, StudyUnit curStudyUnit, DDIImportOption importOption)
        {
            this.fromModel     = fromModel;
            this.toModel       = toModel;
            fromStudyUnits     = new ObservableCollection <StudyUnit>(fromModel.StudyUnits);
            this.FromStudyUnit = fromModel.StudyUnits.FirstOrDefault();
            toStudyUnits       = new ObservableCollection <StudyUnit>(toModel.StudyUnits);
            this.ToStudyUnit   = curStudyUnit;

            this.importOption = importOption;
        }