public dynPortViewModel(dynPortModel port, dynNodeModel node) { _node = node; _port = port; _port.PropertyChanged += _port_PropertyChanged; _node.PropertyChanged += _node_PropertyChanged; }
//construct a view and start drawing. public dynConnectorViewModel(dynPortModel port) { //var bc = new BrushConverter(); //StrokeBrush = (Brush)bc.ConvertFrom("#777"); const string colour = "#777"; Color c = Color.FromArgb( Convert.ToByte(colour.Substring(1, 1), 16), Convert.ToByte(colour.Substring(2, 1), 16), Convert.ToByte(colour.Substring(3, 1), 16)); StrokeBrush = new SolidBrush(c); IsConnecting = true; _activeStartPort = port; // makes sure that all of the positions on the curve path are // set this.Redraw(port.Center); }