public SketchViewModel(
            IUnityContainer container,
            IEventAggregator eventAggregator,
            UiState uiState,
            SessionData sessionData,
            ISnapper snapper,
            IClassificationInference classificationInference,
            IUndoHistory undoHistory)
        {
            this.uiState                 = uiState;
            this.sessionData             = sessionData;
            this.eventAggregator         = eventAggregator;
            this.snapper                 = snapper;
            this.classificationInference = classificationInference;
            this.undoHistory             = undoHistory;

            uiState.AddListener(this, () => uiState.SketchPlane);
            sessionData.AddListener(this, () => sessionData.SketchName);

            NewPrimitives = sessionData.NewPrimitives;

            SketchModellingViewModel = container.Resolve <SketchModellingViewModel>();
            SketchImageViewModel     = container.Resolve <SketchImageViewModel>();

            eventAggregator.GetEvent <MarkFeatureEvent>().Subscribe(MarkFeatureHandler);
            eventAggregator.GetEvent <MarkSilhouetteEvent>().Subscribe(MarkSilhouetteHandler);
        }
Exemple #2
0
        public SketchLoader(IEventAggregator eventAggregator,
                            ISketchCatalog sketchCatalog,
                            IClassificationInference classificationInference,
                            IUndoHistory undoHistory,
                            SessionData sessionData,
                            UiState uiState)
        {
            this.eventAggregator         = eventAggregator;
            this.sketchCatalog           = sketchCatalog;
            this.classificationInference = classificationInference;
            this.undoHistory             = undoHistory;
            this.sessionData             = sessionData;
            this.uiState = uiState;

            eventAggregator.GetEvent <LoadSketchEvent>().Subscribe(OnLoadSketch);
        }
 public UndoHistoryService(SessionData sessionData, IClassificationInference classificationInference)
 {
     this.sessionData             = sessionData;
     this.classificationInference = classificationInference;
     this.undoStack = new SerializingMemoryUndoStack();
 }