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);
        }
Example #2
0
        public ShellViewModel(IEventAggregator eventAggregator, SessionData sessionData)
            : this()
        {
            this.eventAggregator = eventAggregator;
            this.sessionData     = sessionData;

            eventAggregator.GetEvent <StartWorkingEvent>().Subscribe(OnStartWorking);
            eventAggregator.GetEvent <StopWorkingEvent>().Subscribe(OnStopWorking);
            sessionData.AddListener(this, () => sessionData.SketchName);
        }
Example #3
0
 private void SetupSessionDataSync()
 {
     sessionData.AddListener(this, () => sessionData.SketchObjects);
 }