public CloseMiniButtonViewModel( IModelEventSource modelEventSource, IDiagramEventSource diagramEventSource) : base(modelEventSource, diagramEventSource, "Remove") { IsEnabled = true; }
private ViewportCalculatorViewModel( IModelEventSource modelEventSource, IDiagramEventSource diagramEventSource, double minZoom, double maxZoom, double initialZoom, Size sizeInScreenSpace, Point centerInDiagramSpace) : base(modelEventSource, diagramEventSource) { _minZoom = minZoom; _maxZoom = maxZoom; _defaultExponentialZoom = initialZoom; _exponentialZoom = initialZoom; _sizeInScreenSpace = sizeInScreenSpace; _centerInDiagramSpace = centerInDiagramSpace; _diagramContentRect = diagramEventSource.LatestDiagram.Rect.ToWpf(); ResizeCommand = new ResizeDelegateCommand(Resize); PanCommand = new PanDelegateCommand(Pan); ZoomToContentCommand = new ZoomToContentDelegateCommand(ZoomToContent); ZoomCommand = new ZoomDelegateCommand(ZoomWithCenterTo); UpdateCalculatedProperties(TransitionSpeed.Instant); DiagramEventSource.DiagramChanged += OnDiagramChanged; }
public DiagramViewportViewModel( [NotNull] IModelEventSource modelEventSource, [NotNull] IDiagramEventSource diagramEventSource, [NotNull] IDiagramShapeUiFactory diagramShapeUiFactory, [NotNull] IDecorationManager <IMiniButton, IDiagramShapeUi> miniButtonManager, double minZoom, double maxZoom, double initialZoom) : base(modelEventSource, diagramEventSource) { MinZoom = minZoom; MaxZoom = maxZoom; _diagramNodeToViewModelMap = new Map <ModelNodeId, DiagramNodeViewModel>(); _diagramConnectorToViewModelMap = new Map <ModelRelationshipId, DiagramConnectorViewModel>(); DiagramShapeUiFactory = diagramShapeUiFactory; MiniButtonPanelViewModel = (MiniButtonPanelViewModel)miniButtonManager; ViewportCalculator = new AutoMoveViewportViewModel(modelEventSource, diagramEventSource, minZoom, maxZoom, initialZoom); DiagramNodeViewModels = new ThreadSafeObservableCollection <DiagramNodeViewModel>(); DiagramConnectorViewModels = new ThreadSafeObservableCollection <DiagramConnectorViewModel>(); DiagramNodeDoubleClickedCommand = new DelegateCommand <IDiagramNode>(i => DiagramNodeInvoked?.Invoke(i)); ViewportCalculator.TransformChanged += OnViewportTransformChanged; DiagramEventSource.DiagramChanged += OnDiagramChanged; AddDiagram(diagramEventSource.LatestDiagram); }
protected DiagramShapeDecoratorViewModelBase( IModelEventSource modelEventSource, IDiagramEventSource diagramEventSource) : base(modelEventSource, diagramEventSource) { _isVisible = false; }
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; }
protected ModelObserverViewModelBase( [NotNull] IModelEventSource modelEventSource, [NotNull] IDiagramEventSource diagramEventSource) { ModelEventSource = modelEventSource; DiagramEventSource = diagramEventSource; }
protected DiagramShapeViewModelBase( [NotNull] IModelEventSource modelEventSource, [NotNull] IDiagramEventSource diagramEventSource, [NotNull] IDiagramShape diagramShape) : base(modelEventSource, diagramEventSource) { SetDiagramShapeProperties(diagramShape); }
public DiagramConnectorViewModel( IModelEventSource modelEventSource, IDiagramEventSource diagramEventSource, [NotNull] IDiagramConnector diagramConnector) : base(modelEventSource, diagramEventSource, diagramConnector) { SetDiagramConnectorProperties(diagramConnector); }
public RoslynDiagramViewModel( [NotNull] IModelEventSource modelEventSource, [NotNull] IDiagramEventSource diagramEventSource, [NotNull] IDiagramViewportUi diagramViewportUi) : base(modelEventSource, diagramEventSource, diagramViewportUi) { _roslynDiagramViewportViewModel = (RoslynDiagramViewportViewModel)diagramViewportUi; }
public DiagramShapeViewModelFactory( [NotNull] IModelEventSource modelEventSource, [NotNull] IDiagramEventSource diagramEventSource, [NotNull] IRelatedNodeTypeProvider relatedNodeTypeProvider) { ModelEventSource = modelEventSource; DiagramEventSource = diagramEventSource; RelatedNodeTypeProvider = relatedNodeTypeProvider; }
public ViewportCalculatorViewModel( IModelEventSource modelEventSource, IDiagramEventSource diagramEventSource, double minZoom, double maxZoom, double initialZoom) : this(modelEventSource, diagramEventSource, minZoom, maxZoom, initialZoom, ViewportSizeDefault, ViewportCenterDefault) { }
public MiniButtonViewModelFactory( [NotNull] IModelEventSource modelEventSource, [NotNull] IDiagramEventSource diagramEventSource, [NotNull] IRelatedNodeTypeProvider relatedNodeTypeProvider) { _modelEventSource = modelEventSource; _diagramEventSource = diagramEventSource; _relatedNodeTypeProvider = relatedNodeTypeProvider; }
public RelatedNodeListBoxViewModel( [NotNull] IModelEventSource modelEventSource, [NotNull] IDiagramEventSource diagramEventSource) { _modelEventSource = modelEventSource; _diagramEventSource = diagramEventSource; _modelEventSource.ModelChanged += OnModelChanged; _diagramEventSource.DiagramChanged += OnDiagramChanged; }
public RoslynDiagramShapeViewModelFactory( [NotNull] IModelEventSource modelEventSource, [NotNull] IDiagramEventSource diagramEventSource, [NotNull] IRelatedNodeTypeProvider relatedNodeTypeProvider, bool isDescriptionVisible) : base(modelEventSource, diagramEventSource, relatedNodeTypeProvider) { IsDescriptionVisible = isDescriptionVisible; }
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; }
protected MiniButtonViewModelBase( IModelEventSource modelEventSource, IDiagramEventSource diagramEventSource, string name) : base(modelEventSource, diagramEventSource) { _isEnabled = true; _name = name; ClickCommand = new DelegateCommand(OnClick); DoubleClickCommand = new DelegateCommand(OnDoubleClick); }
public RoslynDiagramViewportViewModel( [NotNull] IModelEventSource modelEventSource, [NotNull] IDiagramEventSource diagramEventSource, [NotNull] IDiagramShapeUiFactory diagramShapeUiFactory, [NotNull] IMiniButtonManager miniButtonManager, double minZoom, double maxZoom, double initialZoom) : base(modelEventSource, diagramEventSource, diagramShapeUiFactory, miniButtonManager, minZoom, maxZoom, initialZoom) { _roslynDiagramShapeUiFactory = (IRoslynDiagramShapeUiFactory)diagramShapeUiFactory; }
public DiagramNodeViewModel( [NotNull] IModelEventSource modelEventSource, [NotNull] IDiagramEventSource diagramEventSource, [NotNull] IDiagramNode diagramNode, [NotNull] IDiagramNodeHeaderUi header, [NotNull][ItemNotNull] List <RelatedNodeCueViewModel> relatedCueViewModels) : base(modelEventSource, diagramEventSource, diagramNode) { RelatedNodeCueViewModels = relatedCueViewModels; Header = header; SetDiagramNodeProperties(diagramNode); }
public AutoMoveViewportViewModel( IModelEventSource modelEventSource, IDiagramEventSource diagramEventSource, double minZoom, double maxZoom, double initialZoom, ViewportAutoMoveMode mode = ViewportAutoMoveMode.Contain) : base(modelEventSource, diagramEventSource, minZoom, maxZoom, initialZoom) { Mode = mode; DiagramEventSource.DiagramChanged += OnDiagramChanged; }
public RelatedNodeMiniButtonViewModel( IModelEventSource modelEventSource, IDiagramEventSource diagramEventSource, RelatedNodeType relatedNodeType) : base(modelEventSource, diagramEventSource, relatedNodeType.Name) { DirectedModelRelationshipType = relatedNodeType.RelationshipType; _lastModel = modelEventSource.LatestModel; _lastDiagram = diagramEventSource.LatestDiagram; ModelEventSource.ModelChanged += OnModelChanged; DiagramEventSource.DiagramChanged += OnDiagramChanged; }
public DiagramNodeViewModel( [NotNull] IModelEventSource modelEventSource, [NotNull] IDiagramEventSource diagramEventSource, [NotNull] IDiagramNode diagramNode, [NotNull] IRelatedNodeTypeProvider relatedNodeTypeProvider, [NotNull] IWpfFocusTracker <IDiagramShapeUi> focusTracker, [NotNull] IDiagramNodeHeaderUi header) : base(modelEventSource, diagramEventSource, diagramNode) { RelatedNodeTypeProvider = relatedNodeTypeProvider; FocusTracker = focusTracker; RelatedNodeCueViewModels = CreateRelatedNodeCueViewModels(); Header = header; SetDiagramNodeProperties(diagramNode); }
public RoslynDiagramNodeViewModel( [NotNull] IModelEventSource modelEventSource, [NotNull] IDiagramEventSource diagramEventSource, [NotNull] IDiagramNode diagramNode, bool isDescriptionVisible, [NotNull] RoslynDiagramNodeHeaderViewModelBase header, [NotNull][ItemNotNull] List <RelatedNodeCueViewModel> relatedCueViewModels) : base( modelEventSource, diagramEventSource, diagramNode, header, relatedCueViewModels) { _isDescriptionVisible = isDescriptionVisible; Name = diagramNode.Name; }
public RelatedNodeCueViewModel( IModelEventSource modelEventSource, IDiagramEventSource diagramEventSource, IDiagramNode diagramNode, RelatedNodeType relatedNodeType) : base(modelEventSource, diagramEventSource) { _diagramNode = diagramNode; _directedModelRelationshipType = relatedNodeType.RelationshipType; _lastModel = modelEventSource.LatestModel; _lastDiagram = diagramEventSource.LatestDiagram; ModelEventSource.ModelChanged += OnModelChanged; DiagramEventSource.DiagramChanged += OnDiagramChanged; UpdateVisibility(); }
public RoslynDiagramNodeViewModel( [NotNull] IModelEventSource modelEventSource, [NotNull] IDiagramEventSource diagramEventSource, [NotNull] IDiagramNode diagramNode, [NotNull] IRelatedNodeTypeProvider relatedNodeTypeProvider, [NotNull] IWpfFocusTracker <IDiagramShapeUi> focusTracker, bool isDescriptionVisible, [NotNull] ISymbol symbol, RoslynDiagramNodeHeaderViewModelBase header) : base( modelEventSource, diagramEventSource, diagramNode, relatedNodeTypeProvider, focusTracker, header) { _isDescriptionVisible = isDescriptionVisible; _symbol = symbol; Name = symbol.GetName(); }