画板基础基本完成

This commit is contained in:
艾竹
2023-05-14 00:31:25 +08:00
parent 147a84cf91
commit 8003cebf99
40 changed files with 3198 additions and 374 deletions

View File

@@ -360,6 +360,10 @@
Value="{Binding ItemWidth}" />
<Setter Property="Height"
Value="{Binding ItemHeight}" />
<Setter Property="MinWidth"
Value="{Binding MinItemWidth}" />
<Setter Property="MinHeight"
Value="{Binding MinItemHeight}" />
<Setter Property="SnapsToDevicePixels"
Value="True" />
<Setter Property="ContentTemplate">

View File

@@ -18,7 +18,7 @@
<Canvas x:Name="rootCanvas">
<Path x:Name="line" StrokeThickness="{Binding ColorViewModel.LineWidth}"
StrokeDashArray="{Binding ColorViewModel.LineDashStyle,Converter={StaticResource LineDashConverter}}"
Stroke="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}"
Stroke="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}"
StrokeLineJoin="Round"
StrokeStartLineCap="Round"
StrokeEndLineCap="Round">

View File

@@ -107,7 +107,27 @@ namespace AIStudio.Wpf.DiagramDesigner
}
}
}
}
}
protected override void OnPreviewKeyDown(KeyEventArgs e)
{
if (AcceptsReturn == false && e.Key == Key.Enter)
{
if (this.DataContext is DesignerItemViewModelBase designitem)
{
designitem.ExitEditCommand.Execute(null);
}
}
base.OnPreviewKeyDown(e);
}
protected override void OnLostFocus(RoutedEventArgs e)
{
if (this.DataContext is ISelectable selectable)
{
selectable.IsSelected = false;
}
}
}
public class ControlAttachProperty