示例#1
0
        public MainVM(IProject project, LibManager libManager, SetupData setup)
        {
            this.project    = project;
            this.libManager = libManager;
            this.setup      = setup;

            projecTabVM    = new ProjectTabVM(project, libManager, setup);
            setupTabVM     = new SetupTabVM(project, setup);
            librariesTabVM = new LibrariesTabVM(project, libManager, setup);

            cmdFileOpen = new RelayCommand(doFileOpen);
            cmdFileNew  = new RelayCommand(doFileNew);
            cmdClose    = new RelayCommand(doClose);

            setupTabVM.PropertyChanged += (s, e) =>
            {
                projecTabVM.updateAll();
                projecTabVM.OnPropertyChanged("");
            };

            mruList = new ObservableCollection <MruItemVM>();
            foreach (var prj in setup.mru.projects)
            {
                mruList.Add(new MruItemVM(prj, this));
            }
            //var mruList = setup.mru.projects?.Select(p => new MruItemVM(p, this));
            //if(mruList != null)  mruList = new ObservableCollection<MruItemVM>(mruList);
        }
示例#2
0
        public MainVM(IProject project, LibManager libManager, SetupData setup)
        {
            this.project    = project;
            this.libManager = libManager;
            this.setup      = setup;

            projecTabVM    = new ProjectTabVM(project, libManager, setup);
            setupTabVM     = new SetupTabVM(project, setup);
            librariesTabVM = new LibrariesTabVM(project, libManager);

            cmdFileOpen = new RelayCommand(doFileOpen);
            cmdFileNew  = new RelayCommand(doFileNew);
            cmdClose    = new RelayCommand(doClose);

            setupTabVM.PropertyChanged += (s, e) =>
            {
                projecTabVM.updateFiles();
                projecTabVM.OnPropertyChanged("");
            };
        }