mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
画板基础基本完成
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user