mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-24 10:26:35 +08:00
block
This commit is contained in:
@@ -194,7 +194,7 @@ namespace AIStudio.Wpf.DiagramDesigner.Controls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region
|
#region 点击
|
||||||
|
|
||||||
private Point? firstPoint;
|
private Point? firstPoint;
|
||||||
protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
|
protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
|
||||||
@@ -217,6 +217,7 @@ namespace AIStudio.Wpf.DiagramDesigner.Controls
|
|||||||
|
|
||||||
if (EditClickCount == 1)
|
if (EditClickCount == 1)
|
||||||
{
|
{
|
||||||
|
DesignerItem.ExitPreviewExecuteEdit();
|
||||||
if (firstPoint == e.GetPosition(this))
|
if (firstPoint == e.GetPosition(this))
|
||||||
{
|
{
|
||||||
DesignerItem.EditCommand?.Execute(e.GetPosition(this));
|
DesignerItem.EditCommand?.Execute(e.GetPosition(this));
|
||||||
|
|||||||
@@ -411,12 +411,7 @@
|
|||||||
</Grid.ContextMenu>
|
</Grid.ContextMenu>
|
||||||
|
|
||||||
<!-- PART_DragThumb -->
|
<!-- PART_DragThumb -->
|
||||||
<c:DragThumb x:Name="PART_DragThumb"
|
<c:DragThumb x:Name="PART_DragThumb" EditClickCount="{Binding EditClickCount}" Cursor="SizeAll" />
|
||||||
Cursor="SizeAll" >
|
|
||||||
<c:DragThumb.InputBindings>
|
|
||||||
<MouseBinding MouseAction="LeftDoubleClick" Command="{Binding EditCommand}" CommandParameter="{Binding }" />
|
|
||||||
</c:DragThumb.InputBindings>
|
|
||||||
</c:DragThumb>
|
|
||||||
|
|
||||||
<Grid RenderTransformOrigin="0.5,0.5">
|
<Grid RenderTransformOrigin="0.5,0.5">
|
||||||
|
|
||||||
@@ -566,12 +561,7 @@
|
|||||||
<dd:LineControl x:Name="line"/>
|
<dd:LineControl x:Name="line"/>
|
||||||
|
|
||||||
<!-- PART_DragThumb -->
|
<!-- PART_DragThumb -->
|
||||||
<c:DragThumb x:Name="PART_DragThumb" Margin="{Binding DragThumbMargin}"
|
<c:DragThumb x:Name="PART_DragThumb" EditClickCount="{Binding EditClickCount}" Cursor="SizeAll" Margin="{Binding DragThumbMargin}"/>
|
||||||
Cursor="SizeAll" >
|
|
||||||
<c:DragThumb.InputBindings>
|
|
||||||
<MouseBinding MouseAction="LeftDoubleClick" Command="{Binding EditCommand}" CommandParameter="{Binding }" />
|
|
||||||
</c:DragThumb.InputBindings>
|
|
||||||
</c:DragThumb>
|
|
||||||
|
|
||||||
<dd:PointContainer x:Name="PART_VerticesContainer" Style="{StaticResource ItemsControlStyle}" ItemsSource="{Binding Vertices}" Visibility="Collapsed">
|
<dd:PointContainer x:Name="PART_VerticesContainer" Style="{StaticResource ItemsControlStyle}" ItemsSource="{Binding Vertices}" Visibility="Collapsed">
|
||||||
<dd:PointContainer.ItemTemplate>
|
<dd:PointContainer.ItemTemplate>
|
||||||
@@ -674,8 +664,8 @@
|
|||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</Grid.ContextMenu>
|
</Grid.ContextMenu>
|
||||||
<!-- PART_DragThumb -->
|
<!-- PART_DragThumb -->
|
||||||
<c:DragThumb x:Name="PART_DragThumb"
|
<c:DragThumb x:Name="PART_DragThumb" EditClickCount="{Binding EditClickCount}" Cursor="SizeAll"/>
|
||||||
Cursor="SizeAll" />
|
|
||||||
<Grid RenderTransformOrigin="0.5,0.5">
|
<Grid RenderTransformOrigin="0.5,0.5">
|
||||||
<!-- PART_ResizeDecorator -->
|
<!-- PART_ResizeDecorator -->
|
||||||
<Control x:Name="PART_ResizeDecorator"
|
<Control x:Name="PART_ResizeDecorator"
|
||||||
@@ -771,12 +761,8 @@
|
|||||||
</dd:ConnectorContainer.ItemTemplate>
|
</dd:ConnectorContainer.ItemTemplate>
|
||||||
</dd:ConnectorContainer>
|
</dd:ConnectorContainer>
|
||||||
<!-- PART_DragThumb -->
|
<!-- PART_DragThumb -->
|
||||||
<c:DragThumb x:Name="PART_DragThumb"
|
<c:DragThumb x:Name="PART_DragThumb" EditClickCount="{Binding EditClickCount}" Cursor="SizeAll"/>
|
||||||
Cursor="SizeAll" >
|
|
||||||
<c:DragThumb.InputBindings>
|
|
||||||
<MouseBinding MouseAction="LeftDoubleClick" Command="{Binding EditCommand}" CommandParameter="{Binding }" />
|
|
||||||
</c:DragThumb.InputBindings>
|
|
||||||
</c:DragThumb>
|
|
||||||
<!-- PART_ResizeDecorator -->
|
<!-- PART_ResizeDecorator -->
|
||||||
<Control x:Name="PART_ResizeDecorator"
|
<Control x:Name="PART_ResizeDecorator"
|
||||||
Visibility="Collapsed"
|
Visibility="Collapsed"
|
||||||
|
|||||||
@@ -194,6 +194,10 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void ExitPreviewExecuteEdit()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
protected virtual void ExecuteEditCommand(object param)
|
protected virtual void ExecuteEditCommand(object param)
|
||||||
{
|
{
|
||||||
if (IsReadOnly == true) return;
|
if (IsReadOnly == true) return;
|
||||||
|
|||||||
@@ -430,7 +430,16 @@ namespace AIStudio.Wpf.DiagramDesigner
|
|||||||
|
|
||||||
public override async void PreviewExecuteEdit()
|
public override async void PreviewExecuteEdit()
|
||||||
{
|
{
|
||||||
await BeforeExecute();
|
var items = (this.GetFirst() ?? this).GetNexts(true);
|
||||||
|
|
||||||
|
items.ForEach(p => p.IsExecuting = true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async void ExitPreviewExecuteEdit()
|
||||||
|
{
|
||||||
|
var items = (this.GetFirst() ?? this).GetNexts(true);
|
||||||
|
|
||||||
|
items.ForEach(p => p.IsExecuting = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Execute()
|
public async Task Execute()
|
||||||
|
|||||||
Reference in New Issue
Block a user