Example #1
0
 public RiserVM(TECBid bid, ChangeWatcher watcher)
 {
     this.bid     = bid;
     this.watcher = new ScopeWatcherFilter(watcher);
     this.watcher.ScopeChanged += changed;
     populateBidLocations(bid);
     AddLocationCommand = new RelayCommand(addLocationExecute, canAddLocation);
     AddPatternCommand  = new RelayCommand(addPatternExecute, canAddPattern);
     PropertiesVM       = new PropertiesVM(bid.Catalogs, bid);
     DeleteCommand      = new RelayCommand <LocationContainer>(deleteLocationExecute, canDeleteLocation);
 }
Example #2
0
        //Initializer
        public ScopeEditorVM(TECBid bid, ChangeWatcher watcher)
        {
            Bid = bid;

            ScopeCollection              = new ScopeCollectionsTabVM(Bid);
            ScopeCollection.DragHandler += DragOver;
            ScopeCollection.DropHandler += Drop;

            setupControllersPanelsTab();
            setupMiscVM();
            TypicalEditVM           = new SystemHierarchyVM(bid, true);
            TypicalEditVM.Selected += item =>
            {
                Selected = item;
            };
            InstanceEditVM           = new TypicalHierarchyVM(bid, watcher);
            InstanceEditVM.Selected += item => {
                Selected = item;
            };
            PropertiesVM  = new PropertiesVM(bid.Catalogs, bid);
            WorkBoxVM     = new WorkBoxVM(bid);
            ConnectionsVM = new ConnectionsVM(bid, watcher, bid.Catalogs, locations: bid.Locations, filterPredicate: filterPredicate);

            bool filterPredicate(ITECObject obj)
            {
                if (obj is ITypicalable typable)
                {
                    return(typable is TECTypical || !typable.IsTypical);
                }
                else if (obj is TECScopeTemplates || obj is TECCatalogs)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }

            ConnectionsVM.Selected += item =>
            {
                Selected = item;
            };
            DGTabIndex          = GridIndex.Systems;
            TemplatesVisibility = Visibility.Visible;
        }