Beispiel #1
0
 private void SetupConnectors()
 {
     Input = new ViewModelConnector(NodesCanvas, this)
     {
         Name = "Input"
     };
     Output = new ViewModelConnector(NodesCanvas, this)
     {
         Name    = "Output",
         Visible = null
     };
     AddEmptyConnector();
 }
        public ViewModelConnect(ViewModelConnector fromConnector)
        {
            this.WhenAnyValue(x => x.FromConnector.PositionConnectPoint.Value).Subscribe(value => StartPoint.Set(value));
            this.WhenAnyValue(x => x.StartPoint.Value, x => x.EndPoint.Value).Subscribe(_ => UpdateMedium());
            this.WhenAnyValue(x => x.ToConnector.PositionConnectPoint.Value).Subscribe(value => EndPoint.Set(value));
            this.WhenAnyValue(x => x.FromConnector).Where(x => x != null).Subscribe(_ => FromConnectChanged());
            this.WhenAnyValue(x => x.ToConnector).Where(x => x != null).Subscribe(_ => ToConnectChanged());
            this.WhenAnyValue(x => x.FromConnector.Node.NodesCanvas.Scale.Value).Subscribe(value => StrokeThickness = value);
            this.WhenAnyValue(x => x.Selected).Subscribe(value => { this.StrokeDashArray = value? new DoubleCollection()
                                                                    {
                                                                        10, 3
                                                                    } : null; });

            //this.WhenAnyValue(x => x.FromConnector).Where(x => x == null).Subscribe(_ => { StartPoint.Clear(); });
            //this.WhenAnyValue(x => x.ToConnector).Where(x => x == null).Subscribe(_ => { EndPoint.Clear(); SetupCommands(); });
            FromConnector = fromConnector;
            //SetupCommands();
        }
Beispiel #3
0
 private void DeleteConnector(ViewModelConnector connector)
 {
     Transitions.Remove(connector);
 }
Beispiel #4
0
 private void AddConnector(ViewModelConnector connector)
 {
     Transitions.Add(connector);
 }
Beispiel #5
0
 private void DragConnector(ViewModelConnector draggedConnector)
 {
 }
 private void AddFreeConnect(ViewModelConnector fromConnector)
 {
     DraggedConnect = new ViewModelConnect(fromConnector);
     Connects.Add(DraggedConnect);
 }