mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-14 21:26:35 +08:00
Flowchart
This commit is contained in:
@@ -72,14 +72,14 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
if (e.LeftButton != MouseButtonState.Pressed)
|
||||
dragStartPoint = null;
|
||||
|
||||
if (dragStartPoint.HasValue)
|
||||
if (dragStartPoint.HasValue && ((FrameworkElement)sender).DataContext is ToolBoxData toolBoxData)
|
||||
{
|
||||
DragObject dataObject = new DragObject();
|
||||
dataObject.ContentType = (((FrameworkElement)sender).DataContext as ToolBoxData).Type;
|
||||
dataObject.DesiredSize = new Size(65, 65);
|
||||
dataObject.Icon = (((FrameworkElement)sender).DataContext as ToolBoxData).Icon;
|
||||
dataObject.ColorViewModel = (((FrameworkElement)sender).DataContext as ToolBoxData).ColorViewModel;
|
||||
dataObject.DesignerItem = (((FrameworkElement)sender).DataContext as ToolBoxData).Addition as DesignerItemBase;
|
||||
dataObject.ContentType = toolBoxData.Type;
|
||||
dataObject.DesiredSize = toolBoxData.DesiredSize;
|
||||
dataObject.Icon = toolBoxData.Icon;
|
||||
dataObject.ColorViewModel = toolBoxData.ColorViewModel;
|
||||
dataObject.DesignerItem = toolBoxData.Addition as DesignerItemBase;
|
||||
|
||||
DragDrop.DoDragDrop((DependencyObject)sender, dataObject, DragDropEffects.Copy);
|
||||
e.Handled = true;
|
||||
|
||||
Reference in New Issue
Block a user