mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-20 00:16:36 +08:00
右键拖动画布
This commit is contained in:
@@ -27,8 +27,6 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
this.Resources.MergedDictionaries.Add(ResourceDictionary);
|
||||
}
|
||||
|
||||
this.Focusable = true;
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ResourceDictionaryProperty = DependencyProperty.Register(nameof(ResourceDictionary), typeof(ResourceDictionary), typeof(DiagramControl), new UIPropertyMetadata(null, OnResourceDictionaryChanged));
|
||||
@@ -64,28 +62,6 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnPreviewKeyDown(KeyEventArgs e)
|
||||
{
|
||||
base.OnPreviewKeyDown(e);
|
||||
|
||||
e.Handled = DiagramViewModel.ExecuteShortcut(e);
|
||||
}
|
||||
|
||||
protected override void OnPreviewMouseWheel(MouseWheelEventArgs e)
|
||||
{
|
||||
base.OnPreviewMouseWheel(e);
|
||||
|
||||
if (Keyboard.IsKeyDown(Key.LeftCtrl) == false
|
||||
&& Keyboard.IsKeyDown(Key.RightCtrl) == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var newZoomValue = DiagramViewModel.ZoomValue + (e.Delta > 0 ? 0.1 : -0.1);
|
||||
|
||||
DiagramViewModel.ZoomValue = Math.Max(Math.Min(newZoomValue, DiagramViewModel.MaximumZoomValue), DiagramViewModel.MinimumZoomValue);
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user