添加block快,不需要连接线,直接吸附。

This commit is contained in:
艾竹
2023-05-21 22:06:59 +08:00
parent 2fd8321363
commit fde899cfa9
30 changed files with 680 additions and 338 deletions

View File

@@ -727,7 +727,8 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
private void ColorPickerExecuted()
{
AIStudio.Wpf.ColorPicker.MainWindow window = new AIStudio.Wpf.ColorPicker.MainWindow();
window.Show();
}
#region

View File

@@ -580,7 +580,7 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
public void AddImageExecuted(object para)
{
ImageItemViewModel itemBase = new ImageItemViewModel();
DiagramViewModel?.AddItemCommand.Execute(itemBase);
DiagramViewModel?.AddCommand.Execute(itemBase);
if (itemBase.Root != null)
{
_service.DrawModeViewModel.CursorMode = CursorMode.Move;
@@ -631,7 +631,7 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
public void AddVideoExectued(object para)
{
VideoItemViewModel itemBase = new VideoItemViewModel();
DiagramViewModel?.AddItemCommand.Execute(itemBase);
DiagramViewModel?.AddCommand.Execute(itemBase);
if (itemBase.Root != null)
{
_service.DrawModeViewModel.CursorMode = CursorMode.Move;
@@ -641,7 +641,7 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
public void AddOutLineTextExecuted(object para)
{
OutLineTextDesignerItemViewModel itemBase = new OutLineTextDesignerItemViewModel();
DiagramViewModel?.AddItemCommand.Execute(itemBase);
DiagramViewModel?.AddCommand.Execute(itemBase);
if (itemBase.Root != null)
{
_service.DrawModeViewModel.CursorMode = CursorMode.Move;
@@ -651,7 +651,7 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
public void AddBarcodeExecuted(object para)
{
BarcodeDesignerItemViewModel itemBase = new BarcodeDesignerItemViewModel() { Format = (BarcodeFormat)Enum.Parse(typeof(BarcodeFormat), para.ToString()), Text = "AIStudio.Wpf.DiagramApp" };
DiagramViewModel?.AddItemCommand.Execute(itemBase);
DiagramViewModel?.AddCommand.Execute(itemBase);
if (itemBase.Root != null)
{
_service.DrawModeViewModel.CursorMode = CursorMode.Move;

View File

@@ -80,7 +80,7 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
}
private ICommand _addItemCommand;
public ICommand AddItemCommand
public ICommand AddCommand
{
get
{
@@ -119,7 +119,9 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
List<ToolBoxData> defaultToolBoxItems = new List<ToolBoxData>();
defaultToolBoxItems.Add(new TextToolBoxData("", typeof(DefaultDesignerItemViewModel)));
var blockitem = new TextToolBoxData("", typeof(BlockDesignerItemViewModel), 64, 32, new Size(130, 65));
blockitem.ColorViewModel.FillColor.Color = Color.FromRgb(0x00, 0x2F, 0xA7);
defaultToolBoxItems.Add(blockitem);
ToolBoxCategory.Add(new ToolBoxCategory() { Header = "Default", ToolBoxItems = new ObservableCollection<ToolBoxData>(defaultToolBoxItems), IsExpanded = true });
ToolBoxCategory.Add(new ToolBoxCategory() { Header = "Svg", ToolBoxItems = new ObservableCollection<ToolBoxData>() });