mind继续

This commit is contained in:
艾竹
2023-02-20 23:01:26 +08:00
parent 58c18db12f
commit 71ed33f881
5 changed files with 247 additions and 46 deletions

View File

@@ -32,16 +32,19 @@ namespace AIStudio.Wpf.DiagramDesigner
{
if (e.Action == NotifyCollectionChangedAction.Add)
{
foreach(var item in e.NewItems)
foreach (var item in e.NewItems)
{
FullyCreatedConnectorInfo vm = item as FullyCreatedConnectorInfo;
var connector = ItemContainerGenerator.ContainerFromItem(item) as ContentPresenter;
Canvas.SetLeft(connector, vm.DataItem.ItemWidth * vm.XRatio - vm.ConnectorWidth / 2);
Canvas.SetTop(connector, vm.DataItem.ItemHeight * vm.YRatio - vm.ConnectorHeight / 2);
if (connector != null)
{
Canvas.SetLeft(connector, vm.DataItem.ItemWidth * vm.XRatio - vm.ConnectorWidth / 2);
Canvas.SetTop(connector, vm.DataItem.ItemHeight * vm.YRatio - vm.ConnectorHeight / 2);
}
}
//SetConnectorLocation();
}
}
void ConnectorContainer_SizeChanged(object sender, SizeChangedEventArgs e)

View File

@@ -464,7 +464,16 @@ namespace AIStudio.Wpf.DiagramDesigner
Labels.FirstOrDefault()?.AddToSelection(false);
}
break;
case nameof(RouterMode):
var routetype = GlobalType.AllTypes.Where(p => typeof(IRouter).IsAssignableFrom(p)).FirstOrDefault(p => p.Name == RouterMode);
Router = routetype != null ? (System.Activator.CreateInstance(routetype) as IRouter) : new RouterNormal();
UpdatePathGeneratorResult();
break;
case nameof(PathMode):
var pathGeneratortype = GlobalType.AllTypes.Where(p => typeof(IPathGenerator).IsAssignableFrom(p)).FirstOrDefault(p => p.Name == PathMode);
PathGenerator = pathGeneratortype != null ? (System.Activator.CreateInstance(pathGeneratortype) as IPathGenerator) : new ConnectingLineSmooth();
UpdatePathGeneratorResult();
break;
}
}
else if (sender is ShapeViewModel)