Exemplo n.º 1
0
 private void Initial(ViewModelNodesCanvas viewModelNodesCanvas, ViewModelConnector fromConnector)
 {
     NodesCanvas           = viewModelNodesCanvas;
     FromConnector         = fromConnector;
     FromConnector.Connect = this;
     this.EndPoint         = fromConnector.PositionConnectPoint;
 }
Exemplo n.º 2
0
 private void SetupConnectors()
 {
     Input  = new ViewModelConnector(NodesCanvas, this, "Input", Point1.Addition(0, 30));
     Output = new ViewModelConnector(NodesCanvas, this, "Output", Point1.Addition(80, 54))
     {
         Visible = null
     };
     AddEmptyConnector();
 }
 private void SetupConnectors()
 {
     Input = new ViewModelConnector(NodesCanvas, this)
     {
         Name = "Input"
     };
     Output = new ViewModelConnector(NodesCanvas, this)
     {
         Name    = "Output",
         Visible = null
     };
     AddEmptyConnector();
 }
 private void AddEmptyConnector()
 {
     if (CurrentConnector != null)
     {
         CurrentConnector.TextEnable = true;
         CurrentConnector.FormEnable = false;
         CurrentConnector.Name       = "Transition_" + NodesCanvas.Connects.Count.ToString();
     }
     CurrentConnector = new ViewModelConnector(NodesCanvas, this)
     {
         TextEnable = false
     };
     Transitions.Insert(0, CurrentConnector);
 }
        public ViewModelConnect(ViewModelConnector fromConnector)
        {
            this.WhenAnyValue(x => x.FromConnector.PositionConnectPoint.Value).Subscribe(value => StartPoint.Set(value));
            this.WhenAnyValue(x => x.ToConnector.PositionConnectPoint.Value).Subscribe(value => EndPoint.Set(value));
            this.WhenAnyValue(x => x.StartPoint.Value, x => x.EndPoint.Value).Subscribe(_ => UpdateMedium());
            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();
        }
 private void Initial(ViewModelNodesCanvas viewModelNodesCanvas, ViewModelConnector fromConnector)
 {
     NodesCanvas           = viewModelNodesCanvas;
     FromConnector         = fromConnector;
     FromConnector.Connect = this;
 }
 public ViewModelConnect(ViewModelNodesCanvas viewModelNodesCanvas, ViewModelConnector fromConnector)
 {
     Initial(viewModelNodesCanvas, fromConnector);
     SetupSubscriptions();
 }
 private void DeleteConnector(ViewModelConnector connector)
 {
     Transitions.Remove(connector);
 }
 private void AddConnector(ViewModelConnector connector)
 {
     Transitions.Add(connector);
 }
Exemplo n.º 10
0
 private void AddFreeConnect(ViewModelConnector fromConnector)
 {
     DraggedConnect = new ViewModelConnect(fromConnector);
     Connects.Add(DraggedConnect);
 }
 private void DragConnector(ViewModelConnector draggedConnector)
 {
 }