mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
block
This commit is contained in:
@@ -10,7 +10,7 @@ using AIStudio.Wpf.DiagramDesigner.Helpers;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public static class DragAndDropProps
|
||||
public static class DragAndDropProps
|
||||
{
|
||||
#region EnabledForDrag
|
||||
|
||||
@@ -31,10 +31,10 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
private static void OnEnabledForDragChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
FrameworkElement fe = (FrameworkElement) d;
|
||||
FrameworkElement fe = (FrameworkElement)d;
|
||||
|
||||
|
||||
if((bool)e.NewValue)
|
||||
if ((bool)e.NewValue)
|
||||
{
|
||||
fe.PreviewMouseDown += Fe_PreviewMouseDown;
|
||||
fe.MouseMove += Fe_MouseMove;
|
||||
@@ -67,10 +67,15 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
|
||||
static void Fe_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
|
||||
{
|
||||
Point? dragStartPoint = GetDragStartPoint((DependencyObject)sender);
|
||||
|
||||
if (e.LeftButton != MouseButtonState.Pressed)
|
||||
dragStartPoint = null;
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Point? dragStartPoint = GetDragStartPoint((DependencyObject)sender);
|
||||
var point = e.GetPosition((IInputElement)sender);
|
||||
if (dragStartPoint == point)
|
||||
return;
|
||||
|
||||
if (dragStartPoint.HasValue && ((FrameworkElement)sender).DataContext is ToolBoxData toolBoxData)
|
||||
{
|
||||
|
||||
@@ -10,6 +10,34 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public class ConstParameter : BindableBase, IParameter
|
||||
{
|
||||
private ISelectable _item;
|
||||
|
||||
public ISelectable Item
|
||||
{
|
||||
get
|
||||
{
|
||||
return _item;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _item, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string _text;
|
||||
|
||||
public string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
return _text;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _text, value);
|
||||
}
|
||||
}
|
||||
|
||||
private object _value;
|
||||
|
||||
public object Value
|
||||
@@ -24,6 +52,9 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool IsPublic { get; set; } = true;
|
||||
|
||||
public void Add(object value)
|
||||
{
|
||||
if (double.TryParse(Value?.ToString() ?? "", out var value1) && double.TryParse(value?.ToString() ?? "", out var value2))
|
||||
|
||||
16
AIStudio.Wpf.DiagramDesigner/Models/Values/IGroup.cs
Normal file
16
AIStudio.Wpf.DiagramDesigner/Models/Values/IGroup.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public interface IGroup
|
||||
{
|
||||
string Text
|
||||
{
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public interface IParameter
|
||||
{
|
||||
ISelectable Item
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
string Text
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
object Value
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
bool IsPublic
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
void Add(object value);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,11 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
get; set;
|
||||
}
|
||||
|
||||
string Text
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
//新建完处于编辑状态
|
||||
bool InitIsEditing
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user