Exemplo n.º 1
0
        private void CreatePort(Grid grid, bool isInput)
        {
            var port = new GatePortView(isInput);

            port.MouseDown += Port_MouseDown;
            Grid.SetRow(port, grid.RowDefinitions.Count);
            grid.RowDefinitions.Add(new RowDefinition());
            grid.Children.Add(port);
        }
Exemplo n.º 2
0
        private void GatePortClicked(GateView gate, GatePortView port)
        {
            var point = port.TransformToAncestor(Grid).Transform(new Point(port.ActualWidth / 2, port.ActualHeight / 2));

            WireBuilder.AddPoint(point, !port.IsInput);
        }