demo提交

This commit is contained in:
艾竹
2023-01-25 23:55:30 +08:00
parent b857151bdc
commit f11a4170d8
49 changed files with 1220 additions and 184 deletions

View File

@@ -4,12 +4,13 @@ using System;
using System.Windows.Media;
using AIStudio.Wpf.DiagramDesigner;
using AIStudio.Wpf.DiagramDesigner.Helpers;
using System.Windows;
namespace AIStudio.Wpf.DiagramApp.Models
{
public class PathToolBoxData : ToolBoxData
{
public PathToolBoxData(string icon, Type type, double width = 32, double height = 32) : base(null, icon, type, width, height)
public PathToolBoxData(string icon, Type type, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(null, icon, type, width, height, desiredSize, description)
{
ColorViewModel.FillColor.Color = Colors.Orange;
}
@@ -18,7 +19,7 @@ namespace AIStudio.Wpf.DiagramApp.Models
public class TextToolBoxData : ToolBoxData
{
public TextToolBoxData(string text, Type type, double width = 32, double height = 32) : base(text, null, type, width, height)
public TextToolBoxData(string text, Type type, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(text, null, type, width, height, desiredSize, description)
{
ColorViewModel.FillColor.Color = Colors.Orange;
}
@@ -27,7 +28,7 @@ namespace AIStudio.Wpf.DiagramApp.Models
public class EllipseTextToolBoxData : ToolBoxData
{
public EllipseTextToolBoxData(string text, Type type, double width = 32, double height = 32) : base(text, null, type, width, height)
public EllipseTextToolBoxData(string text, Type type, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(text, null, type, width, height, desiredSize, description)
{
ColorViewModel.FillColor.Color = Colors.Orange;
}
@@ -36,7 +37,7 @@ namespace AIStudio.Wpf.DiagramApp.Models
public class ImageToolBoxData : ToolBoxData
{
public ImageToolBoxData(string icon, Type type, double width = 32, double height = 32) : base(null, icon, type, width, height)
public ImageToolBoxData(string icon, Type type, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(null, icon, type, width, height, desiredSize, description)
{
}
@@ -46,7 +47,7 @@ namespace AIStudio.Wpf.DiagramApp.Models
{
public string FileName { get; set; }
public DesignerItemViewModelBase DesignerItemViewModel { get; set; }
public DesignerItemToolBoxData(DesignerItemBase designerItemBase, string filename, Type type, double width = 32, double height = 32) : base(null, null, type, width, height)
public DesignerItemToolBoxData(DesignerItemBase designerItemBase, string filename, Type type, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(null, null, type, width, height, desiredSize, description)
{
Addition = designerItemBase;
DesignerItemViewModel = Activator.CreateInstance(type, null, designerItemBase) as DesignerItemViewModelBase;
@@ -57,7 +58,7 @@ namespace AIStudio.Wpf.DiagramApp.Models
public class SvgToolBoxData : ToolBoxData
{
public SvgToolBoxData(string filename, Type type, double width = 32, double height = 32) : base(null, filename, type, width, height)
public SvgToolBoxData(string filename, Type type, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(null, filename, type, width, height, desiredSize, description)
{
ColorViewModel.FillColor.Color = Colors.Blue;
}
@@ -65,7 +66,7 @@ namespace AIStudio.Wpf.DiagramApp.Models
public class MediaToolBoxData : ToolBoxData
{
public MediaToolBoxData(string icon, Type type, double width = 32, double height = 32) : base(icon, null, type, width, height)
public MediaToolBoxData(string icon, Type type, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(icon, null, type, width, height, desiredSize, description)
{
}