Пример #1
0
 protected void SetPropertiesForImageExport([NotNull] DiagramNodeViewModel clone)
 {
     // For image export we must set those properties that are calculated on the normal UI.
     clone._size            = _size;
     clone._payloadAreaSize = _payloadAreaSize;
     clone._center          = _center;
     clone._topLeft         = _topLeft;
 }
        private void OnRemoveDiagramNodeRequested(DiagramNodeViewModel diagramNodeViewModel)
        {
            DiagramViewportViewModel.StopFollowingDiagramNodes();
            if (RelatedNodeListBoxViewModel.OwnerDiagramShape == diagramNodeViewModel)
            {
                HideRelatedNodeListBox();
            }

            RemoveDiagramNodeRequested?.Invoke(diagramNodeViewModel.DiagramNode);
        }
        public DiagramConnectorViewModel(IModelService modelService, IDiagramService diagramService,
                                         IDiagramConnector diagramConnector, DiagramNodeViewModel sourceNodeViewModel, DiagramNodeViewModel targetNodeViewModel)
            : base(modelService, diagramService, diagramConnector)
        {
            _routePoints = diagramConnector.Route.ToWpf();

            SourceNodeViewModel = sourceNodeViewModel;
            TargetNodeViewModel = targetNodeViewModel;

            DiagramService.DiagramChanged += OnDiagramChanged;
        }
Пример #4
0
        public override object CloneForImageExport()
        {
            var clone = new DiagramNodeViewModel(
                ModelService,
                DiagramService,
                RelatedNodeTypeProvider,
                FocusTracker,
                DiagramNode);

            SetPropertiesForImageExport(clone);

            return(clone);
        }
        public DiagramConnectorViewModel(IArrangedDiagram diagram, IDiagramConnector diagramConnector,
                                         DiagramNodeViewModel sourceNodeViewModel, DiagramNodeViewModel targetNodeViewModel)
            : base(diagram, diagramConnector)
        {
            DiagramConnector    = diagramConnector;
            SourceNodeViewModel = sourceNodeViewModel;
            TargetNodeViewModel = targetNodeViewModel;

            _connectorType = Diagram.GetConnectorType(diagramConnector.Type);
            _routePoints   = RouteToWpf(diagramConnector.RoutePoints);

            DiagramConnector.RouteChanged += OnRouteChanged;
        }
Пример #6
0
 private void SetPropertiesForImageExport([NotNull] DiagramNodeViewModel clone)
 {
     // For image export we must set those properties that are calculated on the normal UI.
     clone._headerSize = _headerSize;
 }
Пример #7
0
 public override void AssociateWith(DiagramNodeViewModel diagramNodeViewModel)
 {
     base.AssociateWith(diagramNodeViewModel);
     UpdateEnabledState();
 }
 private bool TryGetDiagramNodeViewModel(ModelNodeId modelNodeId, out DiagramNodeViewModel viewModel)
 => _diagramNodeToViewModelMap.TryGet(modelNodeId, out viewModel);