可以切换主题

This commit is contained in:
艾竹
2023-03-11 22:27:23 +08:00
parent 84f413320f
commit fb7858fe74
22 changed files with 1061 additions and 208 deletions

View File

@@ -13,7 +13,12 @@ namespace AIStudio.Wpf.Mind.Helpers
{
public class DirectoryLayout : IMindLayout
{
public void Appearance(MindNode mindNode, bool initAppearance)
public void Appearance(MindNode mindNode)
{
Appearance(mindNode, null, false);
}
public void Appearance(MindNode mindNode, MindThemeModel mindThemeModel, bool initAppearance)
{
switch (mindNode.NodeLevel)
{
@@ -21,18 +26,13 @@ namespace AIStudio.Wpf.Mind.Helpers
{
if (initAppearance)
{
mindNode.ItemWidth = 110;
mindNode.ItemHeight = 40;
mindNode.ClearConnectors();
MindThemeHelper.ThemeChange(mindNode, mindThemeModel);
mindNode.ClearConnectors();
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.5, YRatio = 1 };
mindNode.AddConnector(port);
mindNode.ColorViewModel.FillColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
mindNode.FontViewModel.FontColor = Colors.White;
mindNode.FontViewModel.FontSize = 15;
}
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
mindNode.ConnectorOrientation = ConnectorOrientation.None;
@@ -42,15 +42,13 @@ namespace AIStudio.Wpf.Mind.Helpers
{
if (initAppearance)
{
mindNode.ItemWidth = 80;
mindNode.ItemHeight = 25;
MindThemeHelper.ThemeChange(mindNode, mindThemeModel);
mindNode.ClearConnectors();
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Top, true) { XRatio = 0.5, YRatio = 0 };
mindNode.AddConnector(port1);
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.25, YRatio = 1 };
mindNode.AddConnector(port2);
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
}
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
@@ -61,10 +59,9 @@ namespace AIStudio.Wpf.Mind.Helpers
{
if (initAppearance)
{
mindNode.ItemWidth = 80;
mindNode.ItemHeight = 25;
mindNode.ClearConnectors();
MindThemeHelper.ThemeChange(mindNode, mindThemeModel);
mindNode.ClearConnectors();
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 0.5 };
mindNode.AddConnector(port1);
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.25, YRatio = 1 };
@@ -72,8 +69,6 @@ namespace AIStudio.Wpf.Mind.Helpers
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 0);
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
}
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
@@ -81,7 +76,7 @@ namespace AIStudio.Wpf.Mind.Helpers
break;
}
}
}
}
public ConnectionViewModel GetOrSetConnectionViewModel(MindNode source, MindNode sink, ConnectionViewModel connector = null)
{

View File

@@ -13,7 +13,12 @@ namespace AIStudio.Wpf.Mind.Helpers
{
public class FishBoneLayout : IMindLayout
{
public void Appearance(MindNode mindNode, bool initAppearance)
public void Appearance(MindNode mindNode)
{
Appearance(mindNode, null, false);
}
public void Appearance(MindNode mindNode, MindThemeModel mindThemeModel, bool initAppearance)
{
if (mindNode == null) return;
@@ -25,18 +30,11 @@ namespace AIStudio.Wpf.Mind.Helpers
{
if (initAppearance)
{
mindNode.ItemWidth = 110;
mindNode.ItemHeight = 40;
mindNode.ClearConnectors();
MindThemeHelper.ThemeChange(mindNode, mindThemeModel);
mindNode.ClearConnectors();
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 0.5 };
mindNode.AddConnector(port);
mindNode.ColorViewModel.FillColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
mindNode.FontViewModel.FontColor = Colors.White;
mindNode.FontViewModel.FontSize = 15;
mindNode.Spacing = new SizeBase(50, 15);
}
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
@@ -47,17 +45,13 @@ namespace AIStudio.Wpf.Mind.Helpers
{
if (initAppearance)
{
mindNode.ItemWidth = 80;
mindNode.ItemHeight = 25;
mindNode.ClearConnectors();
MindThemeHelper.ThemeChange(mindNode, mindThemeModel);
mindNode.ClearConnectors();
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.BottomLeft, true) { XRatio = 0, YRatio = 1 };
mindNode.AddConnector(port1);
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.TopLeft, true) { XRatio = 0, YRatio = 0 };
mindNode.AddConnector(port2);
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
}
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
@@ -69,10 +63,9 @@ namespace AIStudio.Wpf.Mind.Helpers
{
if (initAppearance)
{
mindNode.ItemWidth = 80;
mindNode.ItemHeight = 25;
mindNode.ClearConnectors();
MindThemeHelper.ThemeChange(mindNode, mindThemeModel);
mindNode.ClearConnectors();
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 0.5 };
mindNode.AddConnector(port1);
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.25, YRatio = 1 };
@@ -81,10 +74,7 @@ namespace AIStudio.Wpf.Mind.Helpers
mindNode.AddConnector(port3);
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 0);
mindNode.ColorViewModel.FillColor.Color = Colors.Transparent;
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 0);
}
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Media;
using AIStudio.Wpf.DiagramDesigner;
using AIStudio.Wpf.Mind.ViewModels;
@@ -8,7 +9,8 @@ namespace AIStudio.Wpf.Mind.Helpers
{
public interface IMindLayout
{
void Appearance(MindNode mindNode, bool initAppearance);
void Appearance(MindNode mindNode);
void Appearance(MindNode mindNode, MindThemeModel mindThemeModel, bool initAppearance);
ConnectionViewModel GetOrSetConnectionViewModel(MindNode source, MindNode sink, ConnectionViewModel connector = null);
void LayoutUpdated(MindNode mindNode);

View File

@@ -13,7 +13,12 @@ namespace AIStudio.Wpf.Mind.Helpers
{
public class LogicalLayout : IMindLayout
{
public void Appearance(MindNode mindNode, bool initAppearance)
public void Appearance(MindNode mindNode)
{
Appearance(mindNode, null, false);
}
public void Appearance(MindNode mindNode, MindThemeModel mindThemeModel, bool initAppearance)
{
switch (mindNode.NodeLevel)
{
@@ -21,18 +26,11 @@ namespace AIStudio.Wpf.Mind.Helpers
{
if (initAppearance)
{
mindNode.ItemWidth = 110;
mindNode.ItemHeight = 40;
mindNode.ClearConnectors();
MindThemeHelper.ThemeChange(mindNode, mindThemeModel);
mindNode.ClearConnectors();
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.None, true) { XRatio = 0.5, YRatio = 0.5 };
mindNode.AddConnector(port);
mindNode.ColorViewModel.FillColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
mindNode.FontViewModel.FontColor = Colors.White;
mindNode.FontViewModel.FontSize = 15;
mindNode.Spacing = new SizeBase(50, 15);
}
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.Circle;
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
@@ -43,15 +41,13 @@ namespace AIStudio.Wpf.Mind.Helpers
{
if (initAppearance)
{
mindNode.ItemWidth = 80;
mindNode.ItemHeight = 25;
MindThemeHelper.ThemeChange(mindNode, mindThemeModel);
mindNode.ClearConnectors();
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 0.5 };
mindNode.AddConnector(port1);
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 0.5 };
mindNode.AddConnector(port2);
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
}
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
@@ -62,10 +58,9 @@ namespace AIStudio.Wpf.Mind.Helpers
{
if (initAppearance)
{
mindNode.ItemWidth = 80;
mindNode.ItemHeight = 25;
mindNode.ClearConnectors();
MindThemeHelper.ThemeChange(mindNode, mindThemeModel);
mindNode.ClearConnectors();
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 1 };
mindNode.AddConnector(port1);
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 1 };
@@ -73,8 +68,6 @@ namespace AIStudio.Wpf.Mind.Helpers
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 1);
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
}
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;

View File

@@ -13,7 +13,12 @@ namespace AIStudio.Wpf.Mind.Helpers
{
public class MindLayout : IMindLayout
{
public void Appearance(MindNode mindNode, bool initAppearance)
public void Appearance(MindNode mindNode)
{
Appearance(mindNode, null, false);
}
public void Appearance(MindNode mindNode, MindThemeModel mindThemeModel, bool initAppearance)
{
switch (mindNode.NodeLevel)
{
@@ -21,18 +26,11 @@ namespace AIStudio.Wpf.Mind.Helpers
{
if (initAppearance)
{
mindNode.ItemWidth = 110;
mindNode.ItemHeight = 40;
MindThemeHelper.ThemeChange(mindNode, mindThemeModel);
mindNode.ClearConnectors();
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.None, true) { XRatio = 0.5, YRatio = 0.5 };
mindNode.AddConnector(port);
mindNode.ColorViewModel.FillColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
mindNode.FontViewModel.FontColor = Colors.White;
mindNode.FontViewModel.FontSize = 15;
mindNode.Spacing = new SizeBase(50, 15);
mindNode.AddConnector(port);
}
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.Circle;
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
@@ -43,15 +41,13 @@ namespace AIStudio.Wpf.Mind.Helpers
{
if (initAppearance)
{
mindNode.ItemWidth = 80;
mindNode.ItemHeight = 25;
MindThemeHelper.ThemeChange(mindNode, mindThemeModel);
mindNode.ClearConnectors();
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 0.5 };
mindNode.AddConnector(port1);
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 0.5 };
mindNode.AddConnector(port2);
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
}
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
@@ -62,10 +58,9 @@ namespace AIStudio.Wpf.Mind.Helpers
{
if (initAppearance)
{
mindNode.ItemWidth = 80;
mindNode.ItemHeight = 25;
mindNode.ClearConnectors();
MindThemeHelper.ThemeChange(mindNode, mindThemeModel);
mindNode.ClearConnectors();
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 1 };
mindNode.AddConnector(port1);
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 1 };
@@ -73,8 +68,6 @@ namespace AIStudio.Wpf.Mind.Helpers
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 1);
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
}
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;

View File

@@ -0,0 +1,583 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;
using AIStudio.Wpf.DiagramDesigner.Geometrys;
using AIStudio.Wpf.Mind.ViewModels;
namespace AIStudio.Wpf.Mind.Helpers
{
public static class MindThemeHelper
{
public static MindThemeModel GetTheme(string theme)
{
switch (theme)
{
case "SkyBlue": return GetSkyBlueTheme();
case "SkyBlueMini": return GetSkyBlueMiniTheme();
case "LiteratureGreen": return GetLiteratureGreenTheme();
case "LiteratureGreenMini": return GetLiteratureGreenMiniTheme();
case "BrainDeadPink": return GetBrainDeadPinkTheme();
case "BrainDeadPinkMini": return GetBrainDeadPinkMiniTheme();
case "RomanticPurple": return GetRomanticPurpleTheme();
case "RomanticPurpleMini": return GetRomanticPurpleMiniTheme();
case "FreshRed": return GetFreshRedTheme();
case "FreshRedMini": return GetFreshRedMiniTheme();
case "EarthyYellow": return GetEarthyYellowTheme();
case "EarthyYellowMini": return GetEarthyYellowMiniTheme();
case "CoolLightYellow": return GetCoolLightYellowTheme();
case "CoolLightYellowMini": return GetCoolLightYellowMiniTheme();
default: return GetSkyBlueTheme();
}
}
public static MindThemeModel GetSkyBlueTheme()
{
return new MindThemeModel()
{
MindThemeLevel1 = new MindTheme()
{
ItemWidth = 110,
ItemHeight = 40,
FillColor = Color.FromRgb(0x73, 0xa1, 0xbf),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(50, 15),
},
MindThemeLevel2 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0x73, 0xa1, 0xbf),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
},
MindThemeLevel3 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0x73, 0xa1, 0xbf),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
}
};
}
public static MindThemeModel GetSkyBlueMiniTheme()
{
return new MindThemeModel()
{
MindThemeLevel1 = new MindTheme()
{
ItemWidth = 110,
ItemHeight = 40,
FillColor = Color.FromRgb(0x73, 0xa1, 0xbf),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(50, 15),
},
MindThemeLevel2 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0x73, 0xa1, 0xbf),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
},
MindThemeLevel3 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0x73, 0xa1, 0xbf),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
}
};
}
public static MindThemeModel GetLiteratureGreenTheme()
{
return new MindThemeModel()
{
MindThemeLevel1 = new MindTheme()
{
ItemWidth = 110,
ItemHeight = 40,
FillColor = Color.FromRgb(0x73, 0xbf, 0x76),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(50, 15),
},
MindThemeLevel2 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0x73, 0xbf, 0x76),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
},
MindThemeLevel3 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0x73, 0xbf, 0x76),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
}
};
}
public static MindThemeModel GetLiteratureGreenMiniTheme()
{
return new MindThemeModel()
{
MindThemeLevel1 = new MindTheme()
{
ItemWidth = 110,
ItemHeight = 40,
FillColor = Color.FromRgb(0x73, 0xbf, 0x76),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(50, 15),
},
MindThemeLevel2 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0x73, 0xbf, 0x76),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
},
MindThemeLevel3 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0x73, 0xbf, 0x76),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
}
};
}
public static MindThemeModel GetBrainDeadPinkTheme()
{
return new MindThemeModel()
{
MindThemeLevel1 = new MindTheme()
{
ItemWidth = 110,
ItemHeight = 40,
FillColor = Color.FromRgb(0xbf, 0x73, 0x94),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(50, 15),
},
MindThemeLevel2 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xbf, 0x73, 0x94),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
},
MindThemeLevel3 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xbf, 0x73, 0x94),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
}
};
}
public static MindThemeModel GetBrainDeadPinkMiniTheme()
{
return new MindThemeModel()
{
MindThemeLevel1 = new MindTheme()
{
ItemWidth = 110,
ItemHeight = 40,
FillColor = Color.FromRgb(0xbf, 0x73, 0x94),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(50, 15),
},
MindThemeLevel2 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xbf, 0x73, 0x94),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
},
MindThemeLevel3 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xbf, 0x73, 0x94),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
}
};
}
public static MindThemeModel GetRomanticPurpleTheme()
{
return new MindThemeModel()
{
MindThemeLevel1 = new MindTheme()
{
ItemWidth = 110,
ItemHeight = 40,
FillColor = Color.FromRgb(0x7b, 0x73, 0xbf),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(50, 15),
},
MindThemeLevel2 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0x7b, 0x73, 0xbf),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
},
MindThemeLevel3 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0x7b, 0x73, 0xbf),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
}
};
}
public static MindThemeModel GetRomanticPurpleMiniTheme()
{
return new MindThemeModel()
{
MindThemeLevel1 = new MindTheme()
{
ItemWidth = 110,
ItemHeight = 40,
FillColor = Color.FromRgb(0x7b, 0x73, 0xbf),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(50, 15),
},
MindThemeLevel2 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0x7b, 0x73, 0xbf),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
},
MindThemeLevel3 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0x7b, 0x73, 0xbf),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
}
};
}
public static MindThemeModel GetFreshRedTheme()
{
return new MindThemeModel()
{
MindThemeLevel1 = new MindTheme()
{
ItemWidth = 110,
ItemHeight = 40,
FillColor = Color.FromRgb(0xbf, 0x73, 0x73),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(50, 15),
},
MindThemeLevel2 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xbf, 0x73, 0x73),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
},
MindThemeLevel3 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xbf, 0x73, 0x73),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
}
};
}
public static MindThemeModel GetFreshRedMiniTheme()
{
return new MindThemeModel()
{
MindThemeLevel1 = new MindTheme()
{
ItemWidth = 110,
ItemHeight = 40,
FillColor = Color.FromRgb(0xbf, 0x73, 0x73),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(50, 15),
},
MindThemeLevel2 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xbf, 0x73, 0x73),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
},
MindThemeLevel3 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xbf, 0x73, 0x73),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
}
};
}
public static MindThemeModel GetEarthyYellowTheme()
{
return new MindThemeModel()
{
MindThemeLevel1 = new MindTheme()
{
ItemWidth = 110,
ItemHeight = 40,
FillColor = Color.FromRgb(0xbf, 0x93, 0x73),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(50, 15),
},
MindThemeLevel2 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xbf, 0x93, 0x73),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
},
MindThemeLevel3 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xbf, 0x93, 0x73),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
}
};
}
public static MindThemeModel GetEarthyYellowMiniTheme()
{
return new MindThemeModel()
{
MindThemeLevel1 = new MindTheme()
{
ItemWidth = 110,
ItemHeight = 40,
FillColor = Color.FromRgb(0xbf, 0x93, 0x73),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(50, 15),
},
MindThemeLevel2 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xbf, 0x93, 0x73),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
},
MindThemeLevel3 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xbf, 0x93, 0x73),
FontColor = Colors.White,
FontSize = 15,
Spacing = new SizeBase(15, 15),
}
};
}
public static MindThemeModel GetCoolLightYellowTheme()
{
return new MindThemeModel()
{
MindThemeLevel1 = new MindTheme()
{
ItemWidth = 110,
ItemHeight = 40,
FillColor = Color.FromRgb(0xe9, 0xdf, 0x98),
FontColor = Colors.Black,
FontSize = 15,
Spacing = new SizeBase(50, 15),
},
MindThemeLevel2 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xe9, 0xdf, 0x98),
FontColor = Colors.Black,
FontSize = 15,
Spacing = new SizeBase(15, 15),
},
MindThemeLevel3 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xe9, 0xdf, 0x98),
FontColor = Colors.Black,
FontSize = 15,
Spacing = new SizeBase(15, 15),
}
};
}
public static MindThemeModel GetCoolLightYellowMiniTheme()
{
return new MindThemeModel()
{
MindThemeLevel1 = new MindTheme()
{
ItemWidth = 110,
ItemHeight = 40,
FillColor = Color.FromRgb(0xe9, 0xdf, 0x98),
FontColor = Colors.Black,
FontSize = 15,
Spacing = new SizeBase(50, 15),
},
MindThemeLevel2 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xe9, 0xdf, 0x98),
FontColor = Colors.Black,
FontSize = 15,
Spacing = new SizeBase(15, 15),
},
MindThemeLevel3 = new MindTheme()
{
ItemWidth = 80,
ItemHeight = 25,
FillColor = Color.FromRgb(0xe9, 0xdf, 0x98),
FontColor = Colors.Black,
FontSize = 15,
Spacing = new SizeBase(15, 15),
}
};
}
public static void ThemeChange(MindNode mindNode, MindThemeModel mindThemeModel)
{
switch (mindNode.NodeLevel)
{
case 0:
{
mindNode.ItemWidth = mindThemeModel.MindThemeLevel1.ItemWidth;
mindNode.ItemHeight = mindThemeModel.MindThemeLevel1.ItemHeight;
mindNode.ColorViewModel.FillColor.Color = mindThemeModel.MindThemeLevel1.FillColor;
mindNode.ColorViewModel.LineColor.Color = mindThemeModel.MindThemeLevel1.FillColor;
mindNode.FontViewModel.FontColor = mindThemeModel.MindThemeLevel1.FontColor;
mindNode.FontViewModel.FontSize = mindThemeModel.MindThemeLevel1.FontSize;
mindNode.Spacing = mindThemeModel.MindThemeLevel1.Spacing;
break;
}
case 1:
{
mindNode.ItemWidth = mindThemeModel.MindThemeLevel2.ItemWidth;
mindNode.ItemHeight = mindThemeModel.MindThemeLevel2.ItemHeight;
mindNode.ColorViewModel.FillColor.Color = mindThemeModel.MindThemeLevel2.FillColor;
mindNode.ColorViewModel.LineColor.Color = mindThemeModel.MindThemeLevel2.FillColor;
mindNode.FontViewModel.FontColor = mindThemeModel.MindThemeLevel2.FontColor;
mindNode.FontViewModel.FontSize = mindThemeModel.MindThemeLevel2.FontSize;
mindNode.Spacing = mindThemeModel.MindThemeLevel2.Spacing;
break;
}
default:
{
mindNode.ItemWidth = mindThemeModel.MindThemeLevel3.ItemWidth;
mindNode.ItemHeight = mindThemeModel.MindThemeLevel3.ItemHeight;
mindNode.ColorViewModel.FillColor.Color = mindThemeModel.MindThemeLevel3.FillColor;
mindNode.ColorViewModel.LineColor.Color = mindThemeModel.MindThemeLevel3.FillColor;
mindNode.FontViewModel.FontColor = mindThemeModel.MindThemeLevel3.FontColor;
mindNode.FontViewModel.FontSize = mindThemeModel.MindThemeLevel3.FontSize;
mindNode.Spacing = mindThemeModel.MindThemeLevel3.Spacing;
break;
}
}
}
}
public class MindTheme
{
public double ItemWidth
{
get; set;
}
public double ItemHeight
{
get; set;
}
public Color FillColor
{
get; set;
}
public Color FontColor
{
get; set;
}
public double FontSize
{
get; set;
}
public SizeBase Spacing
{
get; set;
}
}
public class MindThemeModel
{
public MindTheme MindThemeLevel1
{
get; set;
}
public MindTheme MindThemeLevel2
{
get; set;
}
public MindTheme MindThemeLevel3
{
get; set;
}
}
}

View File

@@ -13,7 +13,12 @@ namespace AIStudio.Wpf.Mind.Helpers
{
public class OrganizationalLayout : IMindLayout
{
public void Appearance(MindNode mindNode, bool initAppearance)
public void Appearance(MindNode mindNode)
{
Appearance(mindNode, null, false);
}
public void Appearance(MindNode mindNode, MindThemeModel mindThemeModel, bool initAppearance)
{
switch (mindNode.NodeLevel)
{
@@ -21,17 +26,11 @@ namespace AIStudio.Wpf.Mind.Helpers
{
if (initAppearance)
{
mindNode.ItemWidth = 110;
mindNode.ItemHeight = 40;
mindNode.ClearConnectors();
MindThemeHelper.ThemeChange(mindNode, mindThemeModel);
mindNode.ClearConnectors();
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.5, YRatio = 1 };
mindNode.AddConnector(port);
mindNode.ColorViewModel.FillColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
mindNode.FontViewModel.FontColor = Colors.White;
mindNode.FontViewModel.FontSize = 15;
}
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
@@ -42,15 +41,13 @@ namespace AIStudio.Wpf.Mind.Helpers
{
if (initAppearance)
{
mindNode.ItemWidth = 80;
mindNode.ItemHeight = 25;
MindThemeHelper.ThemeChange(mindNode, mindThemeModel);
mindNode.ClearConnectors();
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Top, true) { XRatio = 0.5, YRatio = 0 };
mindNode.AddConnector(port1);
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.5, YRatio = 1 };
mindNode.AddConnector(port2);
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
}
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
@@ -62,10 +59,9 @@ namespace AIStudio.Wpf.Mind.Helpers
{
if (initAppearance)
{
mindNode.ItemWidth = 80;
mindNode.ItemHeight = 25;
mindNode.ClearConnectors();
MindThemeHelper.ThemeChange(mindNode, mindThemeModel);
mindNode.ClearConnectors();
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Top, true) { XRatio = 0.5, YRatio = 0 };
mindNode.AddConnector(port1);
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.5, YRatio = 1 };
@@ -73,8 +69,6 @@ namespace AIStudio.Wpf.Mind.Helpers
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 0);
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
}
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;