Files
aistudio-wpf-diagram/AIStudio.Wpf.DiagramDesigner/ViewModels/IDiagramViewModel.cs

396 lines
7.9 KiB
C#
Raw Normal View History

2021-07-23 09:42:22 +08:00
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
2023-02-04 20:21:18 +08:00
using System.ComponentModel;
2021-07-23 09:42:22 +08:00
using System.Windows;
2023-05-27 12:35:44 +08:00
using System.Windows.Controls;
2023-02-04 20:21:18 +08:00
using System.Windows.Input;
2021-07-23 09:42:22 +08:00
using System.Windows.Media;
2023-05-11 10:57:08 +08:00
using System.Xml.Serialization;
2021-07-23 09:42:22 +08:00
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;
}
2023-01-24 09:02:40 +08:00
List<SelectableDesignerItemViewModelBase> SelectedItems
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-05 21:30:53 +08:00
SelectableDesignerItemViewModelBase SelectedItem
{
get;
}
2023-01-24 09:02:40 +08:00
ObservableCollection<SelectableDesignerItemViewModelBase> Items
2022-12-06 21:28:42 +08:00
{
get;
}
SelectionService SelectionService
{
get;
}
2021-07-23 09:42:22 +08:00
2023-04-05 23:40:22 +08:00
ICommand ClearCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand ClearSelectedItemsCommand
2022-12-06 21:28:42 +08:00
{
get;
}
ICommand NextCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand AlignTopCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand AlignVerticalCentersCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand AlignBottomCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand AlignLeftCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand AlignHorizontalCentersCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand AlignRightCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand BringForwardCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand BringToFrontCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand SendBackwardCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand SendToBackCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2021-07-23 09:42:22 +08:00
2023-03-24 22:32:42 +08:00
ICommand DistributeHorizontalCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand DistributeVerticalCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand SelectAllCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand SelectInverseCommand
2023-03-11 22:27:23 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand SelectItemCommand
2023-03-05 21:30:53 +08:00
{
get;
}
ICommand AddCommand
{
get;
}
ICommand DeleteCommand
{
get;
}
ICommand CopyCommand
{
get;
}
ICommand PasteCommand
{
get;
}
ICommand CutCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand LeftMoveCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand RightMoveCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand UpMoveCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand DownMoveCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand CenterMoveCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand SameSizeCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand SameWidthCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand SameHeightCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand SameAngleCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand FitAutoCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand FitWidthCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand FitHeightCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand GroupCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand UngroupCommand
2023-03-06 11:54:41 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand LockCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand UnlockCommand
2022-12-06 21:28:42 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand EditCommand
2023-03-08 19:45:07 +08:00
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand UndoCommand
2022-12-06 21:28:42 +08:00
{
2023-03-24 22:32:42 +08:00
get;
}
ICommand RedoCommand
{
get;
2022-12-06 21:28:42 +08:00
}
2023-03-24 22:32:42 +08:00
ICommand ResetLayoutCommand
{
get;
}
ICommand ShowSearchCommand
2023-04-15 21:55:27 +08:00
{
get;
}
ICommand CloseSearchCommand
{
get;
}
2023-03-24 22:32:42 +08:00
ICommand SearchDownCommand
{
get;
}
ICommand SearchUpCommand
{
get;
}
2023-04-15 21:55:27 +08:00
ICommand ReplaceCommand
{
get;
}
ICommand ReplaceAllCommand
{
get;
}
2023-03-24 22:32:42 +08:00
DiagramType DiagramType
{
get;set;
}
2023-03-24 22:32:42 +08:00
event DiagramEventHandler Event;
2021-08-03 18:19:47 +08:00
2022-12-06 21:28:42 +08:00
bool IsReadOnly
{
get; set;
}
bool IsLoading
{
get; set;
}
2023-02-05 10:36:13 +08:00
double ZoomValue
{
get; set;
}
2023-02-14 22:15:19 +08:00
double MaximumZoomValue
{
get; set;
}
double MinimumZoomValue
{
get; set;
}
2023-02-14 22:54:55 +08:00
bool DefaultZoomBox
{
get; set;
}
2023-01-08 09:22:37 +08:00
System.Windows.Point CurrentPoint
2022-12-06 21:28:42 +08:00
{
get; set;
}
Color CurrentColor
{
get; set;
}
2023-04-15 21:55:27 +08:00
bool ShowSearch
{
get; set;
}
string SearchText
{
get; set;
}
string ReplaceText
{
get; set;
}
string SearchInfo
{
get; set;
}
bool SearchCaseMatch
{
get; set;
}
bool SearchWholeWordMatch
{
get; set;
}
2023-05-27 12:35:44 +08:00
Brush Thumbnail
2023-05-11 10:57:08 +08:00
{
get; set;
}
2022-12-06 21:28:42 +08:00
#region
IDrawModeViewModel DrawModeViewModel
{
get; set;
}
IColorViewModel ColorViewModel
{
get; set;
}
IFontViewModel FontViewModel
{
get; set;
}
IShapeViewModel ShapeViewModel
{
get; set;
}
2023-04-29 15:29:22 +08:00
IAnimationViewModel AnimationViewModel
{
get; set;
}
2022-12-06 21:28:42 +08:00
#endregion
2023-02-04 20:21:18 +08:00
2023-03-26 23:23:34 +08:00
DoCommandManager DoCommandManager
{
get;
2023-03-26 23:23:34 +08:00
}
2023-02-04 20:21:18 +08:00
#region
DiagramOption DiagramOption
{
get; set;
2023-02-05 10:36:13 +08:00
}
2023-02-04 20:21:18 +08:00
#endregion
2021-07-23 09:42:22 +08:00
#region
2023-06-19 15:47:39 +08:00
void Init(DiagramItem diagramItem);
void Init(bool initNew);
2023-03-08 23:02:50 +08:00
2023-04-05 23:40:22 +08:00
void Add(object parameter, bool? isSelected = false);
void Delete(object parameter);
void ClearSelectedItems();
2023-02-04 20:59:01 +08:00
bool ExecuteShortcut(KeyEventArgs e);
2023-05-27 12:35:44 +08:00
void SaveThumbnail();
#endregion
#region
void SetPropertyValue(SelectableDesignerItemViewModelBase selectable, string propertyName, List<SelectableDesignerItemViewModelBase> items);
void SetFont(IFontViewModel fontViewModel, string propertyName, List<SelectableDesignerItemViewModelBase> items);
void SetColor(IColorViewModel colorViewModel, string propertyName, List<SelectableDesignerItemViewModelBase> items);
void SetSharp(IShapeViewModel shapeViewModel, string propertyName, List<SelectableDesignerItemViewModelBase> items);
2023-04-29 18:36:50 +08:00
void SetAnimation(IAnimationViewModel animationViewModel, string propertyName, List<SelectableDesignerItemViewModelBase> items);
void SetQuickItem(IQuickThemeViewModel quickThemeViewModel, string propertyName, List<SelectableDesignerItemViewModelBase> items);
void LockAction(LockObject lockObject, string propertyName, List<SelectableDesignerItemViewModelBase> items);
#endregion
2023-02-04 20:59:01 +08:00
2021-07-23 09:42:22 +08:00
event PropertyChangedEventHandler PropertyChanged;
}
2023-02-12 11:02:20 +08:00
public delegate void DiagramEventHandler(object sender, DiagramEventArgs e);
public class DiagramEventArgs : PropertyChangedEventArgs
{
public DiagramEventArgs(string propertyName, object oldValue, object newValue, Guid? id) : base(propertyName)
{
OldValue = oldValue;
NewValue = newValue;
Id = id;
}
public object OldValue
{
get; set;
}
public object NewValue
{
get; set;
}
public Guid? Id
{
get; set;
}
}
2021-07-23 09:42:22 +08:00
}