2021-07-23 09:42:22 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
|
2022-10-28 22:45:39 +08:00
|
|
|
|
namespace AIStudio.Wpf.DiagramDesigner
|
2021-07-23 09:42:22 +08:00
|
|
|
|
{
|
|
|
|
|
|
public interface IDiagramViewModel
|
|
|
|
|
|
{
|
2022-12-06 21:28:42 +08:00
|
|
|
|
string Name
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
List<SelectableDesignerItemViewModelBase> SelectedItems
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
ObservableCollection<SelectableDesignerItemViewModelBase> Items
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SelectionService SelectionService
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
2021-07-23 09:42:22 +08:00
|
|
|
|
|
2022-12-06 21:28:42 +08:00
|
|
|
|
SimpleCommand CreateNewDiagramCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand DirectAddItemCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand AddItemCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand RemoveItemCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand DirectRemoveItemCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand ClearSelectedItemsCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand AlignTopCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand AlignVerticalCentersCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand AlignBottomCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand AlignLeftCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand AlignHorizontalCentersCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand AlignRightCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand BringForwardCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand BringToFrontCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand SendBackwardCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand SendToBackCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
2021-07-23 09:42:22 +08:00
|
|
|
|
|
2022-12-06 21:28:42 +08:00
|
|
|
|
SimpleCommand DistributeHorizontalCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand DistributeVerticalCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand SelectAllCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
2022-12-08 20:54:45 +08:00
|
|
|
|
SimpleCommand CopyCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand PasteCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand CutCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand DeleteCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand LeftMoveCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand RightMoveCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand UpMoveCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand DownMoveCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand CenterMoveCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand SameSizeCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand SameWidthCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand SameHeightCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand SameAngleCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand GroupCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand UngroupCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand LockCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand UnlockCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2022-12-06 21:28:42 +08:00
|
|
|
|
SimpleCommand UndoCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
|
|
|
|
|
SimpleCommand RedoCommand
|
|
|
|
|
|
{
|
|
|
|
|
|
get;
|
|
|
|
|
|
}
|
2021-07-23 09:42:22 +08:00
|
|
|
|
|
2022-12-06 21:28:42 +08:00
|
|
|
|
Func<SelectableDesignerItemViewModelBase, bool> OutAddVerify
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
2021-07-23 09:42:22 +08:00
|
|
|
|
void ClearSelectedItems();
|
|
|
|
|
|
bool BelongToSameGroup(IGroupable item1, IGroupable item2);
|
|
|
|
|
|
Rect GetBoundingRectangle(IEnumerable<DesignerItemViewModelBase> items);
|
|
|
|
|
|
void UpdateZIndex();
|
2021-08-03 18:19:47 +08:00
|
|
|
|
|
2022-12-06 21:28:42 +08:00
|
|
|
|
bool IsReadOnly
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
bool IsLoading
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
Size PageSize
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
PageSizeType PageSizeType
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
bool ShowGrid
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
Size GridCellSize
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
PageSizeOrientation PageSizeOrientation
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
CellHorizontalAlignment CellHorizontalAlignment
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
CellVerticalAlignment CellVerticalAlignment
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
double GridMargin
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
Color GridColor
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
DiagramType DiagramType
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
2021-07-23 09:42:22 +08:00
|
|
|
|
|
2022-12-06 21:28:42 +08:00
|
|
|
|
Point CurrentPoint
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
Color CurrentColor
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
#region 如果这个赋值了,优先用这个的
|
|
|
|
|
|
IDrawModeViewModel DrawModeViewModel
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
IColorViewModel ColorViewModel
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
2022-12-04 23:07:20 +08:00
|
|
|
|
//用于wpf大小与物理像素之间转换
|
2022-12-06 21:28:42 +08:00
|
|
|
|
double ScreenScale
|
|
|
|
|
|
{
|
|
|
|
|
|
get; set;
|
|
|
|
|
|
}
|
2022-12-04 23:07:20 +08:00
|
|
|
|
|
|
|
|
|
|
void SetScreenScale();
|
2021-07-23 09:42:22 +08:00
|
|
|
|
|
|
|
|
|
|
event PropertyChangedEventHandler PropertyChanged;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|