Esempio n. 1
0
        public DiagramViewModel(
            [NotNull] IModelEventSource modelEventSource,
            [NotNull] IDiagramEventSource diagramEventSource,
            [NotNull] IDiagramViewportUi diagramViewportUi,
            [NotNull] IRelatedNodeItemViewModelFactory relatedNodeItemViewModelFactory,
            [NotNull] IComparer <IModelNode> modelNodeComparer)
            : base(modelEventSource, diagramEventSource)
        {
            _relatedNodeItemViewModelFactory = relatedNodeItemViewModelFactory;
            _modelNodeComparer       = modelNodeComparer;
            DiagramViewportViewModel = (DiagramViewportViewModel)diagramViewportUi;

            RelatedNodeListBoxViewModel = new RelatedNodeListBoxViewModel(ModelEventSource, DiagramEventSource);
            RelatedNodeListBoxViewModel.ItemSelected            += OnRelatedNodeSelected;
            RelatedNodeListBoxViewModel.Items.CollectionChanged += OnRelatedNodeCollectionChanged;

            PopupTextViewModel = new AutoHidePopupTextViewModel();

            PreviewMouseDownCommand = new DelegateCommand(OnAnyMouseDownEvent);
            MouseDownCommand        = new DelegateCommand(OnUnhandledMouseDownEvent);

            DiagramEventSource.DiagramChanged += OnDiagramChanged;

            SubscribeToViewportEvents();

            _lastDiagram = DiagramEventSource.LatestDiagram;
        }
 public RoslynDiagramViewModel(
     [NotNull] IModelEventSource modelEventSource,
     [NotNull] IDiagramEventSource diagramEventSource,
     [NotNull] IDiagramViewportUi diagramViewportUi)
     : base(modelEventSource, diagramEventSource, diagramViewportUi)
 {
     _roslynDiagramViewportViewModel = (RoslynDiagramViewportViewModel)diagramViewportUi;
 }
Esempio n. 3
0
 public RoslynDiagramViewModel(
     [NotNull] IModelEventSource modelEventSource,
     [NotNull] IDiagramEventSource diagramEventSource,
     [NotNull] IDiagramViewportUi diagramViewportUi,
     [NotNull] IRelatedNodeItemViewModelFactory relatedNodeItemViewModelFactory,
     [NotNull] IComparer <IModelNode> modelNodeComparer)
     : base(modelEventSource, diagramEventSource, diagramViewportUi, relatedNodeItemViewModelFactory, modelNodeComparer)
 {
     _roslynDiagramViewportViewModel = (RoslynDiagramViewportViewModel)diagramViewportUi;
 }