mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-20 08:26:36 +08:00
整理序列化
This commit is contained in:
@@ -373,10 +373,10 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
Connector sinkConnector = connectorsHit.Last();
|
||||
FullyCreatedConnectorInfo sinkDataItem = sinkConnector.DataContext as FullyCreatedConnectorInfo;
|
||||
|
||||
int indexOfLastTempConnection = sinkDataItem.DataItem.Parent.Items.Count - 1;
|
||||
sinkDataItem.DataItem.Parent.DirectRemoveItemCommand.Execute(
|
||||
sinkDataItem.DataItem.Parent.Items[indexOfLastTempConnection]);
|
||||
sinkDataItem.DataItem.Parent.AddItemCommand.Execute(new ConnectorViewModel(_viewModel, sourceDataItem, sinkDataItem, DrawMode, RouterMode));
|
||||
int indexOfLastTempConnection = sinkDataItem.DataItem.Root.Items.Count - 1;
|
||||
sinkDataItem.DataItem.Root.DirectRemoveItemCommand.Execute(
|
||||
sinkDataItem.DataItem.Root.Items[indexOfLastTempConnection]);
|
||||
sinkDataItem.DataItem.Root.AddItemCommand.Execute(new ConnectorViewModel(_viewModel, sourceDataItem, sinkDataItem, DrawMode, RouterMode));
|
||||
}
|
||||
else if (_service.DrawModeViewModel.GetDrawMode() == DrawMode.DirectLine && connectorsHit.Count() == 1)
|
||||
{
|
||||
@@ -396,9 +396,9 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
else
|
||||
{
|
||||
//Need to remove last item as we did not finish drawing the path
|
||||
int indexOfLastTempConnection = sourceDataItem.DataItem.Parent.Items.Count - 1;
|
||||
sourceDataItem.DataItem.Parent.DirectRemoveItemCommand.Execute(
|
||||
sourceDataItem.DataItem.Parent.Items[indexOfLastTempConnection]);
|
||||
int indexOfLastTempConnection = sourceDataItem.DataItem.Root.Items.Count - 1;
|
||||
sourceDataItem.DataItem.Root.DirectRemoveItemCommand.Execute(
|
||||
sourceDataItem.DataItem.Root.Items[indexOfLastTempConnection]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace AIStudio.Wpf.DiagramDesigner.Controls
|
||||
if (designerItem != null && designerItem.IsSelected)
|
||||
{
|
||||
// we only move DesignerItems
|
||||
designerItems = designerItem.Parent.SelectedItems.ToList();
|
||||
designerItems = designerItem.Root.SelectedItems.ToList();
|
||||
if (designerItem is ConnectorViewModel connector)
|
||||
{
|
||||
designerItems.Add(connector.SourceConnectorInfo.DataItem);
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace AIStudio.Wpf.DiagramDesigner.Controls
|
||||
|
||||
void DragThumb_DragDelta(object sender, DragDeltaEventArgs e)
|
||||
{
|
||||
if (this.DataContext is ConnectorPoint point)
|
||||
if (this.DataContext is ConnectorPointModel point)
|
||||
{
|
||||
point.X += e.HorizontalChange;
|
||||
point.Y += e.VerticalChange;
|
||||
|
||||
@@ -23,10 +23,10 @@ namespace AIStudio.Wpf.DiagramDesigner.Controls
|
||||
private void ResizeThumb_DragStarted(object sender, DragStartedEventArgs e)
|
||||
{
|
||||
DesignerItemViewModelBase designerItem = this.DataContext as DesignerItemViewModelBase;
|
||||
diagarmViewModel = designerItem.Parent;
|
||||
diagarmViewModel = designerItem.Root;
|
||||
if (designerItem != null && designerItem.IsSelected)
|
||||
{
|
||||
designerItems = designerItem.Parent.SelectedItems.ToList();
|
||||
designerItems = designerItem.Root.SelectedItems.ToList();
|
||||
foreach (DesignerItemViewModelBase item in designerItems.OfType<DesignerItemViewModelBase>())
|
||||
{
|
||||
item.BeginDo = true;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace AIStudio.Wpf.DiagramDesigner.Controls
|
||||
|
||||
if (this.designerItem != null)
|
||||
{
|
||||
designerItems = designerItem.Parent.SelectedItems.ToList();
|
||||
designerItems = designerItem.Root.SelectedItems.ToList();
|
||||
|
||||
foreach (DesignerItemViewModelBase item in designerItems.OfType<DesignerItemViewModelBase>())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user