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