mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-29 04:33:23 +08:00
Mind 出发
This commit is contained in:
@@ -19,4 +19,17 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AIStudio.Wpf.Flowchart\AIStudio.Wpf.Flowchart.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Page Update="Themes\MindNode.xaml">
|
||||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
|
||||
</Page>
|
||||
<Page Update="Themes\Generic.xaml">
|
||||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
13
AIStudio.Wpf.Mind/NodeLevel.cs
Normal file
13
AIStudio.Wpf.Mind/NodeLevel.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace AIStudio.Wpf.Mind
|
||||
{
|
||||
public enum NodeLevel
|
||||
{
|
||||
Level1,
|
||||
Level2,
|
||||
Level3
|
||||
}
|
||||
}
|
||||
8
AIStudio.Wpf.Mind/Themes/Generic.xaml
Normal file
8
AIStudio.Wpf.Mind/Themes/Generic.xaml
Normal file
@@ -0,0 +1,8 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<!--<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Flowchart;component/Controls/FlowchartEditor.xaml"/>-->
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
</ResourceDictionary>
|
||||
23
AIStudio.Wpf.Mind/Themes/MindNode.xaml
Normal file
23
AIStudio.Wpf.Mind/Themes/MindNode.xaml
Normal file
@@ -0,0 +1,23 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram"
|
||||
xmlns:viewmodel="clr-namespace:AIStudio.Wpf.Mind.ViewModels">
|
||||
|
||||
<dd:ColorBrushConverter x:Key="ColorBrushConverter"/>
|
||||
<dd:DoubleToCornerRadius x:Key="DoubleToCornerRadius"/>
|
||||
|
||||
<DataTemplate DataType="{x:Type viewmodel:MindLevel1Node}">
|
||||
<Grid IsHitTestVisible="False">
|
||||
<Grid>
|
||||
<Border BorderThickness="1"
|
||||
BorderBrush="{Binding ColorViewModel.LineColor,Converter={StaticResource ColorBrushConverter}}"
|
||||
Background="{Binding ColorViewModel.FillColor,Converter={StaticResource ColorBrushConverter}}"
|
||||
CornerRadius="{Binding CornerRadius,Converter={StaticResource DoubleToCornerRadius}}">
|
||||
|
||||
</Border>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
|
||||
</ResourceDictionary>
|
||||
118
AIStudio.Wpf.Mind/ViewModels/MindNode.cs
Normal file
118
AIStudio.Wpf.Mind/ViewModels/MindNode.cs
Normal file
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using AIStudio.Wpf.DiagramDesigner.Models;
|
||||
|
||||
namespace AIStudio.Wpf.Mind.ViewModels
|
||||
{
|
||||
public class MindNode : DesignerItemViewModelBase
|
||||
{
|
||||
public MindNode(NodeLevel nodeLevel) : this(null, nodeLevel)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public MindNode(IDiagramViewModel root, NodeLevel nodeLevel) : base(root)
|
||||
{
|
||||
NodeLevel = nodeLevel;
|
||||
}
|
||||
|
||||
public MindNode(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer)
|
||||
{
|
||||
}
|
||||
|
||||
public MindNode(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType)
|
||||
{
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
public NodeLevel NodeLevel
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
private double _cornerRadius = 3;
|
||||
public double CornerRadius
|
||||
{
|
||||
get
|
||||
{
|
||||
return _cornerRadius;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _cornerRadius, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MindLevel1Node : MindNode
|
||||
{
|
||||
public MindLevel1Node() : this(null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public MindLevel1Node(IDiagramViewModel root) : base(root, NodeLevel.Level1)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public MindLevel1Node(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public MindLevel1Node(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class MindLevel2Node : MindNode
|
||||
{
|
||||
public MindLevel2Node() : this(null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public MindLevel2Node(IDiagramViewModel root) : base(root, NodeLevel.Level2)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public MindLevel2Node(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public MindLevel2Node(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class MindLevel3Node : MindNode
|
||||
{
|
||||
public MindLevel3Node() : this(null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public MindLevel3Node(IDiagramViewModel root) : base(root, NodeLevel.Level2)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public MindLevel3Node(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public MindLevel3Node(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user