Compare commits
204 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3779bd523 | ||
|
|
dea5a5341c | ||
|
|
d38f11e758 | ||
|
|
e5d187d8c8 | ||
|
|
1cef64c7c8 | ||
|
|
997ccde257 | ||
|
|
fe8ecdfc32 | ||
|
|
9a39d6caf8 | ||
|
|
af5ac77496 | ||
|
|
ff012a1380 | ||
|
|
f7f05a002f | ||
|
|
3605ce9223 | ||
|
|
bd1741b572 | ||
|
|
77932a4175 | ||
|
|
13cede06cf | ||
|
|
5963c2c29f | ||
|
|
21467e26f5 | ||
|
|
dfc299689a | ||
|
|
87f31fa79d | ||
|
|
f8340b5885 | ||
|
|
451df2d5de | ||
|
|
033bebb6bc | ||
|
|
81f91f3f35 | ||
|
|
cbfbf96033 | ||
|
|
4b8a03afb6 | ||
|
|
5dee3a9907 | ||
|
|
f05654309b | ||
|
|
488e23ea57 | ||
|
|
c6bc57140f | ||
|
|
ce2e44fe49 | ||
|
|
429d7b1e24 | ||
|
|
21009fc383 | ||
|
|
fae7826577 | ||
|
|
2ef5b7a1ed | ||
|
|
8ad42aec49 | ||
|
|
fa96573cbd | ||
|
|
2edb4ffb14 | ||
|
|
5e7dd6c5e5 | ||
|
|
a0485601c1 | ||
|
|
78da8f4852 | ||
|
|
347488e8e9 | ||
|
|
afea559325 | ||
|
|
e0a26a76d2 | ||
|
|
c513bd0f64 | ||
|
|
5935a58541 | ||
|
|
eccf798818 | ||
|
|
f9b9b0fb2d | ||
|
|
b3f99f5dfd | ||
|
|
0fd8c217f4 | ||
|
|
3dc7b25d95 | ||
|
|
b04028c893 | ||
|
|
88ae871b64 | ||
|
|
fccac1da23 | ||
|
|
4c54318b9a | ||
|
|
a3fbb2d8ad | ||
|
|
7835b422ff | ||
|
|
0701f25519 | ||
|
|
02ebd056b3 | ||
|
|
f80a67ff10 | ||
|
|
ca7abe6fd5 | ||
|
|
b4d7f13111 | ||
|
|
72da084f15 | ||
|
|
43b5d82fae | ||
|
|
90e94a7ec0 | ||
|
|
5e5da021ab | ||
|
|
b36bd4b228 | ||
|
|
8a2c742ec4 | ||
|
|
5ff4376674 | ||
|
|
3c8120aa15 | ||
|
|
2c6b3cc285 | ||
|
|
07ac28965e | ||
|
|
c2f4d3c706 | ||
|
|
8d87f61c07 | ||
|
|
9b3c2633a7 | ||
|
|
d97938cc2b | ||
|
|
70dac7d41c | ||
|
|
035a725da3 | ||
|
|
31872222bc | ||
|
|
414eb28867 | ||
|
|
f22d6dd3f1 | ||
|
|
e2753b0bff | ||
|
|
fb7858fe74 | ||
|
|
84f413320f | ||
|
|
5cfb32bb19 | ||
|
|
b3c7e1efec | ||
|
|
e4f6335224 | ||
|
|
c80923d19c | ||
|
|
f48838f54a | ||
|
|
f042f95ee0 | ||
|
|
152c6a8c22 | ||
|
|
cd20abd7fe | ||
|
|
79f4896fbd | ||
|
|
9061146139 | ||
|
|
9966656269 | ||
|
|
84d4035e6d | ||
|
|
a015f9208b | ||
|
|
511636ebd7 | ||
|
|
73176a00d9 | ||
|
|
6464cad46e | ||
|
|
f8c2115f03 | ||
|
|
298ec29dd9 | ||
|
|
3a744ecaf7 | ||
|
|
6d1f2a83fa | ||
|
|
c227076076 | ||
|
|
71ed33f881 | ||
|
|
58c18db12f | ||
|
|
c053396fa0 | ||
|
|
ca1ac13a1f | ||
|
|
08a4fddfdc | ||
|
|
968adb0635 | ||
|
|
debd7e711d | ||
|
|
3ef7434f5b | ||
|
|
38cb0fae85 | ||
|
|
d6e84d40c0 | ||
|
|
dfe76438c2 | ||
|
|
4d36eac218 | ||
|
|
934357c87c | ||
|
|
2f3b622c4c | ||
|
|
1c03c0f055 | ||
|
|
4d2c7a282a | ||
|
|
bd6c8ad223 | ||
|
|
da2d8cd9b3 | ||
|
|
98392f377b | ||
|
|
8a50854868 | ||
|
|
f99fd93b3f | ||
|
|
59bfed341d | ||
|
|
86082cb788 | ||
|
|
a928ae1ddd | ||
|
|
9ea83dda6f | ||
|
|
cf1bfc7482 | ||
|
|
18b6bd7e71 | ||
|
|
2a3004a9c6 | ||
|
|
09b3ec41de | ||
|
|
d53cd2bd6a | ||
|
|
f5bca4d87d | ||
|
|
b40fb78c70 | ||
|
|
e2a65ff57f | ||
|
|
c1d4c5c58f | ||
|
|
24c392a8a4 | ||
|
|
69c56c681b | ||
|
|
9ccbfb7760 | ||
|
|
7f5bea55a8 | ||
|
|
5b513370ff | ||
|
|
285c015e83 | ||
|
|
e8f91abd68 | ||
|
|
0d6debe87f | ||
|
|
bf5717cf25 | ||
|
|
8bec9b446f | ||
|
|
848121ffa2 | ||
|
|
da8cf08051 | ||
|
|
bd90d55ca8 | ||
|
|
2fde666182 | ||
|
|
397ebcfac2 | ||
|
|
527dbd98e4 | ||
|
|
50eab5e091 | ||
|
|
5ee0c1ce26 | ||
|
|
ba9e3bdf58 | ||
|
|
4feddf8392 | ||
|
|
6d1960a8df | ||
|
|
e8bd6faa21 | ||
|
|
72e3efb052 | ||
|
|
64ea56f01e | ||
|
|
04db0ef13b | ||
|
|
b5867c148e | ||
|
|
9bb6c6d321 | ||
|
|
f11a4170d8 | ||
|
|
b857151bdc | ||
|
|
b7af3534a2 | ||
|
|
4c5d535aad | ||
|
|
40590bf98d | ||
|
|
a01eb8825a | ||
|
|
a5005ac083 | ||
|
|
66d3a6685b | ||
|
|
1a291411e6 | ||
|
|
8dbe05636d | ||
|
|
f39a57b3e5 | ||
|
|
2b4662ed37 | ||
|
|
c4f8a40b5c | ||
|
|
2c76aacc66 | ||
|
|
bb2882c618 | ||
|
|
4c37fb9772 | ||
|
|
ad227aee0c | ||
|
|
2e396d687b | ||
|
|
c4ab1a6355 | ||
|
|
f8a0b29d5f | ||
|
|
718d8c01e9 | ||
|
|
5bdf10445f | ||
|
|
7d77864311 | ||
|
|
717cc43827 | ||
|
|
6a4c31106a | ||
|
|
5d7717cc2b | ||
|
|
8fc69bc96d | ||
|
|
93ca2859ba | ||
|
|
4e2e68acdf | ||
|
|
4b798f75a0 | ||
|
|
02f428d61a | ||
|
|
9f91fbcdd3 | ||
|
|
9a8d4c95f0 | ||
|
|
194eb9b104 | ||
|
|
0487857d7b | ||
|
|
dc42f75610 | ||
|
|
1abeefcc66 | ||
|
|
503b92f40e | ||
|
|
992a4bb83b |
BIN
07137f85-c85d-4712-9f4b-ba0ec2358565.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
08a182af-6eaa-4291-9007-3017ec6b2995.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
BIN
1cf93bdc-c9bb-4b59-b385-4bd87b6c9d8a.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
2d05d1a4-752a-4789-a98c-a16bc8da0733.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
33ce6c3e-3840-439e-b713-c0278671ba9a.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
34506c6e-0318-4408-80f1-49a2f1bddf0d.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
3db9354c-3a9d-4c66-940a-cedb2d776022 (1).png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
3db9354c-3a9d-4c66-940a-cedb2d776022.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
47ccfe90-9156-43e5-8d19-fe8520979fba.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
4d22ce80-0521-4bd7-85d9-eab8a442cc12.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
5341f7e9-4e13-4c16-a137-82502ee57483.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
761b291d-472c-4883-8c17-6e6466df0d0b.png
Normal file
|
After Width: | Height: | Size: 208 KiB |
BIN
7e7dc7b9-2bcf-4bf9-8411-87d0aec9596a.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
8a8d5ead-a780-4b06-92d4-09dd1677c2fb.png
Normal file
|
After Width: | Height: | Size: 112 KiB |
@@ -1,29 +1,38 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31727.386
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.4.33205.214
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.Flowchart", "AIStudio.Wpf.Flowchart\AIStudio.Wpf.Flowchart.csproj", "{86ED5B40-D185-4AFA-B5BD-BC8E78DB8758}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.Flowchart", "Extensions\AIStudio.Wpf.Flowchart\AIStudio.Wpf.Flowchart.csproj", "{86ED5B40-D185-4AFA-B5BD-BC8E78DB8758}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.Logical", "AIStudio.Wpf.Logical\AIStudio.Wpf.Logical.csproj", "{CC68D39D-7935-4079-9CEB-FC2FD498D511}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.Logical", "Extensions\AIStudio.Wpf.Logical\AIStudio.Wpf.Logical.csproj", "{CC68D39D-7935-4079-9CEB-FC2FD498D511}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{4959F170-02FB-4B7F-8F53-93DAF22713F9}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.SFC", "AIStudio.Wpf.SFC\AIStudio.Wpf.SFC.csproj", "{2AB69067-277E-4EE0-9949-8326A145EEE4}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.SFC", "Extensions\AIStudio.Wpf.SFC\AIStudio.Wpf.SFC.csproj", "{2AB69067-277E-4EE0-9949-8326A145EEE4}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.DiagramApp", "AIStudio.Wpf.DiagramApp\AIStudio.Wpf.DiagramApp.csproj", "{4408F718-9C14-4404-A63B-9B785F9D4F35}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.DiagramDesigner", "AIStudio.Wpf.DiagramDesigner\AIStudio.Wpf.DiagramDesigner.csproj", "{EA1D893D-2F50-47AA-80A6-EA297F651CCC}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.DiagramHelper", "AIStudio.Wpf.DiagramHelper\AIStudio.Wpf.DiagramHelper.csproj", "{1E77B64D-B457-4467-A5DB-BB7BA01806D9}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "解决方案项", "解决方案项", "{425E7DBD-25B9-4019-9C84-C37273A7F5C3}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
Directory.Build.Props = Directory.Build.Props
|
||||
test-zzp.txt = test-zzp.txt
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AIStudio.Wpf.DiagramDesigner.Test", "AIStudio.Wpf.DiagramDesigner.Test\AIStudio.Wpf.DiagramDesigner.Test.csproj", "{559BBB2C-03DE-4C95-B38F-538F0A275793}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2BE1891E-16C9-4191-998A-45AEEEEA1F0D}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.DiagramDesigner.Additionals", "AIStudio.Wpf.DiagramDesigner.Additionals\AIStudio.Wpf.DiagramDesigner.Additionals.csproj", "{186F34AC-4BC5-40E1-911B-DD3E96AECE6E}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.Mind", "Extensions\AIStudio.Wpf.Mind\AIStudio.Wpf.Mind.csproj", "{85C437B9-16D2-4076-ABCD-52029AC232FC}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.DiagramDesigner.Serializable", "AIStudio.Wpf.DiagramDesigner.Serializable\AIStudio.Wpf.DiagramDesigner.Serializable.csproj", "{439D0631-D9C2-4D36-BFCE-80DFCCABE9E7}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Demos", "Demos", "{62DC8608-D98F-47BB-9F19-ABB0C60B72FF}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AIStudio.Wpf.DiagramDesigner.Demo", "Demos\AIStudio.Wpf.DiagramDesigner.Demo\AIStudio.Wpf.DiagramDesigner.Demo.csproj", "{FCFC5ABF-8459-4B45-ABA0-9B820C7ED5C6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -51,14 +60,22 @@ Global
|
||||
{EA1D893D-2F50-47AA-80A6-EA297F651CCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EA1D893D-2F50-47AA-80A6-EA297F651CCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EA1D893D-2F50-47AA-80A6-EA297F651CCC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1E77B64D-B457-4467-A5DB-BB7BA01806D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1E77B64D-B457-4467-A5DB-BB7BA01806D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1E77B64D-B457-4467-A5DB-BB7BA01806D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1E77B64D-B457-4467-A5DB-BB7BA01806D9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{559BBB2C-03DE-4C95-B38F-538F0A275793}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{559BBB2C-03DE-4C95-B38F-538F0A275793}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{559BBB2C-03DE-4C95-B38F-538F0A275793}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{559BBB2C-03DE-4C95-B38F-538F0A275793}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{186F34AC-4BC5-40E1-911B-DD3E96AECE6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{186F34AC-4BC5-40E1-911B-DD3E96AECE6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{186F34AC-4BC5-40E1-911B-DD3E96AECE6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{186F34AC-4BC5-40E1-911B-DD3E96AECE6E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{85C437B9-16D2-4076-ABCD-52029AC232FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{85C437B9-16D2-4076-ABCD-52029AC232FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{85C437B9-16D2-4076-ABCD-52029AC232FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{85C437B9-16D2-4076-ABCD-52029AC232FC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{439D0631-D9C2-4D36-BFCE-80DFCCABE9E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{439D0631-D9C2-4D36-BFCE-80DFCCABE9E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{439D0631-D9C2-4D36-BFCE-80DFCCABE9E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{439D0631-D9C2-4D36-BFCE-80DFCCABE9E7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FCFC5ABF-8459-4B45-ABA0-9B820C7ED5C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FCFC5ABF-8459-4B45-ABA0-9B820C7ED5C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FCFC5ABF-8459-4B45-ABA0-9B820C7ED5C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FCFC5ABF-8459-4B45-ABA0-9B820C7ED5C6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -67,6 +84,8 @@ Global
|
||||
{86ED5B40-D185-4AFA-B5BD-BC8E78DB8758} = {4959F170-02FB-4B7F-8F53-93DAF22713F9}
|
||||
{CC68D39D-7935-4079-9CEB-FC2FD498D511} = {4959F170-02FB-4B7F-8F53-93DAF22713F9}
|
||||
{2AB69067-277E-4EE0-9949-8326A145EEE4} = {4959F170-02FB-4B7F-8F53-93DAF22713F9}
|
||||
{85C437B9-16D2-4076-ABCD-52029AC232FC} = {4959F170-02FB-4B7F-8F53-93DAF22713F9}
|
||||
{FCFC5ABF-8459-4B45-ABA0-9B820C7ED5C6} = {62DC8608-D98F-47BB-9F19-ABB0C60B72FF}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {D30FC641-F06C-4E35-AEA5-48A9B6E59CE0}
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<UseWPF>true</UseWPF>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="DesignItems\Custom\**" />
|
||||
<EmbeddedResource Remove="DesignItems\Custom\**" />
|
||||
@@ -108,6 +109,11 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AIStudio.Wpf.ComeCapture" Version="1.1.0" />
|
||||
<PackageReference Include="Costura.Fody" Version="5.7.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Dragablz" Version="0.0.3.223" />
|
||||
<PackageReference Include="Fluent.Ribbon" Version="8.0.3" />
|
||||
<PackageReference Include="gong-wpf-dragdrop" Version="2.3.2" />
|
||||
@@ -119,17 +125,13 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AIStudio.Wpf.DiagramDesigner.Additionals\AIStudio.Wpf.DiagramDesigner.Additionals.csproj" />
|
||||
<ProjectReference Include="..\AIStudio.Wpf.DiagramDesigner.Serializable\AIStudio.Wpf.DiagramDesigner.Serializable.csproj" />
|
||||
<ProjectReference Include="..\AIStudio.Wpf.DiagramDesigner\AIStudio.Wpf.DiagramDesigner.csproj" />
|
||||
<ProjectReference Include="..\AIStudio.Wpf.DiagramHelper\AIStudio.Wpf.DiagramHelper.csproj" />
|
||||
<ProjectReference Include="..\AIStudio.Wpf.Flowchart\AIStudio.Wpf.Flowchart.csproj" />
|
||||
<ProjectReference Include="..\AIStudio.Wpf.Logical\AIStudio.Wpf.Logical.csproj" />
|
||||
<ProjectReference Include="..\AIStudio.Wpf.SFC\AIStudio.Wpf.SFC.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="zxing.core">
|
||||
<HintPath>..\AIStudio.Wpf.DiagramHelper\DLL\zxing.core.dll</HintPath>
|
||||
</Reference>
|
||||
<ProjectReference Include="..\Extensions\AIStudio.Wpf.Flowchart\AIStudio.Wpf.Flowchart.csproj" />
|
||||
<ProjectReference Include="..\Extensions\AIStudio.Wpf.Logical\AIStudio.Wpf.Logical.csproj" />
|
||||
<ProjectReference Include="..\Extensions\AIStudio.Wpf.Mind\AIStudio.Wpf.Mind.csproj" />
|
||||
<ProjectReference Include="..\Extensions\AIStudio.Wpf.SFC\AIStudio.Wpf.SFC.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -236,9 +238,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="DesignItems\Customs\1.json">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Images\Svgs\account-book.svg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
@@ -9,9 +9,11 @@
|
||||
<ResourceDictionary Source="pack://application:,,,/Fluent;component/Themes/Generic.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/Dragablz;component/Themes/Generic.xaml" />
|
||||
<ResourceDictionary Source="/AIStudio.Wpf.DiagramApp;component/Themes/Generic.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Flowchart;component/ViewModels/FlowNode.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Logical;component/ViewModels/LogicalGateItemViewModel.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.SFC;component/ViewModels/SFCNode.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Flowchart;component/Themes/FlowNode.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Logical;component/Themes/LogicalGateItemViewModel.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.SFC;component/Themes/SFCNode.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Mind;component/Themes/MindNode.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.Mind;component/Themes/Generic.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
|
||||
@@ -1,102 +1 @@
|
||||
{
|
||||
"Title": null,
|
||||
"DiagramType": 0,
|
||||
"DiagramItems": [
|
||||
{
|
||||
"Name": null,
|
||||
"DiagramType": 0,
|
||||
"DesignerItems": [
|
||||
],
|
||||
"PersistDesignerItems": [
|
||||
],
|
||||
"SettingsDesignerItems": [
|
||||
],
|
||||
"PathDesignerItems": [
|
||||
{
|
||||
"Left": 132.80000000000007,
|
||||
"Top": 101.26000022888184,
|
||||
"ScaleX": 1,
|
||||
"ScaleY": 1,
|
||||
"Margin": 0.0,
|
||||
"ItemWidth": 65.0,
|
||||
"ItemHeight": 65.0,
|
||||
"Icon": "M 0,0 H 60 V 40 C 30,30 30,50 0,40 Z",
|
||||
"ItemTypeName": "AIStudio.Wpf.DiagramHelper.Extensions.ViewModels.PathItemViewModel",
|
||||
"Id": "da395032-ad9e-4dab-a035-f59bed5cb4c4",
|
||||
"ZIndex": 0,
|
||||
"IsGroup": false,
|
||||
"ParentId": "00000000-0000-0000-0000-000000000000",
|
||||
"Text": "欢迎来到AIStudio画板",
|
||||
"ColorItem": {
|
||||
"LineColor": {
|
||||
"BrushType": 1,
|
||||
"Color": "#FF808080",
|
||||
"GradientStop": null,
|
||||
"Offset": null,
|
||||
"Image": null,
|
||||
"SubType": 0,
|
||||
"StartPoint": "0,0",
|
||||
"EndPoint": "0,0",
|
||||
"Opacity": 1.0,
|
||||
"LinearOrientation": 0,
|
||||
"RadialOrientation": 0,
|
||||
"Angle": 0
|
||||
},
|
||||
"FillColor": {
|
||||
"BrushType": 1,
|
||||
"Color": "#FFFFA500",
|
||||
"GradientStop": null,
|
||||
"Offset": null,
|
||||
"Image": null,
|
||||
"SubType": 0,
|
||||
"StartPoint": "0,0",
|
||||
"EndPoint": "0,0",
|
||||
"Opacity": 1.0,
|
||||
"LinearOrientation": 0,
|
||||
"RadialOrientation": 0,
|
||||
"Angle": 0
|
||||
},
|
||||
"ShadowColor": "#00FFFFFF",
|
||||
"LineWidth": 1.0,
|
||||
"LeftArrowPathStyle": 0,
|
||||
"RightArrowPathStyle": 1,
|
||||
"LeftArrowSizeStyle": 10,
|
||||
"RightArrowSizeStyle": 10
|
||||
},
|
||||
"FontItem": {
|
||||
"FontWeight": "Normal",
|
||||
"FontStyle": "Normal",
|
||||
"FontStretch": "Normal",
|
||||
"Underline": false,
|
||||
"Strikethrough": false,
|
||||
"OverLine": false,
|
||||
"FontColor": "#FF000000",
|
||||
"FontFamily": "Arial",
|
||||
"FontSize": 11.0,
|
||||
"FontObject": "Arial, 11pt",
|
||||
"TextEffectColor": "#00FFFFFF",
|
||||
"HighlightColor": "#00FFFFFF",
|
||||
"FontCase": 0,
|
||||
"HorizontalAlignment": 1,
|
||||
"VerticalAlignment": 1,
|
||||
"LineHeight": 0.0
|
||||
}
|
||||
}
|
||||
],
|
||||
"MediaDesignerItems": [
|
||||
],
|
||||
"ImageDesignerItems": [
|
||||
],
|
||||
"TextDesignerItems": [
|
||||
],
|
||||
"LogicalGateItems": [
|
||||
],
|
||||
"FlowNodeDesignerItems": [
|
||||
],
|
||||
"ConnectionIds": [
|
||||
],
|
||||
"Connections": [
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
{"Title":null,"DiagramType":0,"DiagramItems":[{"Name":null,"DiagramType":0,"ShowGrid":false,"PhysicalGridCellSize":"0,0","CellHorizontalAlignment":0,"CellVerticalAlignment":0,"PageSizeOrientation":0,"PhysicalPageSize":"0,0","PageSizeType":0,"PhysicalGridMarginSize":"0,0","GridColor":"#00000000","DesignerItems":[{"ModelType":null,"ModelTypeName":"AIStudio.Wpf.DiagramDesigner.DefaultDesignerItemViewModel","SerializableType":null,"SerializableTypeName":"AIStudio.Wpf.DiagramDesigner.DesignerItemBase","SerializableString":"{\"PhysicalLeft\":55.071354166666666,\"PhysicalTop\":10.13635421792666,\"Angle\":0.0,\"ScaleX\":1.0,\"ScaleY\":1.0,\"Margin\":0.0,\"ItemWidth\":14.557291666666666,\"ItemHeight\":14.557291666666666,\"Icon\":null,\"Reserve\":null,\"ItemTypeName\":\"AIStudio.Wpf.DiagramDesigner.DefaultDesignerItemViewModel\",\"ParentId\":\"00000000-0000-0000-0000-000000000000\",\"Id\":\"e400c493-a6e9-4ac6-88b0-387bb35a83bc\",\"ZIndex\":0,\"IsGroup\":false,\"Text\":\"AIStudio\",\"ColorItem\":{\"LineColor\":{\"BrushType\":1,\"Color\":\"#FF808080\",\"GradientStop\":null,\"Offset\":null,\"Image\":null,\"SubType\":0,\"StartPoint\":\"0,0\",\"EndPoint\":\"0,0\",\"Opacity\":1.0,\"LinearOrientation\":0,\"RadialOrientation\":0,\"Angle\":0},\"FillColor\":{\"BrushType\":1,\"Color\":\"#FFFFA500\",\"GradientStop\":null,\"Offset\":null,\"Image\":null,\"SubType\":0,\"StartPoint\":\"0,0\",\"EndPoint\":\"0,0\",\"Opacity\":1.0,\"LinearOrientation\":0,\"RadialOrientation\":0,\"Angle\":0},\"ShadowColor\":\"#00FFFFFF\",\"LineWidth\":1.0,\"LineDashStyle\":0,\"LineAnimation\":0,\"LineAnimationDuration\":1.0},\"FontItem\":{\"FontWeight\":\"Normal\",\"FontStyle\":\"Normal\",\"FontStretch\":\"Normal\",\"Underline\":false,\"Strikethrough\":false,\"OverLine\":false,\"FontColor\":\"#FF000000\",\"FontFamily\":\"Arial\",\"FontSize\":12.0,\"FontObject\":\"Arial, 12pt\",\"TextEffectColor\":\"#00FFFFFF\",\"HighlightColor\":\"#00FFFFFF\",\"FontCase\":0,\"HorizontalAlignment\":1,\"VerticalAlignment\":1,\"LineHeight\":0.0},\"SharpItem\":{\"SourceMarker\":{\"Path\":\"\",\"Width\":10.0,\"Height\":10.0,\"PathStyle\":0,\"SizeStyle\":10},\"SinkMarker\":{\"Path\":\"M 0 -5 10 0 0 5 z\",\"Width\":10.0,\"Height\":10.0,\"PathStyle\":1,\"SizeStyle\":10}}}"}],"Connections":[]}]}
|
||||
3
AIStudio.Wpf.DiagramApp/FodyWeavers.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<Costura />
|
||||
</Weavers>
|
||||
141
AIStudio.Wpf.DiagramApp/FodyWeavers.xsd
Normal file
@@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
|
||||
<xs:element name="Weavers">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="Costura" minOccurs="0" maxOccurs="1">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="IncludeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeRuntimeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="IncludeRuntimeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged64Assemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with line breaks.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element minOccurs="0" maxOccurs="1" name="PreloadOrder" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>The order of preloaded assemblies, delimited with line breaks.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
</xs:all>
|
||||
<xs:attribute name="CreateTemporaryAssemblies" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="IncludeDebugSymbols" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Controls if .pdbs for reference assemblies are also embedded.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="IncludeRuntimeReferences" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Controls if runtime assemblies are also embedded.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="UseRuntimeReferencePaths" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Controls whether the runtime assemblies are embedded with their full path or only with their assembly name.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="DisableCompression" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="DisableCleanup" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="LoadAtModuleInit" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="IgnoreSatelliteAssemblies" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="ExcludeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="IncludeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="ExcludeRuntimeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="IncludeRuntimeAssemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="Unmanaged32Assemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="Unmanaged64Assemblies" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A list of unmanaged 64 bit assembly names to include, delimited with |.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="PreloadOrder" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>The order of preloaded assemblies, delimited with |.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:all>
|
||||
<xs:attribute name="VerifyAssembly" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
|
||||
<xs:annotation>
|
||||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="GenerateXsd" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
129
AIStudio.Wpf.DiagramApp/Models/CustomToolBoxData.cs
Normal file
@@ -0,0 +1,129 @@
|
||||
using AIStudio.Wpf.Flowchart;
|
||||
using AIStudio.Wpf.SFC;
|
||||
using System;
|
||||
using System.Windows.Media;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using AIStudio.Wpf.DiagramDesigner.Helpers;
|
||||
using System.Windows;
|
||||
using System.Collections.Generic;
|
||||
using AIStudio.Wpf.DiagramDesigner.Models;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramApp.Models
|
||||
{
|
||||
public class PathToolBoxData : ToolBoxData
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class TextToolBoxData : ToolBoxData
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class EllipseTextToolBoxData : ToolBoxData
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class ImageToolBoxData : ToolBoxData
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class DesignerItemToolBoxData : ToolBoxData
|
||||
{
|
||||
public string FileName
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public DesignerItemViewModelBase DesignerItemViewModel
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
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;
|
||||
FileName = filename;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class MultipleDesignerItemToolBoxData : ToolBoxData
|
||||
{
|
||||
public string FileName
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public List<SelectableDesignerItemViewModelBase> SelectableDesignerItemViewModels
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public double CanvasWidth
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public double CanvasHeight
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public MultipleDesignerItemToolBoxData(SerializableObject designerItemBase, string filename, double width = 32, double height = 32, Size? desiredSize = null, string description = null) : base(null, null, typeof(List<SelectableDesignerItemViewModelBase>), width, height, desiredSize, description)
|
||||
{
|
||||
SelectableDesignerItemViewModels = designerItemBase.ToObject();
|
||||
|
||||
var minleft = SelectableDesignerItemViewModels.OfType<DesignerItemViewModelBase>().Min(p => p.Left);
|
||||
var mintop = SelectableDesignerItemViewModels.OfType<DesignerItemViewModelBase>().Min(p => p.Top);
|
||||
var maxright = SelectableDesignerItemViewModels.OfType<DesignerItemViewModelBase>().Max(p => p.Left + p.ItemWidth);
|
||||
var maxbottom = SelectableDesignerItemViewModels.OfType<DesignerItemViewModelBase>().Max(p => p.Top + p.ItemHeight);
|
||||
|
||||
foreach (var item in SelectableDesignerItemViewModels.OfType<DesignerItemViewModelBase>())
|
||||
{
|
||||
item.Left -= minleft;
|
||||
item.Top -= mintop;
|
||||
}
|
||||
CanvasWidth = maxright - minleft;
|
||||
CanvasHeight = maxbottom - mintop;
|
||||
|
||||
designerItemBase.DesignerItems = SelectableDesignerItemViewModels.OfType<DesignerItemViewModelBase>().Select(p => p.ToSerializableItem(".json")).Where(p => p != null).ToList();
|
||||
designerItemBase.Connections = SelectableDesignerItemViewModels.OfType<ConnectionViewModel>().Select(p => p.ToSerializableItem(".json")).Where(p => p != null).ToList();
|
||||
|
||||
Addition = designerItemBase;
|
||||
FileName = filename;
|
||||
}
|
||||
}
|
||||
|
||||
public class SvgToolBoxData : ToolBoxData
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
public class MediaToolBoxData : ToolBoxData
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -22,7 +22,7 @@ namespace AIStudio.Wpf.DiagramApp.Models
|
||||
[XmlArray]
|
||||
public List<DiagramItem> DiagramItems { get; set; }
|
||||
|
||||
public const string XMLNS = "http://AIStudio.Wpf.DiagramApp/DesignLayout";
|
||||
public const string XMLNS = "https://gitee.com/akwkevin/aistudio.-wpf.-diagram";
|
||||
private readonly object saveLock = new Object();
|
||||
|
||||
public void Save(FileInfo designFile)
|
||||
|
||||
@@ -1,294 +0,0 @@
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using AIStudio.Wpf.Flowchart;
|
||||
using AIStudio.Wpf.DiagramHelper.Extensions.ViewModels;
|
||||
using AIStudio.Wpf.DiagramHelper.Extensions.Models;
|
||||
using Newtonsoft.Json;
|
||||
using AIStudio.Wpf.Flowchart.Models;
|
||||
using AIStudio.Wpf.Flowchart.ViewModels;
|
||||
using AIStudio.Wpf.SFC.Models;
|
||||
using AIStudio.Wpf.SFC.ViewModels;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramApp.Models
|
||||
{
|
||||
[Serializable]
|
||||
public class DiagramItem
|
||||
{
|
||||
public DiagramItem()
|
||||
{
|
||||
this.ConnectionIds = new List<Guid>();
|
||||
this.Connections = new List<ConnectionItem>();
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public string Name { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public DiagramType DiagramType { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public bool ShowGrid { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public Size GridCellSize { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[XmlAttribute("GridCellSize")]
|
||||
public string XmlGridCellSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return SerializeHelper.SerializeSize(GridCellSize);
|
||||
}
|
||||
set
|
||||
{
|
||||
GridCellSize = SerializeHelper.DeserializeSize(value);
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public CellHorizontalAlignment CellHorizontalAlignment { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public CellVerticalAlignment CellVerticalAlignment { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public PageSizeOrientation PageSizeOrientation { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public Size PageSize { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[XmlAttribute("PageSize")]
|
||||
public string XmlPageSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return SerializeHelper.SerializeSize(PageSize);
|
||||
}
|
||||
set
|
||||
{
|
||||
PageSize = SerializeHelper.DeserializeSize(value);
|
||||
}
|
||||
}
|
||||
|
||||
[XmlAttribute]
|
||||
public PageSizeType PageSizeType { get; set; }
|
||||
|
||||
[XmlAttribute]
|
||||
public double GridMargin { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public Color GridColor { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[XmlAttribute("GridColor")]
|
||||
public string XmlGridColor
|
||||
{
|
||||
get
|
||||
{
|
||||
return SerializeHelper.SerializeColor(GridColor);
|
||||
}
|
||||
set
|
||||
{
|
||||
GridColor = SerializeHelper.DeserializeColor(value);
|
||||
}
|
||||
}
|
||||
|
||||
[XmlArray]
|
||||
public List<DesignerItemBase> DesignerItems { get; set; } = new List<DesignerItemBase>();
|
||||
|
||||
[XmlArray]
|
||||
public List<PersistDesignerItem> PersistDesignerItems { get; set; } = new List<PersistDesignerItem>();
|
||||
|
||||
[XmlArray]
|
||||
public List<SettingsDesignerItem> SettingsDesignerItems { get; set; } = new List<SettingsDesignerItem>();
|
||||
|
||||
[XmlArray]
|
||||
public List<PathDesignerItem> PathDesignerItems { get; set; } = new List<PathDesignerItem>();
|
||||
|
||||
[XmlArray]
|
||||
public List<MediaDesignerItem> MediaDesignerItems { get; set; } = new List<MediaDesignerItem>();
|
||||
|
||||
[XmlArray]
|
||||
public List<ImageDesignerItem> ImageDesignerItems { get; set; } = new List<ImageDesignerItem>();
|
||||
|
||||
[XmlArray]
|
||||
public List<TextDesignerItem> TextDesignerItems { get; set; } = new List<TextDesignerItem>();
|
||||
|
||||
[XmlArray]
|
||||
public List<LogicalGateDesignerItemBase> LogicalGateItems { get; set; } = new List<LogicalGateDesignerItemBase>();
|
||||
|
||||
[XmlArray]
|
||||
public List<FlowNodeDesignerItem> FlowNodeDesignerItems { get; set; } = new List<FlowNodeDesignerItem>();
|
||||
|
||||
[XmlArray]
|
||||
public List<SFCNodeDesignerItem> SFCNodeDesignerItems { get; set; } = new List<SFCNodeDesignerItem>();
|
||||
|
||||
[JsonIgnore]
|
||||
[XmlIgnore]
|
||||
public List<DesignerItemBase> AllDesignerItems
|
||||
{
|
||||
get
|
||||
{
|
||||
return
|
||||
DesignerItems.OfType<DesignerItemBase>()
|
||||
.Union(TextDesignerItems.OfType<DesignerItemBase>())
|
||||
.Union(LogicalGateItems.OfType<DesignerItemBase>())
|
||||
.Union(MediaDesignerItems.OfType<DesignerItemBase>())
|
||||
.Union(ImageDesignerItems.OfType<DesignerItemBase>())
|
||||
.Union(PathDesignerItems.OfType<DesignerItemBase>())
|
||||
.Union(PersistDesignerItems.OfType<DesignerItemBase>())
|
||||
.Union(SettingsDesignerItems.OfType<DesignerItemBase>())
|
||||
.Union(FlowNodeDesignerItems.OfType<DesignerItemBase>())
|
||||
.Union(SFCNodeDesignerItems.OfType<DesignerItemBase>())
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
[XmlArray]
|
||||
public List<Guid> ConnectionIds { get; set; }
|
||||
|
||||
[XmlArray]
|
||||
public List<ConnectionItem> Connections { get; set; }
|
||||
|
||||
public void AddItems(IEnumerable<SelectableDesignerItemViewModelBase> selectedDesignerItems)
|
||||
{
|
||||
foreach (var item in selectedDesignerItems.OfType<DesignerItemViewModelBase>())
|
||||
{
|
||||
if (item is PersistDesignerItemViewModel)
|
||||
{
|
||||
PersistDesignerItems.Add(new PersistDesignerItem(item as PersistDesignerItemViewModel));
|
||||
}
|
||||
else if (item is SettingsDesignerItemViewModel)
|
||||
{
|
||||
SettingsDesignerItems.Add(new SettingsDesignerItem(item as SettingsDesignerItemViewModel));
|
||||
}
|
||||
else if (item is PathItemViewModel)
|
||||
{
|
||||
PathDesignerItems.Add(new PathDesignerItem(item));
|
||||
}
|
||||
else if (item is GifImageItemViewModel)
|
||||
{
|
||||
MediaDesignerItems.Add(new MediaDesignerItem(item as GifImageItemViewModel));
|
||||
}
|
||||
else if (item is MediaItemViewModel)
|
||||
{
|
||||
MediaDesignerItems.Add(new MediaDesignerItem(item as MediaItemViewModel));
|
||||
}
|
||||
else if (item is ImageItemViewModel)
|
||||
{
|
||||
ImageDesignerItems.Add(new ImageDesignerItem(item as ImageItemViewModel));
|
||||
}
|
||||
else if (item is TextDesignerItemViewModel)
|
||||
{
|
||||
TextDesignerItems.Add(new TextDesignerItem(item as TextDesignerItemViewModel));
|
||||
}
|
||||
else if (item is LogicalGateItemViewModelBase)
|
||||
{
|
||||
LogicalGateItems.Add(new LogicalGateDesignerItemBase(item as LogicalGateItemViewModelBase));
|
||||
}
|
||||
else if (item is FlowNode)
|
||||
{
|
||||
FlowNodeDesignerItems.Add(new FlowNodeDesignerItem(item as FlowNode));
|
||||
}
|
||||
else if (item is SFCNode)
|
||||
{
|
||||
SFCNodeDesignerItems.Add(new SFCNodeDesignerItem(item as SFCNode));
|
||||
}
|
||||
else if (item is BarcodeDesignerItemViewModel)
|
||||
{
|
||||
DesignerItems.Add(new DesignerItemBase(item, (item as BarcodeDesignerItemViewModel).Format.ToString()));
|
||||
}
|
||||
else
|
||||
{
|
||||
DesignerItems.Add(new DesignerItemBase(item));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static DesignerItemBase ToXmlObject(SelectableDesignerItemViewModelBase item)
|
||||
{
|
||||
if (item is PersistDesignerItemViewModel)
|
||||
{
|
||||
return new PersistDesignerItem(item as PersistDesignerItemViewModel);
|
||||
}
|
||||
else if (item is SettingsDesignerItemViewModel)
|
||||
{
|
||||
return new SettingsDesignerItem(item as SettingsDesignerItemViewModel);
|
||||
}
|
||||
else if (item is PathItemViewModel)
|
||||
{
|
||||
return new PathDesignerItem(item as PathItemViewModel);
|
||||
}
|
||||
else if (item is GifImageItemViewModel)
|
||||
{
|
||||
return new MediaDesignerItem(item as GifImageItemViewModel);
|
||||
}
|
||||
else if (item is MediaItemViewModel)
|
||||
{
|
||||
return new MediaDesignerItem(item as MediaItemViewModel);
|
||||
}
|
||||
else if (item is ImageItemViewModel)
|
||||
{
|
||||
return new ImageDesignerItem(item as ImageItemViewModel);
|
||||
}
|
||||
else if (item is TextDesignerItemViewModel)
|
||||
{
|
||||
return new TextDesignerItem(item as TextDesignerItemViewModel);
|
||||
}
|
||||
else if (item is LogicalGateItemViewModelBase)
|
||||
{
|
||||
return new LogicalGateDesignerItemBase(item as LogicalGateItemViewModelBase);
|
||||
}
|
||||
else if (item is FlowNode)
|
||||
{
|
||||
return new FlowNodeDesignerItem(item as FlowNode);
|
||||
}
|
||||
else if (item is SFCNode)
|
||||
{
|
||||
return new SFCNodeDesignerItem(item as SFCNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new DesignerItemBase(item as DesignerItemViewModelBase);
|
||||
}
|
||||
}
|
||||
|
||||
public static Type GetTypeOfDiagramItem(DesignerItemViewModelBase vmType)
|
||||
{
|
||||
if (vmType is PersistDesignerItemViewModel)
|
||||
return typeof(PersistDesignerItem);
|
||||
if (vmType is SettingsDesignerItemViewModel)
|
||||
return typeof(SettingsDesignerItem);
|
||||
if (vmType is PathItemViewModel)
|
||||
return typeof(PathToolBoxData);
|
||||
if (vmType is GifImageItemViewModel)
|
||||
return typeof(MediaDesignerItem);
|
||||
if (vmType is MediaItemViewModel)
|
||||
return typeof(MediaDesignerItem);
|
||||
if (vmType is ImageItemViewModel)
|
||||
return typeof(ImageDesignerItem);
|
||||
if (vmType is LogicalGateItemViewModelBase)
|
||||
return typeof(LogicalGateDesignerItemBase);
|
||||
if (vmType is FlowNode)
|
||||
return typeof(FlowNodeDesignerItem);
|
||||
if (vmType is SFCNode)
|
||||
return typeof(SFCNodeDesignerItem);
|
||||
throw new InvalidOperationException(string.Format("Unknown diagram type. Currently only {0} and {1} are supported",
|
||||
typeof(PersistDesignerItem).AssemblyQualifiedName,
|
||||
typeof(SettingsDesignerItemViewModel).AssemblyQualifiedName
|
||||
));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
using AIStudio.Wpf.Flowchart;
|
||||
using AIStudio.Wpf.SFC;
|
||||
using System;
|
||||
using System.Windows.Media;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using AIStudio.Wpf.DiagramDesigner.Helpers;
|
||||
|
||||
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)
|
||||
{
|
||||
ColorViewModel.FillColor.Color = Colors.Orange;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class TextToolBoxData : ToolBoxData
|
||||
{
|
||||
public TextToolBoxData(string text, Type type, double width = 32, double height = 32) : base(text, null, type, width, height)
|
||||
{
|
||||
ColorViewModel.FillColor.Color = Colors.Orange;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class EllipseTextToolBoxData : ToolBoxData
|
||||
{
|
||||
public EllipseTextToolBoxData(string text, Type type, double width = 32, double height = 32) : base(text, null, type, width, height)
|
||||
{
|
||||
ColorViewModel.FillColor.Color = Colors.Orange;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class ImageToolBoxData : ToolBoxData
|
||||
{
|
||||
public ImageToolBoxData(string icon, Type type, double width = 32, double height = 32) : base(null, icon, type, width, height)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class DesignerItemToolBoxData : ToolBoxData
|
||||
{
|
||||
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)
|
||||
{
|
||||
Addition = designerItemBase;
|
||||
DesignerItemViewModel = (DesignerItemViewModelBase)Activator.CreateInstance(type, null, designerItemBase);
|
||||
FileName = filename;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class SvgToolBoxData : ToolBoxData
|
||||
{
|
||||
public SvgToolBoxData(string filename, Type type, double width = 32, double height = 32) : base(null, filename, type, width, height)
|
||||
{
|
||||
ColorViewModel.FillColor.Color = Colors.Blue;
|
||||
}
|
||||
}
|
||||
|
||||
public class MediaToolBoxData : ToolBoxData
|
||||
{
|
||||
public MediaToolBoxData(string icon, Type type, double width = 32, double height = 32) : base(icon, null, type, width, height)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converter="clr-namespace:AIStudio.Wpf.DiagramHelper.Converters;assembly=AIStudio.Wpf.DiagramHelper">
|
||||
xmlns:converter="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Converters;assembly=AIStudio.Wpf.DiagramDesigner.Additionals">
|
||||
<converter:ThicknessBindingConverter x:Key="ThicknessBindingConverter"/>
|
||||
|
||||
<Style x:Key="DefaultExpanderBaseHeaderStyle" TargetType="{x:Type ToggleButton}">
|
||||
@@ -2,26 +2,21 @@
|
||||
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.DiagramDesigner;component/Resources/Styles/ScrollBar.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Resources/Styles/Expander.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Resources/Styles/GroupBox.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Resources/Styles/ToolTip.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Resources/Styles/ScrollViewer.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Resources/Styles/ZoomBox.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Resources/Styles/DesignerItems.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Themes/Styles/Fluent.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Themes/Styles/Expander.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Themes/Styles/ListBox.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Themes/Styles/Slider.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Themes/Styles/TabControl.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Themes/Styles/ToggleButton.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramHelper;component/Extensions/ViewModels/BarcodeDesignerItemViewModel.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramHelper;component/Extensions/ViewModels/OutLineTextDesignerItemViewModel.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramHelper;component/Extensions/ViewModels/PathItemViewModel.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramHelper;component/Extensions/ViewModels/PersistDesignerItemViewModel.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramHelper;component/Extensions/ViewModels/SettingsDesignerItemViewModel.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramHelper;component/Extensions/ViewModels/SvgDesignerItemViewModel.xaml"/>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner;component/Themes/Style.xaml" />
|
||||
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Styles/Fluent.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Styles/Expander.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Styles/ListBox.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Styles/Slider.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Styles/TabControl.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramApp;component/Styles/ToggleButton.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner.Additionals;component/Extensions/ViewModels/BarcodeDesignerItemViewModel.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner.Additionals;component/Extensions/ViewModels/OutLineTextDesignerItemViewModel.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner.Additionals;component/Extensions/ViewModels/PathItemViewModel.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner.Additionals;component/Extensions/ViewModels/PersistDesignerItemViewModel.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner.Additionals;component/Extensions/ViewModels/SettingsDesignerItemViewModel.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/AIStudio.Wpf.DiagramDesigner.Additionals;component/Extensions/ViewModels/SvgDesignerItemViewModel.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
|
||||
|
||||
@@ -13,19 +13,19 @@ using AIStudio.Wpf.DiagramDesigner;
|
||||
|
||||
namespace AIStudio.Wpf.Flowchart
|
||||
{
|
||||
public class FlowchartViewModel : DiagramsViewModel
|
||||
public class FlowchartViewModel : PageViewModel
|
||||
{
|
||||
public FlowchartViewModel(string title, string status, DiagramType diagramType) : base(title, status, diagramType)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
public FlowchartViewModel(string filename, DiagramDocument diagramDocument) : base(filename, diagramDocument)
|
||||
{
|
||||
if (DiagramViewModel != null)
|
||||
{
|
||||
FlowchartService.InitData(DiagramViewModel.Items.OfType<FlowNode>().ToList(), DiagramViewModel.Items.OfType<ConnectorViewModel>().ToList(), DiagramViewModel);
|
||||
FlowchartService.InitData(DiagramViewModel.Items.OfType<FlowNode>().ToList(), DiagramViewModel.Items.OfType<ConnectionViewModel>().ToList(), DiagramViewModel, false);
|
||||
}
|
||||
_service.DrawModeViewModel.VectorLineDrawMode = DrawMode.BoundaryConnectingLine;
|
||||
_service.DrawModeViewModel.LineDrawMode = DrawMode.ConnectingLineSmooth;
|
||||
}
|
||||
|
||||
protected override void InitDiagramViewModel()
|
||||
@@ -36,76 +36,95 @@ namespace AIStudio.Wpf.Flowchart
|
||||
DiagramViewModel.GridCellSize = new Size(100, 100);
|
||||
DiagramViewModel.CellHorizontalAlignment = CellHorizontalAlignment.Center;
|
||||
DiagramViewModel.CellVerticalAlignment = CellVerticalAlignment.Center;
|
||||
_service.DrawModeViewModel.VectorLineDrawMode = DrawMode.BoundaryConnectingLine;
|
||||
_service.DrawModeViewModel.LineDrawMode = DrawMode.ConnectingLineSmooth;
|
||||
}
|
||||
|
||||
protected override void Init()
|
||||
protected override void Init(bool initNew)
|
||||
{
|
||||
base.Init();
|
||||
base.Init(initNew);
|
||||
|
||||
DesignerItemViewModelBase start = new StartFlowNode() { Left = 100, Top = 0, Color = Colors.Yellow.ToString() };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(start);
|
||||
DesignerItemViewModelBase start = new StartFlowNode() { Left = 100, Top = 0, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString() };
|
||||
DiagramViewModel.Add(start);
|
||||
|
||||
DesignerItemViewModelBase middle1 = new MiddleFlowNode() { Left = 100, Top = 100, Color = Colors.Yellow.ToString(), Text = "主管审批", UserIds= new List<string> { "操作员1", "操作员2" }, ActType = "or" };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(middle1);
|
||||
DesignerItemViewModelBase middle1 = new MiddleFlowNode() { Left = 100, Top = 100, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString(), Text = "主管审批", UserIds= new List<string> { "操作员1", "操作员2" }, ActType = "or", SimulateApprove = true };
|
||||
DiagramViewModel.Add(middle1);
|
||||
|
||||
DesignerItemViewModelBase decide = new DecideFlowNode() { Left = 100, Top = 200, Color = Colors.Yellow.ToString(), Text = "5" };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(decide);
|
||||
DesignerItemViewModelBase decide = new DecideFlowNode() { Left = 100, Top = 200, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString(), Text = "5" };
|
||||
DiagramViewModel.Add(decide);
|
||||
|
||||
DesignerItemViewModelBase middle2 = new MiddleFlowNode() { Left = 200, Top = 300, Color = Colors.Yellow.ToString(), Text = "分管领导", UserIds = new List<string> { "操作员1", "操作员2" }, ActType = "and" };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(middle2);
|
||||
DesignerItemViewModelBase middle2 = new MiddleFlowNode() { Left = 200, Top = 300, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString(), Text = "分管领导", UserIds = new List<string> { "操作员1", "操作员2" }, ActType = "and", SimulateApprove = true };
|
||||
DiagramViewModel.Add(middle2);
|
||||
|
||||
DesignerItemViewModelBase cobegin = new COBeginFlowNode() { Left = 100, Top = 400, Color = Colors.Yellow.ToString() };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(cobegin);
|
||||
DesignerItemViewModelBase cobegin = new COBeginFlowNode() { Left = 100, Top = 400, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString() };
|
||||
DiagramViewModel.Add(cobegin);
|
||||
|
||||
DesignerItemViewModelBase middle3 = new MiddleFlowNode() { Left = 100, Top = 500, Color = Colors.Yellow.ToString(), Text = "财务审批", UserIds = new List<string> { "Admin" }, ActType = "or" };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(middle3);
|
||||
DesignerItemViewModelBase middle3 = new MiddleFlowNode() { Left = 100, Top = 500, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString(), Text = "财务审批", UserIds = new List<string> { "Admin" }, ActType = "or", SimulateApprove = true };
|
||||
DiagramViewModel.Add(middle3);
|
||||
|
||||
DesignerItemViewModelBase middle4 = new MiddleFlowNode() { Left = 200, Top = 500, Color = Colors.Yellow.ToString(), Text = "人力审批", RoleIds = new List<string> { "操作员", "管理员" }, ActType = "or" };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(middle4);
|
||||
DesignerItemViewModelBase middle4 = new MiddleFlowNode() { Left = 200, Top = 500, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString(), Text = "人力审批", RoleIds = new List<string> { "操作员", "管理员" }, ActType = "or", SimulateApprove = true };
|
||||
DiagramViewModel.Add(middle4);
|
||||
|
||||
DesignerItemViewModelBase coend = new COEndFlowNode() { Left = 100, Top = 600, Color = Colors.Yellow.ToString() };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(coend);
|
||||
DesignerItemViewModelBase coend = new COEndFlowNode() { Left = 100, Top = 600, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString() };
|
||||
DiagramViewModel.Add(coend);
|
||||
|
||||
DesignerItemViewModelBase end = new EndFlowNode() { Left = 100, Top = 700, Color = Colors.Yellow.ToString() };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(end);
|
||||
DesignerItemViewModelBase end = new EndFlowNode() { Left = 100, Top = 700, ItemWidth = 80, ItemHeight = 40, StatusColor = Colors.Yellow.ToString() };
|
||||
DiagramViewModel.Add(end);
|
||||
|
||||
ConnectorViewModel connector1 = new ConnectorViewModel(start.BottomConnector, middle1.TopConnector, _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector1);
|
||||
ConnectionViewModel connector1 = new ConnectionViewModel(start.BottomConnector, middle1.TopConnector, _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
DiagramViewModel.Add(connector1);
|
||||
|
||||
ConnectorViewModel connector2 = new ConnectorViewModel(middle1.BottomConnector, decide.TopConnector, _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector2);
|
||||
ConnectionViewModel connector2 = new ConnectionViewModel(middle1.BottomConnector, decide.TopConnector, _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
DiagramViewModel.Add(connector2);
|
||||
|
||||
ConnectorViewModel connector3 = new ConnectorViewModel(decide.RightConnector, middle2.TopConnector, _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector3);
|
||||
connector3.AddText(">=3");
|
||||
ConnectionViewModel connector3 = new ConnectionViewModel(decide.RightConnector, middle2.TopConnector, _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
DiagramViewModel.Add(connector3);
|
||||
connector3.AddLabel(">=3");
|
||||
|
||||
ConnectorViewModel connector4 = new ConnectorViewModel(middle2.BottomConnector, cobegin.TopConnector, _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector4);
|
||||
ConnectionViewModel connector4 = new ConnectionViewModel(middle2.BottomConnector, cobegin.TopConnector, _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
DiagramViewModel.Add(connector4);
|
||||
|
||||
ConnectorViewModel connector5 = new ConnectorViewModel(decide.BottomConnector, cobegin.TopConnector, _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector5);
|
||||
connector5.AddText("<3");
|
||||
ConnectionViewModel connector5 = new ConnectionViewModel(decide.BottomConnector, cobegin.TopConnector, _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
DiagramViewModel.Add(connector5);
|
||||
connector5.AddLabel("<3");
|
||||
|
||||
ConnectorViewModel connector6 = new ConnectorViewModel(cobegin.BottomConnector, middle3.TopConnector, _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector6);
|
||||
ConnectionViewModel connector6 = new ConnectionViewModel(cobegin.BottomConnector, middle3.TopConnector, _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
DiagramViewModel.Add(connector6);
|
||||
|
||||
ConnectorViewModel connector7 = new ConnectorViewModel(cobegin.BottomConnector, middle4.TopConnector, _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector7);
|
||||
ConnectionViewModel connector7 = new ConnectionViewModel(cobegin.BottomConnector, middle4.TopConnector, _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
DiagramViewModel.Add(connector7);
|
||||
|
||||
ConnectorViewModel connector8 = new ConnectorViewModel(middle3.BottomConnector, coend.TopConnector, _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector8);
|
||||
ConnectionViewModel connector8 = new ConnectionViewModel(middle3.BottomConnector, coend.TopConnector, _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
DiagramViewModel.Add(connector8);
|
||||
|
||||
ConnectorViewModel connector9 = new ConnectorViewModel(middle4.BottomConnector, coend.TopConnector, _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector9);
|
||||
ConnectionViewModel connector9 = new ConnectionViewModel(middle4.BottomConnector, coend.TopConnector, _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
DiagramViewModel.Add(connector9);
|
||||
|
||||
ConnectorViewModel connector10 = new ConnectorViewModel(coend.BottomConnector, end.TopConnector, _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector10);
|
||||
ConnectionViewModel connector10 = new ConnectionViewModel(coend.BottomConnector, end.TopConnector, _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
DiagramViewModel.Add(connector10);
|
||||
|
||||
DiagramViewModel.ClearSelectedItems();
|
||||
TextDesignerItemViewModel despcription = new TextDesignerItemViewModel()
|
||||
{
|
||||
Name = nameof(despcription),
|
||||
Left = 260,
|
||||
Top = 60,
|
||||
ItemWidth = 300,
|
||||
ItemHeight = 150,
|
||||
Text = @"
|
||||
一个简易的OA审批流程
|
||||
1.主管审批为or审批,任意一个审批即可;
|
||||
2.分管领导为and审批,需要审批两次;
|
||||
3.财务审批为or审批,任意一个审批即可;
|
||||
4.人力审批为or审批,任意一个审批即可;
|
||||
注意:为了模拟审批,双击节点可以进行审批;请双击主管审批、分管领导、财务审批、人力审批、进行效果查看。"
|
||||
};
|
||||
despcription.FontViewModel.HorizontalAlignment = HorizontalAlignment.Left;
|
||||
despcription.FontViewModel.VerticalAlignment = VerticalAlignment.Top;
|
||||
despcription.FontViewModel.FontColor = Colors.Blue;
|
||||
DiagramViewModel.Add(despcription);
|
||||
|
||||
FlowchartService.InitData(DiagramViewModel.Items.OfType<FlowNode>().ToList(), DiagramViewModel.Items.OfType<ConnectorViewModel>().ToList(), DiagramViewModel);
|
||||
FlowchartService.InitData(DiagramViewModel.Items.OfType<FlowNode>().ToList(), DiagramViewModel.Items.OfType<ConnectionViewModel>().ToList(), DiagramViewModel, true);
|
||||
}
|
||||
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
@@ -113,7 +132,7 @@ namespace AIStudio.Wpf.Flowchart
|
||||
|
||||
foreach (var viewModel in DiagramViewModels)
|
||||
{
|
||||
FlowchartService.DisposeData(viewModel);
|
||||
FlowchartService.Dispose(viewModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,15 +9,15 @@ using AIStudio.Wpf.DiagramDesigner;
|
||||
|
||||
namespace AIStudio.Wpf.Logical
|
||||
{
|
||||
public class LogicalViewModel : DiagramsViewModel
|
||||
public class LogicalViewModel : PageViewModel
|
||||
{
|
||||
public LogicalViewModel(string title, string status, DiagramType diagramType) : base(title, status, diagramType)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
public LogicalViewModel(string filename, DiagramDocument diagramDocument) : base(filename, diagramDocument)
|
||||
{
|
||||
_service.DrawModeViewModel.VectorLineDrawMode = DrawMode.CornerConnectingLine;
|
||||
_service.DrawModeViewModel.LineDrawMode = DrawMode.ConnectingLineSmooth;
|
||||
}
|
||||
|
||||
protected override void InitDiagramViewModel()
|
||||
@@ -31,72 +31,88 @@ namespace AIStudio.Wpf.Logical
|
||||
DiagramViewModel.CellVerticalAlignment = CellVerticalAlignment.None;
|
||||
|
||||
DiagramViewModel.Items.CollectionChanged += Items_CollectionChanged;
|
||||
_service.DrawModeViewModel.VectorLineDrawMode = DrawMode.CornerConnectingLine;
|
||||
_service.DrawModeViewModel.LineDrawMode = DrawMode.ConnectingLineSmooth;
|
||||
}
|
||||
|
||||
protected override void Init()
|
||||
protected override void Init(bool initNew)
|
||||
{
|
||||
base.Init();
|
||||
base.Init(initNew);
|
||||
|
||||
TimerDesignerItemViewModel timer = new TimerDesignerItemViewModel() { Left = 0, Top = 10 };
|
||||
timer.Value = 0.5;
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(timer);
|
||||
TimerDesignerItemViewModel timer = new TimerDesignerItemViewModel() { Left = 28, Top = 28 };
|
||||
timer.Value = 1;
|
||||
DiagramViewModel.Add(timer);
|
||||
|
||||
InputItemViewModel in1 = new InputItemViewModel() { Left = 0, Top = 50 };
|
||||
InputItemViewModel in1 = new InputItemViewModel() { Left = 28, Top = 110 };
|
||||
in1.LinkPoint = LogicalService.LinkPoint[0];
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(in1);
|
||||
DiagramViewModel.Add(in1);
|
||||
|
||||
InputItemViewModel in2 = new InputItemViewModel() { Left = 0, Top = 80 };
|
||||
InputItemViewModel in2 = new InputItemViewModel() { Left = 28, Top = 300 };
|
||||
in2.LinkPoint = LogicalService.LinkPoint[1];
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(in2);
|
||||
DiagramViewModel.Add(in2);
|
||||
|
||||
AddGateItemViewModel item1 = new AddGateItemViewModel() { Left = 150, Top = 50 };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(item1);
|
||||
AddGateItemViewModel item1 = new AddGateItemViewModel() { Left = 178, Top = 160 };
|
||||
DiagramViewModel.Add(item1);
|
||||
|
||||
ConstantDesignerItemViewModel constant = new ConstantDesignerItemViewModel() { Left = 150, Top = 118 };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(constant);
|
||||
ConstantDesignerItemViewModel constant = new ConstantDesignerItemViewModel() { Left = 178, Top = 300, Value = 10 };
|
||||
DiagramViewModel.Add(constant);
|
||||
|
||||
GTGateItemViewModel gTGate = new GTGateItemViewModel() { Left = 300, Top = 50 };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(gTGate);
|
||||
GTGateItemViewModel gTGate = new GTGateItemViewModel() { Left = 328, Top = 110 };
|
||||
DiagramViewModel.Add(gTGate);
|
||||
|
||||
InputItemViewModel in3 = new InputItemViewModel() { Left = 300, Top = 118 };
|
||||
InputItemViewModel in3 = new InputItemViewModel() { Left = 328, Top = 210 };
|
||||
in3.LinkPoint = LogicalService.LinkPoint[2];
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(in3);
|
||||
DiagramViewModel.Add(in3);
|
||||
|
||||
InputItemViewModel in4 = new InputItemViewModel() { Left = 300, Top = 148 };
|
||||
InputItemViewModel in4 = new InputItemViewModel() { Left = 328, Top = 300 };
|
||||
in4.LinkPoint = LogicalService.LinkPoint[3];
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(in4);
|
||||
DiagramViewModel.Add(in4);
|
||||
|
||||
SELGateItemViewModel sELGate = new SELGateItemViewModel() { Left = 450, Top = 50 };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(sELGate);
|
||||
SELGateItemViewModel sELGate = new SELGateItemViewModel() { Left = 478, Top = 160 };
|
||||
DiagramViewModel.Add(sELGate);
|
||||
|
||||
OutputItemViewModel out1 = new OutputItemViewModel() { Left = 600, Top = 50 };
|
||||
OutputItemViewModel out1 = new OutputItemViewModel() { Left = 628, Top = 110 };
|
||||
out1.LinkPoint = LogicalService.LinkPoint[4];
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(out1);
|
||||
DiagramViewModel.Add(out1);
|
||||
|
||||
ConnectorViewModel connector1 = new ConnectorViewModel(in1.Output[0], item1.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector1);
|
||||
ConnectionViewModel connector1 = new ConnectionViewModel(in1.Output[0], item1.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector1.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector1.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector1);
|
||||
|
||||
ConnectorViewModel connector2 = new ConnectorViewModel(in2.Output[0], item1.Input[1], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector2);
|
||||
ConnectionViewModel connector2 = new ConnectionViewModel(in2.Output[0], item1.Input[1], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector2.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector2.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector2);
|
||||
|
||||
ConnectorViewModel connector3 = new ConnectorViewModel(item1.Output[0], gTGate.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector3);
|
||||
ConnectionViewModel connector3 = new ConnectionViewModel(item1.Output[0], gTGate.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector3.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector3.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector3);
|
||||
|
||||
ConnectorViewModel connector4 = new ConnectorViewModel(constant.Output[0], gTGate.Input[1], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector4);
|
||||
ConnectionViewModel connector4 = new ConnectionViewModel(constant.Output[0], gTGate.Input[1], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector4.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector4.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector4);
|
||||
|
||||
ConnectorViewModel connector5 = new ConnectorViewModel(gTGate.Output[0], sELGate.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector5);
|
||||
ConnectionViewModel connector5 = new ConnectionViewModel(gTGate.Output[0], sELGate.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector5.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector5.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector5);
|
||||
|
||||
ConnectorViewModel connector6 = new ConnectorViewModel(in3.Output[0], sELGate.Input[1], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector6);
|
||||
ConnectionViewModel connector6 = new ConnectionViewModel(in3.Output[0], sELGate.Input[1], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector6.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector6.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector6);
|
||||
|
||||
ConnectorViewModel connector7 = new ConnectorViewModel(in4.Output[0], sELGate.Input[2], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector7);
|
||||
ConnectionViewModel connector7 = new ConnectionViewModel(in4.Output[0], sELGate.Input[2], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector7.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector7.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector7);
|
||||
|
||||
ConnectorViewModel connector8 = new ConnectorViewModel(sELGate.Output[0], out1.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector8);
|
||||
ConnectionViewModel connector8 = new ConnectionViewModel(sELGate.Output[0], out1.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode);
|
||||
connector8.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
connector8.ColorViewModel.LineAnimation = LineAnimation.PathAnimation;
|
||||
DiagramViewModel.Add(connector8);
|
||||
}
|
||||
|
||||
private void Items_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
|
||||
@@ -124,11 +140,11 @@ namespace AIStudio.Wpf.Logical
|
||||
if (base.AddVerify(arg) == false)
|
||||
return false;
|
||||
|
||||
if (arg is ConnectorViewModel connector)
|
||||
if (arg is ConnectionViewModel connector)
|
||||
{
|
||||
if (connector.SinkConnectorInfo is FullyCreatedConnectorInfo fully)
|
||||
if (connector.IsFullConnection)
|
||||
{
|
||||
if (DiagramViewModel.Items.OfType<ConnectorViewModel>().Any(p => p.SinkConnectorInfo == fully))
|
||||
if (DiagramViewModel.Items.OfType<ConnectionViewModel>().Any(p => p.SinkConnectorInfo == connector.SinkConnectorInfoFully))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -148,276 +164,16 @@ namespace AIStudio.Wpf.Logical
|
||||
|
||||
private void Do()
|
||||
{
|
||||
foreach (var item in DiagramViewModel.Items.OfType<ConstantDesignerItemViewModel>())
|
||||
Random rd = new Random();
|
||||
foreach (var link in LogicalService.LinkPoint)
|
||||
{
|
||||
foreach (var output in item.Output)
|
||||
{
|
||||
output.Value.ConnectorValue = item.Value;
|
||||
output.Value.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in DiagramViewModel.Items.OfType<InputItemViewModel>())
|
||||
{
|
||||
if (item.LinkPoint != null)
|
||||
{
|
||||
foreach (var output in item.Output)
|
||||
{
|
||||
output.Value.ConnectorValue = item.LinkPoint.Value;
|
||||
output.Value.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
}
|
||||
}
|
||||
link.Value = rd.NextDouble() * 10;
|
||||
}
|
||||
|
||||
foreach (var item in DiagramViewModel.Items.OfType<LogicalGateItemViewModelBase>().OrderBy(p => p.OrderNumber))
|
||||
{
|
||||
if (item.LogicalType != LogicalType.None)
|
||||
{
|
||||
foreach (var input in item.Input)
|
||||
{
|
||||
var connector = GetSourceItem(input.Value);
|
||||
if (connector == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (connector.SourceConnectorInfo.DataItem is LogicalGateItemViewModelBase)
|
||||
{
|
||||
input.Value.ConnectorValue = connector.SourceConnectorInfo.ConnectorValue;
|
||||
|
||||
input.Value.ColorViewModel.FillColor.Color = connector.SourceConnectorInfo.ColorViewModel.FillColor.Color;
|
||||
connector.ColorViewModel.LineColor.Color = connector.SourceConnectorInfo.ColorViewModel.FillColor.Color;
|
||||
|
||||
if (item.LogicalType == LogicalType.Output)
|
||||
{
|
||||
input.Value.ValueTypePoint = connector.SourceConnectorInfo.ValueTypePoint;
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.NOT)
|
||||
{
|
||||
input.Value.ValueTypePoint = (connector.SourceConnectorInfo.ValueTypePoint == ValueTypePoint.Bool) ? ValueTypePoint.Bool : ValueTypePoint.Int;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var output in item.Output)
|
||||
{
|
||||
if (item.LogicalType == LogicalType.Output)
|
||||
{
|
||||
var first = item.Input.Values.FirstOrDefault();
|
||||
output.Value.ConnectorValue = first.ConnectorValue;
|
||||
output.Value.ValueTypePoint = first.ValueTypePoint;
|
||||
(item as OutputItemViewModel).Value = first.ConnectorValue;
|
||||
(item as OutputItemViewModel).LinkPoint.Value = first.ConnectorValue;
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.ADD)
|
||||
{
|
||||
output.Value.ConnectorValue = item.Input.Values.Select(p => p.ConnectorValue).Sum();
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.SUB)
|
||||
{
|
||||
var first = item.Input.Values.Select(p => p.ConnectorValue).FirstOrDefault();
|
||||
var second = item.Input.Values.Where((value, index) => index != 0).Select(p => p.ConnectorValue).Sum();
|
||||
output.Value.ConnectorValue = first - second;
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.MUL)
|
||||
{
|
||||
double result = 0;
|
||||
foreach (var input in item.Input.Values)
|
||||
{
|
||||
if (result == 0)
|
||||
{
|
||||
result = 1;
|
||||
}
|
||||
result *= input.ConnectorValue;
|
||||
}
|
||||
output.Value.ConnectorValue = result;
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.DIV)
|
||||
{
|
||||
double result = item.Input.Values.Select(p => p.ConnectorValue).FirstOrDefault();
|
||||
foreach (var input in item.Input.Values.Where((value, index) => index != 0))
|
||||
{
|
||||
result /= input.ConnectorValue;
|
||||
}
|
||||
output.Value.ConnectorValue = result;
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.AVE)
|
||||
{
|
||||
output.Value.ConnectorValue = item.Input.Values.Select(p => p.ConnectorValue).Average();
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.MOD)
|
||||
{
|
||||
output.Value.ConnectorValue = item.Input[0].ConnectorValue % item.Input[1].ConnectorValue;
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.AND)
|
||||
{
|
||||
output.Value.ConnectorValue = Convert.ToInt32(item.Input[0].ConnectorValue) & Convert.ToInt32(item.Input[1].ConnectorValue);
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.OR)
|
||||
{
|
||||
output.Value.ConnectorValue = Convert.ToInt32(item.Input[0].ConnectorValue) | Convert.ToInt32(item.Input[1].ConnectorValue);
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.XOR)
|
||||
{
|
||||
output.Value.ConnectorValue = Convert.ToInt32(Convert.ToInt32(item.Input[0].ConnectorValue) ^ Convert.ToInt32(item.Input[1].ConnectorValue));
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.NOT)
|
||||
{
|
||||
if (item.Input[0].ValueTypePoint == ValueTypePoint.Bool)
|
||||
{
|
||||
output.Value.ConnectorValue = Convert.ToInt32(!Convert.ToBoolean(item.Input[0].ConnectorValue));
|
||||
output.Value.ValueTypePoint = ValueTypePoint.Bool;
|
||||
}
|
||||
else
|
||||
{
|
||||
output.Value.ConnectorValue = ~Convert.ToInt32(item.Input[0].ConnectorValue);
|
||||
output.Value.ValueTypePoint = ValueTypePoint.Int;
|
||||
}
|
||||
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.SHL)
|
||||
{
|
||||
output.Value.ConnectorValue = Convert.ToInt32(item.Input[0].ConnectorValue) << Convert.ToInt32(item.Input[1].ConnectorValue);
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.SHR)
|
||||
{
|
||||
output.Value.ConnectorValue = Convert.ToInt32(item.Input[0].ConnectorValue) >> Convert.ToInt32(item.Input[1].ConnectorValue);
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.ROL)
|
||||
{
|
||||
output.Value.ConnectorValue = (Convert.ToInt32(item.Input[0].ConnectorValue) << Convert.ToInt32(item.Input[1].ConnectorValue)) | (Convert.ToInt32(item.Input[0].ConnectorValue) >> 32 - Convert.ToInt32(item.Input[1].ConnectorValue));
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.ROR)
|
||||
{
|
||||
output.Value.ConnectorValue = (Convert.ToInt32(item.Input[0].ConnectorValue) >> Convert.ToInt32(item.Input[1].ConnectorValue)) | (Convert.ToInt32(item.Input[0].ConnectorValue) << 32 - Convert.ToInt32(item.Input[1].ConnectorValue));
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.SEL)
|
||||
{
|
||||
output.Value.ConnectorValue = (item.Input[0].ConnectorValue == output.Key) ? item.Input[1].ConnectorValue : item.Input[2].ConnectorValue;
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.MAX)
|
||||
{
|
||||
output.Value.ConnectorValue = item.Input.Values.Select(p => p.ConnectorValue).Max();
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.MIN)
|
||||
{
|
||||
output.Value.ConnectorValue = item.Input.Values.Select(p => p.ConnectorValue).Min();
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.LIMIT)
|
||||
{
|
||||
output.Value.ConnectorValue = (item.Input[0].ConnectorValue > item.Input[1].ConnectorValue) ? item.Input[1].ConnectorValue : item.Input[0].ConnectorValue;
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.GT)
|
||||
{
|
||||
output.Value.ConnectorValue = (item.Input[0].ConnectorValue > item.Input[1].ConnectorValue) ? 1 : 0;
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.LT)
|
||||
{
|
||||
output.Value.ConnectorValue = (item.Input[0].ConnectorValue < item.Input[1].ConnectorValue) ? 1 : 0;
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.GE)
|
||||
{
|
||||
output.Value.ConnectorValue = (item.Input[0].ConnectorValue >= item.Input[1].ConnectorValue) ? 1 : 0;
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.LE)
|
||||
{
|
||||
output.Value.ConnectorValue = (item.Input[0].ConnectorValue <= item.Input[1].ConnectorValue) ? 1 : 0;
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.EQ)
|
||||
{
|
||||
output.Value.ConnectorValue = (item.Input[0].ConnectorValue == item.Input[1].ConnectorValue) ? 1 : 0;
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.NE)
|
||||
{
|
||||
output.Value.ConnectorValue = (item.Input[0].ConnectorValue != item.Input[1].ConnectorValue) ? 1 : 0;
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.ABS)
|
||||
{
|
||||
output.Value.ConnectorValue = Math.Abs(item.Input[0].ConnectorValue);
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.SQRT)
|
||||
{
|
||||
output.Value.ConnectorValue = Math.Sqrt(item.Input[0].ConnectorValue);
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.LN)
|
||||
{
|
||||
output.Value.ConnectorValue = Math.Log10(item.Input[0].ConnectorValue);
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.LOG)
|
||||
{
|
||||
output.Value.ConnectorValue = Math.Log(item.Input[0].ConnectorValue);
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.EXP)
|
||||
{
|
||||
output.Value.ConnectorValue = Math.Exp(item.Input[0].ConnectorValue);
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.SIN)
|
||||
{
|
||||
output.Value.ConnectorValue = Math.Sin(item.Input[0].ConnectorValue);
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.COS)
|
||||
{
|
||||
output.Value.ConnectorValue = Math.Cos(item.Input[0].ConnectorValue);
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.TAN)
|
||||
{
|
||||
output.Value.ConnectorValue = Math.Tan(item.Input[0].ConnectorValue);
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.ASIN)
|
||||
{
|
||||
output.Value.ConnectorValue = Math.Asin(item.Input[0].ConnectorValue);
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.ACOS)
|
||||
{
|
||||
output.Value.ConnectorValue = Math.Acos(item.Input[0].ConnectorValue);
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.ATAN)
|
||||
{
|
||||
output.Value.ConnectorValue = Math.Atan(item.Input[0].ConnectorValue);
|
||||
}
|
||||
else if (item.LogicalType == LogicalType.EXPT)
|
||||
{
|
||||
output.Value.ConnectorValue = Math.Exp(item.Input[0].ConnectorValue);
|
||||
}
|
||||
|
||||
if (output.Value.ValueTypePoint == ValueTypePoint.Bool)
|
||||
{
|
||||
if (output.Value.ConnectorValue == 0)
|
||||
{
|
||||
output.Value.ColorViewModel.FillColor.Color = Colors.Red;
|
||||
if (item.LogicalType == LogicalType.Output)
|
||||
{
|
||||
item.ColorViewModel.FillColor.Color = Colors.Red;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
output.Value.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
if (item.LogicalType == LogicalType.Output)
|
||||
{
|
||||
item.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
output.Value.ColorViewModel.FillColor.Color = Colors.Green;
|
||||
}
|
||||
}
|
||||
}
|
||||
item.Execute();
|
||||
}
|
||||
}
|
||||
|
||||
private ConnectorViewModel GetSourceItem(FullyCreatedConnectorInfo sinkConnector)
|
||||
{
|
||||
foreach (var connector in DiagramViewModel.Items.OfType<ConnectorViewModel>())
|
||||
{
|
||||
if (connector.SinkConnectorInfo == sinkConnector)
|
||||
{
|
||||
return connector;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
128
AIStudio.Wpf.DiagramApp/ViewModels/MindViewModel.cs
Normal file
@@ -0,0 +1,128 @@
|
||||
using AIStudio.Wpf.DiagramApp.Models;
|
||||
using AIStudio.Wpf.DiagramApp.ViewModels;
|
||||
using AIStudio.Wpf.Flowchart.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using AIStudio.Wpf.Mind.ViewModels;
|
||||
using AIStudio.Wpf.Mind;
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals;
|
||||
using AIStudio.Wpf.Mind.Helpers;
|
||||
using AIStudio.Wpf.Mind.Models;
|
||||
|
||||
namespace AIStudio.Wpf.Flowchart
|
||||
{
|
||||
public class MindViewModel : PageViewModel
|
||||
{
|
||||
public MindViewModel(string title, string status, DiagramType diagramType, MindType mindType) : base(title, status, diagramType, mindType.ToString())
|
||||
{
|
||||
|
||||
}
|
||||
public MindViewModel(string filename, DiagramDocument diagramDocument) : base(filename, diagramDocument)
|
||||
{
|
||||
foreach (var vm in DiagramViewModels)
|
||||
{
|
||||
vm.Init(false);
|
||||
}
|
||||
|
||||
if (MindDiagramViewModel != null)
|
||||
{
|
||||
SubType = MindDiagramViewModel.MindType.ToString();
|
||||
MindTheme = MindDiagramViewModel.MindTheme;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void InitDiagramViewModel()
|
||||
{
|
||||
base.InitDiagramViewModel();
|
||||
|
||||
DiagramViewModel.GridCellSize = new Size(100, 100);
|
||||
DiagramViewModel.ShowGrid = false;
|
||||
DiagramViewModel.AllowDrop = false;
|
||||
}
|
||||
|
||||
public IMindDiagramViewModel MindDiagramViewModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return DiagramViewModel as IMindDiagramViewModel;
|
||||
}
|
||||
}
|
||||
|
||||
public MindType MindType
|
||||
{
|
||||
get
|
||||
{
|
||||
if (SubType == null)
|
||||
{
|
||||
return MindType.Mind;
|
||||
}
|
||||
else
|
||||
{
|
||||
return SubType.ToEnum<MindType>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public MindTheme MindTheme
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
protected override void Init(bool initNew)
|
||||
{
|
||||
DiagramViewModels = new ObservableCollection<IDiagramViewModel>()
|
||||
{
|
||||
GetDiagramViewModel("页-1", DiagramType, initNew),
|
||||
};
|
||||
DiagramViewModel = DiagramViewModels.FirstOrDefault();
|
||||
|
||||
InitDiagramViewModel();
|
||||
var level1node = MindDiagramViewModel.RootItems.FirstOrDefault();
|
||||
|
||||
MindNode level2node1_1 = new MindNode(DiagramViewModel) { Text = "分支主题1" };
|
||||
level2node1_1.AddTo(level1node, 0, false);
|
||||
|
||||
MindNode level2node1_1_1 = new MindNode(DiagramViewModel) { Text = "分支主题1_1" };
|
||||
level2node1_1_1.AddTo(level2node1_1, 0, false);
|
||||
|
||||
MindNode level2node1_1_2 = new MindNode(DiagramViewModel) { Text = "分支主题1_2" };
|
||||
level2node1_1_2.AddTo(level2node1_1, 0, false);
|
||||
|
||||
MindNode level2node1_1_3 = new MindNode(DiagramViewModel) { Text = "分支主题1_3" };
|
||||
level2node1_1_3.AddTo(level2node1_1, 0, false);
|
||||
|
||||
MindNode level2node1_2 = new MindNode(DiagramViewModel) { Text = "分支主题2" };
|
||||
level2node1_2.AddTo(level1node, 0, false);
|
||||
|
||||
MindNode level2node1_3 = new MindNode(DiagramViewModel) { Text = "分支主题3" };
|
||||
level2node1_3.AddTo(level1node, 0, false);
|
||||
|
||||
DiagramViewModel.Init(initNew);
|
||||
}
|
||||
|
||||
protected override DiagramViewModel GetDiagramViewModel(string name, DiagramType diagramType, bool initNew)
|
||||
{
|
||||
var viewmodel = new MindDiagramViewModel() { Name = name ?? NewNameHelper.GetNewName(DiagramViewModels.Select(p => p.Name), "页-"), DiagramType = diagramType, MindType = MindType, MindTheme = MindTheme };
|
||||
viewmodel.Init(initNew);
|
||||
|
||||
return viewmodel;
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
base.Dispose();
|
||||
|
||||
foreach (var viewModel in DiagramViewModels)
|
||||
{
|
||||
FlowchartService.Dispose(viewModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
661
AIStudio.Wpf.DiagramApp/ViewModels/PageViewModel.cs
Normal file
@@ -0,0 +1,661 @@
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals.Commands;
|
||||
using AIStudio.Wpf.Flowchart;
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.ViewModels;
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals;
|
||||
using AIStudio.Wpf.DiagramApp.Models;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Xml.Serialization;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using ZXing;
|
||||
using AIStudio.Wpf.DiagramDesigner.Helpers;
|
||||
using AIStudio.Wpf.DiagramDesigner.ViewModels;
|
||||
using AIStudio.Wpf.DiagramDesigner.ViewModels.BaseViewModel;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
{
|
||||
public partial class PageViewModel : BindableBase
|
||||
{
|
||||
#region 初始化
|
||||
protected IDiagramServiceProvider _service
|
||||
{
|
||||
get
|
||||
{
|
||||
return DiagramServicesProvider.Instance.Provider;
|
||||
}
|
||||
}
|
||||
|
||||
public PageViewModel(string title, string status, DiagramType diagramType, string subType = null)
|
||||
{
|
||||
Title = title;
|
||||
Status = status;
|
||||
DiagramType = diagramType;
|
||||
SubType = subType;
|
||||
Init(true);
|
||||
}
|
||||
public PageViewModel(string filename)
|
||||
{
|
||||
FileName = filename;
|
||||
string ext = Path.GetExtension(filename);
|
||||
var diagramDocument = OpenFile(filename, ext);
|
||||
OpenFile(diagramDocument, ext);
|
||||
}
|
||||
|
||||
public PageViewModel(string filename, DiagramDocument diagramDocument)
|
||||
{
|
||||
FileName = filename;
|
||||
string ext = Path.GetExtension(filename);
|
||||
OpenFile(diagramDocument, ext);
|
||||
}
|
||||
|
||||
protected virtual void InitDiagramViewModel()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected virtual void Init(bool initNew)
|
||||
{
|
||||
DiagramViewModels = new ObservableCollection<IDiagramViewModel>()
|
||||
{
|
||||
GetDiagramViewModel("页-1", DiagramType,initNew),
|
||||
};
|
||||
DiagramViewModel = DiagramViewModels.FirstOrDefault();
|
||||
|
||||
InitDiagramViewModel();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 属性
|
||||
public string FileName
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
private string _title;
|
||||
public string Title
|
||||
{
|
||||
get
|
||||
{
|
||||
return _title;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _title, value);
|
||||
}
|
||||
}
|
||||
|
||||
private string _status;
|
||||
public string Status
|
||||
{
|
||||
get
|
||||
{
|
||||
return _status;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _status, value);
|
||||
}
|
||||
}
|
||||
|
||||
private bool _showGrid;
|
||||
public bool ShowGrid
|
||||
{
|
||||
get
|
||||
{
|
||||
return _showGrid;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (SetProperty(ref _showGrid, value))
|
||||
{
|
||||
foreach (var item in DiagramViewModels)
|
||||
{
|
||||
item.ShowGrid = _showGrid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DiagramType DiagramType
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string SubType
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
private ObservableCollection<IDiagramViewModel> _diagramViewModels;
|
||||
public ObservableCollection<IDiagramViewModel> DiagramViewModels
|
||||
{
|
||||
get
|
||||
{
|
||||
return _diagramViewModels;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _diagramViewModels, value);
|
||||
}
|
||||
}
|
||||
|
||||
private IDiagramViewModel _diagramViewModel;
|
||||
public IDiagramViewModel DiagramViewModel
|
||||
{
|
||||
get
|
||||
{
|
||||
return _diagramViewModel;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (_diagramViewModel != value)
|
||||
{
|
||||
if (_diagramViewModel != null)
|
||||
{
|
||||
_diagramViewModel.PropertyChanged -= DiagramViewModel_PropertyChanged;
|
||||
}
|
||||
SetProperty(ref _diagramViewModel, value);
|
||||
if (_diagramViewModel != null)
|
||||
{
|
||||
_diagramViewModel.PropertyChanged += DiagramViewModel_PropertyChanged;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 命令
|
||||
private ICommand _addPageCommand;
|
||||
public ICommand AddPageCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._addPageCommand ?? (this._addPageCommand = new DelegateCommand<object>(para => this.AddPageExecuted(para)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private ICommand _addCopyPageCommand;
|
||||
public ICommand AddCopyPageCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._addCopyPageCommand ?? (this._addCopyPageCommand = new DelegateCommand<object>(para => this.AddCopyPageExecuted(para)));
|
||||
}
|
||||
}
|
||||
|
||||
private ICommand _renamePageCommand;
|
||||
public ICommand RenamePageCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._renamePageCommand ?? (this._renamePageCommand = new DelegateCommand<object>(para => this.RenamePageExecuted(para)));
|
||||
}
|
||||
}
|
||||
|
||||
private ICommand _endRenamePageCommand;
|
||||
public ICommand EndRenamePageCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._endRenamePageCommand ?? (this._endRenamePageCommand = new DelegateCommand<object>(para => this.EndRenamePageExecuted(para)));
|
||||
}
|
||||
}
|
||||
|
||||
private ICommand _deletePageCommand;
|
||||
public ICommand DeletePageCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._deletePageCommand ?? (this._deletePageCommand = new DelegateCommand<object>(para => this.DeletePageExecuted(para)));
|
||||
}
|
||||
}
|
||||
|
||||
private ICommand _addImageCommand;
|
||||
public ICommand AddImageCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._addImageCommand ?? (this._addImageCommand = new DelegateCommand<object>(para => this.AddImageExecuted(para)));
|
||||
}
|
||||
}
|
||||
|
||||
private ICommand _editImageCommand;
|
||||
public ICommand EditImageCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._editImageCommand ?? (this._editImageCommand = new DelegateCommand<object>(para => this.EditImageExecuted(para)));
|
||||
}
|
||||
}
|
||||
|
||||
private ICommand _resizeImageCommand;
|
||||
public ICommand ResizeImageCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._resizeImageCommand ?? (this._resizeImageCommand = new DelegateCommand<object>(para => this.ResizeImageExecuted(para)));
|
||||
}
|
||||
}
|
||||
|
||||
private ICommand _resetImageCommand;
|
||||
public ICommand ResetImageCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._resetImageCommand ?? (this._resetImageCommand = new DelegateCommand<object>(para => this.ResetImageExecuted(para)));
|
||||
}
|
||||
}
|
||||
|
||||
private ICommand _addVideoCommand;
|
||||
public ICommand AddVideoCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._addVideoCommand ?? (this._addVideoCommand = new DelegateCommand<object>(para => this.AddVideoExectued(para)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private ICommand _addOutLineTextCommand;
|
||||
public ICommand AddOutLineTextCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._addOutLineTextCommand ?? (this._addOutLineTextCommand = new DelegateCommand<object>(para => this.AddOutLineTextExecuted(para)));
|
||||
}
|
||||
}
|
||||
|
||||
private ICommand _addBarcodeCommand;
|
||||
public ICommand AddBarcodeCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._addBarcodeCommand ?? (this._addBarcodeCommand = new DelegateCommand<object>(para => this.AddBarcodeExecuted(para)));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 属性改变
|
||||
private void DiagramViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == "IsSelected")
|
||||
{
|
||||
_service.SelectedItemViewModel = CopyHelper.Mapper(DiagramViewModel?.SelectedItem);
|
||||
return;
|
||||
}
|
||||
|
||||
var property = sender.GetType().GetProperty(e.PropertyName);
|
||||
var attr = property.GetCustomAttributes(typeof(BrowsableAttribute), true);
|
||||
if (attr != null && attr.OfType<BrowsableAttribute>().FirstOrDefault()?.Browsable != true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Status = "*";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 方法
|
||||
protected virtual bool AddVerify(SelectableDesignerItemViewModelBase arg)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public static DiagramDocument OpenFile(string filename, string ext)
|
||||
{
|
||||
try
|
||||
{
|
||||
DiagramDocument diagramDocument = null;
|
||||
|
||||
if (ext == ".xml")
|
||||
{
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(DiagramDocument));
|
||||
FileInfo fileInfo = new FileInfo(filename);
|
||||
|
||||
using (TextReader reader = fileInfo.OpenText())
|
||||
{
|
||||
diagramDocument = (DiagramDocument)serializer.Deserialize(reader);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
diagramDocument = JsonConvert.DeserializeObject<DiagramDocument>(File.ReadAllText(filename));
|
||||
}
|
||||
|
||||
return diagramDocument;
|
||||
}
|
||||
catch (System.IO.FileNotFoundException fnfe)
|
||||
{
|
||||
throw new FileNotFoundException("The system document could not be found ", fnfe);
|
||||
}
|
||||
catch (System.IO.DirectoryNotFoundException dnfe)
|
||||
{
|
||||
throw new DirectoryNotFoundException("A required directory was nt found", dnfe);
|
||||
}
|
||||
catch (System.IO.IOException ioe)
|
||||
{
|
||||
throw new IOException("A file system error occurred", ioe);
|
||||
}
|
||||
catch (System.UnauthorizedAccessException uae)
|
||||
{
|
||||
throw new UnauthorizedAccessException("The requested file system access wasnot granted", uae);
|
||||
}
|
||||
catch (System.Security.SecurityException se)
|
||||
{
|
||||
throw new System.Security.SecurityException("The security policy prevents access to a file system resource", se);
|
||||
}
|
||||
catch (System.Exception e)
|
||||
{
|
||||
throw new System.Exception(
|
||||
string.Format("The database format vc invalid \r\n Exception:{0} \r\n InnerException:{1}", e.Message, e.InnerException.Message));
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OpenFile(DiagramDocument diagramDocument, string ext)
|
||||
{
|
||||
Title = diagramDocument.Title;
|
||||
DiagramType = diagramDocument.DiagramType;
|
||||
|
||||
List<DiagramViewModel> viewModels = new List<DiagramViewModel>();
|
||||
foreach (var diagramItem in diagramDocument.DiagramItems)
|
||||
{
|
||||
var viewModel = GetDiagramViewModel(diagramItem.Name, diagramItem.DiagramType, false);
|
||||
viewModel.ShowGrid = diagramItem.ShowGrid;
|
||||
viewModel.PhysicalGridCellSize = diagramItem.PhysicalGridCellSize;
|
||||
viewModel.CellHorizontalAlignment = diagramItem.CellHorizontalAlignment;
|
||||
viewModel.CellVerticalAlignment = diagramItem.CellVerticalAlignment;
|
||||
viewModel.PageSizeOrientation = diagramItem.PageSizeOrientation;
|
||||
viewModel.PhysicalPageSize = diagramItem.PhysicalPageSize;
|
||||
viewModel.PageSizeType = diagramItem.PageSizeType;
|
||||
viewModel.PhysicalGridMarginSize = diagramItem.PhysicalGridMarginSize;
|
||||
viewModel.GridColor = diagramItem.GridColor;
|
||||
viewModel.AllowDrop = diagramItem.AllowDrop;
|
||||
|
||||
foreach (var diagramItemData in diagramItem.DesignerItems)
|
||||
{
|
||||
Type type = TypeHelper.GetType(diagramItemData.ModelTypeName);
|
||||
DesignerItemViewModelBase itemBase = Activator.CreateInstance(type, viewModel, diagramItemData, ext) as DesignerItemViewModelBase;
|
||||
viewModel.Items.Add(itemBase);
|
||||
}
|
||||
|
||||
foreach (var connection in diagramItem.Connections)
|
||||
{
|
||||
Type type = TypeHelper.GetType(connection.SerializableTypeName);
|
||||
var connectionItem = SerializeHelper.DeserializeObject(type, connection.SerializableString, ext) as ConnectionItem;
|
||||
|
||||
connectionItem.SourceType = System.Type.GetType(connectionItem.SourceTypeName);
|
||||
connectionItem.SinkType = System.Type.GetType(connectionItem.SinkTypeName);
|
||||
DesignerItemViewModelBase sourceItem = DiagramViewModelHelper.GetConnectorDataItem(viewModel.Items, connectionItem.SourceId, connectionItem.SourceType);
|
||||
ConnectorOrientation sourceConnectorOrientation = connectionItem.SourceOrientation;
|
||||
FullyCreatedConnectorInfo sourceConnectorInfo = sourceItem.GetFullConnectorInfo(connectionItem.Id, sourceConnectorOrientation, connectionItem.SourceXRatio, connectionItem.SourceYRatio, connectionItem.SourceInnerPoint, connectionItem.SourceInnerPoint);
|
||||
|
||||
DesignerItemViewModelBase sinkItem = DiagramViewModelHelper.GetConnectorDataItem(viewModel.Items, connectionItem.SinkId, connectionItem.SinkType);
|
||||
ConnectorOrientation sinkConnectorOrientation = connectionItem.SinkOrientation;
|
||||
FullyCreatedConnectorInfo sinkConnectorInfo = sinkItem.GetFullConnectorInfo(connectionItem.Id, sinkConnectorOrientation, connectionItem.SinkXRatio, connectionItem.SinkYRatio, connectionItem.SinkInnerPoint, connectionItem.SinkInnerPoint);
|
||||
|
||||
ConnectionViewModel connectionVM = new ConnectionViewModel(viewModel, sourceConnectorInfo, sinkConnectorInfo, connectionItem);
|
||||
connectionVM.Id = Guid.NewGuid();
|
||||
viewModel.Items.Add(connectionVM);
|
||||
}
|
||||
|
||||
viewModels.Add(viewModel);
|
||||
}
|
||||
DiagramViewModels = new ObservableCollection<IDiagramViewModel>(viewModels);
|
||||
DiagramViewModel = DiagramViewModels.FirstOrDefault();
|
||||
}
|
||||
|
||||
public bool SaveFile(bool isSaveAs = false)
|
||||
{
|
||||
string filter = "Files (*.xml)|*.xml|Files (*.json)|*.json|All Files (*.*)|*.*";
|
||||
|
||||
if (string.IsNullOrEmpty(FileName) || isSaveAs == true)
|
||||
{
|
||||
Microsoft.Win32.SaveFileDialog saveFile = new Microsoft.Win32.SaveFileDialog();
|
||||
saveFile.Filter = filter;
|
||||
if (saveFile.ShowDialog() == true)
|
||||
{
|
||||
FileName = saveFile.FileName;
|
||||
Title = Path.GetFileNameWithoutExtension(FileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var ext = Path.GetExtension(FileName);
|
||||
|
||||
DiagramDocument diagramDocument = new DiagramDocument();
|
||||
diagramDocument.DiagramItems = new List<DiagramItem>();
|
||||
diagramDocument.Title = Title;
|
||||
diagramDocument.DiagramType = DiagramType;
|
||||
|
||||
foreach (var viewModel in DiagramViewModels)
|
||||
{
|
||||
DiagramItem diagramItem = new DiagramItem(viewModel);
|
||||
|
||||
var selectedDesignerItems = viewModel.Items.OfType<DesignerItemViewModelBase>();
|
||||
var selectedConnections = viewModel.Items.OfType<ConnectionViewModel>();
|
||||
|
||||
diagramItem.DesignerItems = selectedDesignerItems.Select(p => p.ToSerializableItem(ext)).Where(p => p != null).ToList();
|
||||
diagramItem.Connections = selectedConnections.Select(p => p.ToSerializableItem(ext)).Where(p => p != null).ToList();
|
||||
|
||||
diagramDocument.DiagramItems.Add(diagramItem);
|
||||
}
|
||||
|
||||
if (ext == ".xml")
|
||||
{
|
||||
FileInfo file = new FileInfo(FileName);
|
||||
diagramDocument.Save(file);
|
||||
}
|
||||
else
|
||||
{
|
||||
File.WriteAllText(FileName, JsonConvert.SerializeObject(diagramDocument));
|
||||
}
|
||||
Status = "";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual void AddPageExecuted(object para)
|
||||
{
|
||||
int index = 0;
|
||||
if (para is DiagramViewModel oldpage)
|
||||
{
|
||||
index = DiagramViewModels.IndexOf(oldpage) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
index = DiagramViewModels.Count;
|
||||
}
|
||||
var page = GetDiagramViewModel(null, DiagramType, true);
|
||||
DiagramViewModels.Insert(index, page);
|
||||
DiagramViewModel = page;
|
||||
InitDiagramViewModel();
|
||||
}
|
||||
|
||||
protected virtual DiagramViewModel GetDiagramViewModel(string name, DiagramType diagramType, bool initNew)
|
||||
{
|
||||
return new DiagramViewModel() { Name = name ?? NewNameHelper.GetNewName(DiagramViewModels.Select(p => p.Name), "页-"), DiagramType = diagramType };
|
||||
}
|
||||
|
||||
public void AddCopyPageExecuted(object para)
|
||||
{
|
||||
if (DiagramViewModel != null)
|
||||
{
|
||||
var viewModel = DiagramViewModel;
|
||||
DiagramItem diagramItem = new DiagramItem(viewModel);
|
||||
|
||||
var selectedDesignerItems = viewModel.Items.OfType<DesignerItemViewModelBase>();
|
||||
var selectedConnections = viewModel.Items.OfType<ConnectionViewModel>();
|
||||
|
||||
diagramItem.DesignerItems = selectedDesignerItems.Select(p => p.ToSerializableItem("json")).Where(p => p != null).ToList();
|
||||
diagramItem.Connections = selectedConnections.Select(p => p.ToSerializableItem("json")).Where(p => p != null).ToList();
|
||||
|
||||
viewModel = new DiagramViewModel(diagramItem);
|
||||
viewModel.Name = NewNameHelper.GetNewName(DiagramViewModels.Select(p => p.Name), "页-");
|
||||
|
||||
foreach (var diagramItemData in diagramItem.DesignerItems)
|
||||
{
|
||||
Type type = TypeHelper.GetType(diagramItemData.ModelTypeName);
|
||||
DesignerItemViewModelBase itemBase = Activator.CreateInstance(type, viewModel, diagramItemData, "json") as DesignerItemViewModelBase;
|
||||
viewModel.Items.Add(itemBase);
|
||||
}
|
||||
|
||||
foreach (var connection in diagramItem.Connections)
|
||||
{
|
||||
var connectionItem = JsonConvert.DeserializeObject<ConnectionItem>(connection.SerializableString);
|
||||
|
||||
connectionItem.SourceType = System.Type.GetType(connectionItem.SourceTypeName);
|
||||
connectionItem.SinkType = System.Type.GetType(connectionItem.SinkTypeName);
|
||||
DesignerItemViewModelBase sourceItem = DiagramViewModelHelper.GetConnectorDataItem(viewModel.Items, connectionItem.SourceId, connectionItem.SourceType);
|
||||
ConnectorOrientation sourceConnectorOrientation = connectionItem.SourceOrientation;
|
||||
FullyCreatedConnectorInfo sourceConnectorInfo = sourceItem.GetFullConnectorInfo(connectionItem.Id, sourceConnectorOrientation, connectionItem.SourceXRatio, connectionItem.SourceYRatio, connectionItem.SourceInnerPoint, connectionItem.SourceIsPortless);
|
||||
|
||||
DesignerItemViewModelBase sinkItem = DiagramViewModelHelper.GetConnectorDataItem(viewModel.Items, connectionItem.SinkId, connectionItem.SinkType);
|
||||
ConnectorOrientation sinkConnectorOrientation = connectionItem.SinkOrientation;
|
||||
FullyCreatedConnectorInfo sinkConnectorInfo = sinkItem.GetFullConnectorInfo(connectionItem.Id, sinkConnectorOrientation, connectionItem.SinkXRatio, connectionItem.SinkYRatio, connectionItem.SinkInnerPoint, connectionItem.SinkIsPortless);
|
||||
|
||||
ConnectionViewModel connectionVM = new ConnectionViewModel(viewModel, sourceConnectorInfo, sinkConnectorInfo, connectionItem);
|
||||
connectionVM.Id = Guid.NewGuid();
|
||||
viewModel.Items.Add(connectionVM);
|
||||
}
|
||||
|
||||
DiagramViewModels.Add(viewModel);
|
||||
DiagramViewModel = viewModel;
|
||||
InitDiagramViewModel();
|
||||
}
|
||||
}
|
||||
|
||||
public void DeletePageExecuted(object para)
|
||||
{
|
||||
if (para is DiagramViewModel oldpage)
|
||||
{
|
||||
int index = DiagramViewModels.IndexOf(oldpage) - 1;
|
||||
DiagramViewModels.Remove(oldpage);
|
||||
if (index > 0)
|
||||
{
|
||||
DiagramViewModel = DiagramViewModels[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
DiagramViewModel = DiagramViewModels.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void RenamePageExecuted(object para)
|
||||
{
|
||||
if (para is DiagramViewModel oldpage)
|
||||
{
|
||||
oldpage.IsEditName = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void EndRenamePageExecuted(object para)
|
||||
{
|
||||
if (para is DiagramViewModel oldpage)
|
||||
{
|
||||
oldpage.IsEditName = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddImageExecuted(object para)
|
||||
{
|
||||
ImageItemViewModel itemBase = new ImageItemViewModel();
|
||||
DiagramViewModel?.AddItemCommand.Execute(itemBase);
|
||||
if (itemBase.Root != null)
|
||||
{
|
||||
_service.DrawModeViewModel.CursorMode = CursorMode.Move;
|
||||
}
|
||||
}
|
||||
|
||||
public void EditImageExecuted(object para)
|
||||
{
|
||||
if (para == null)
|
||||
{
|
||||
para = DiagramViewModel.SelectedItem;
|
||||
}
|
||||
|
||||
ImageItemViewModel itemBase = para as ImageItemViewModel;
|
||||
if (itemBase != null)
|
||||
{
|
||||
itemBase.EditData();
|
||||
}
|
||||
}
|
||||
|
||||
public void ResizeImageExecuted(object para)
|
||||
{
|
||||
if (para == null)
|
||||
{
|
||||
para = DiagramViewModel.SelectedItem;
|
||||
}
|
||||
|
||||
ImageItemViewModel itemBase = para as ImageItemViewModel;
|
||||
if (itemBase != null)
|
||||
{
|
||||
itemBase.StartResize();
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetImageExecuted(object para)
|
||||
{
|
||||
if (para == null)
|
||||
{
|
||||
para = DiagramViewModel.SelectedItem;
|
||||
}
|
||||
ImageItemViewModel itemBase = para as ImageItemViewModel;
|
||||
if (itemBase != null)
|
||||
{
|
||||
itemBase.Reset();
|
||||
}
|
||||
}
|
||||
|
||||
public void AddVideoExectued(object para)
|
||||
{
|
||||
VideoItemViewModel itemBase = new VideoItemViewModel();
|
||||
DiagramViewModel?.AddItemCommand.Execute(itemBase);
|
||||
if (itemBase.Root != null)
|
||||
{
|
||||
_service.DrawModeViewModel.CursorMode = CursorMode.Move;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddOutLineTextExecuted(object para)
|
||||
{
|
||||
OutLineTextDesignerItemViewModel itemBase = new OutLineTextDesignerItemViewModel();
|
||||
DiagramViewModel?.AddItemCommand.Execute(itemBase);
|
||||
if (itemBase.Root != null)
|
||||
{
|
||||
_service.DrawModeViewModel.CursorMode = CursorMode.Move;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddBarcodeExecuted(object para)
|
||||
{
|
||||
BarcodeDesignerItemViewModel itemBase = new BarcodeDesignerItemViewModel() { Format = (BarcodeFormat)Enum.Parse(typeof(BarcodeFormat), para.ToString()), Text = "AIStudio.Wpf.DiagramApp" };
|
||||
DiagramViewModel?.AddItemCommand.Execute(itemBase);
|
||||
if (itemBase.Root != null)
|
||||
{
|
||||
_service.DrawModeViewModel.CursorMode = CursorMode.Move;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,23 +16,24 @@ using AIStudio.Wpf.DiagramDesigner;
|
||||
|
||||
namespace AIStudio.Wpf.Flowchart
|
||||
{
|
||||
public class SFCViewModel : DiagramsViewModel
|
||||
public class SFCViewModel : PageViewModel
|
||||
{
|
||||
public SFCViewModel(string title, string status, DiagramType diagramType) : base(title, status, diagramType)
|
||||
{
|
||||
|
||||
Init(true);
|
||||
}
|
||||
|
||||
public SFCViewModel(string filename, DiagramDocument diagramDocument) : base(filename, diagramDocument)
|
||||
{
|
||||
if (DiagramViewModel != null)
|
||||
{
|
||||
SFCService.InitData(DiagramViewModel.Items.OfType<SFCNode>().ToList(), DiagramViewModel.Items.OfType<ConnectorViewModel>().ToList(), DiagramViewModel);
|
||||
SFCService.InitData(DiagramViewModel.Items.OfType<SFCNode>().ToList(), DiagramViewModel.Items.OfType<ConnectionViewModel>().ToList(), DiagramViewModel);
|
||||
}
|
||||
readDataTimer.Elapsed += timeCycle;
|
||||
readDataTimer.Interval = 1000;
|
||||
readDataTimer.AutoReset = false;
|
||||
readDataTimer.Start();
|
||||
_service.DrawModeViewModel.VectorLineDrawMode = DrawMode.BoundaryConnectingLine;
|
||||
_service.DrawModeViewModel.LineDrawMode = DrawMode.ConnectingLineBoundary;
|
||||
}
|
||||
|
||||
protected override void InitDiagramViewModel()
|
||||
@@ -43,161 +44,162 @@ namespace AIStudio.Wpf.Flowchart
|
||||
DiagramViewModel.GridCellSize = new Size(100, 60);
|
||||
DiagramViewModel.CellHorizontalAlignment = CellHorizontalAlignment.Center;
|
||||
DiagramViewModel.CellVerticalAlignment = CellVerticalAlignment.Center;
|
||||
_service.DrawModeViewModel.VectorLineDrawMode = DrawMode.BoundaryConnectingLine;
|
||||
_service.DrawModeViewModel.LineDrawMode = DrawMode.ConnectingLineBoundary;
|
||||
}
|
||||
|
||||
private System.Timers.Timer readDataTimer = new System.Timers.Timer();
|
||||
protected override void Init()
|
||||
protected override void Init(bool initNew)
|
||||
{
|
||||
base.Init();
|
||||
base.Init(initNew);
|
||||
|
||||
SFCStartNode start = new SFCStartNode() { Left = 0, Top = 60, Text = "S0" };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(start);
|
||||
SFCStartNode start = new SFCStartNode() { Name = nameof(start), Left = 0, Top = 60, Text = "S0" };
|
||||
DiagramViewModel.Add(start);
|
||||
|
||||
SFCConditionNode condition1_1 = new SFCConditionNode() { Left = 0, Top = 120, Text = "X01", Expression = "p0==1&p1<20", LinkPoint = new ObservableCollection<LinkPoint> { SFCService.LinkPoint.FirstOrDefault(p => p.Name == "S0"), SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T2") } };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(condition1_1);
|
||||
SFCConditionNode condition1_1 = new SFCConditionNode() { Name = nameof(condition1_1), Left = 0, Top = 120, Text = "X01", Expression = "p0==1&p1<20", LinkPoint = new ObservableCollection<LinkPoint> { SFCService.LinkPoint.FirstOrDefault(p => p.Name == "S0"), SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T2") } };
|
||||
DiagramViewModel.Add(condition1_1);
|
||||
|
||||
SFCConditionNode condition1_2 = new SFCConditionNode() { Left = 100, Top = 120, Text = "X02", Expression = "p0==1&p1<30", LinkPoint = new ObservableCollection<LinkPoint> { SFCService.LinkPoint.FirstOrDefault(p => p.Name == "S0"), SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T2") } };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(condition1_2);
|
||||
SFCConditionNode condition1_2 = new SFCConditionNode() { Name = nameof(condition1_2), Left = 100, Top = 120, Text = "X02", Expression = "p0==1&p1<30", LinkPoint = new ObservableCollection<LinkPoint> { SFCService.LinkPoint.FirstOrDefault(p => p.Name == "S0"), SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T2") } };
|
||||
DiagramViewModel.Add(condition1_2);
|
||||
|
||||
SFCNodeNode step1 = new SFCNodeNode() { Left = 0, Top = 180, Text = "S1" };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(step1);
|
||||
SFCNodeNode step1 = new SFCNodeNode() { Name = nameof(step1), Left = 0, Top = 180, Text = "S1" };
|
||||
DiagramViewModel.Add(step1);
|
||||
|
||||
SFCActionNode action11 = new SFCActionNode() { Left = 100, Top = 180, Text = "SET_V1", Expression = "1", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K1_DI") };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(action11);
|
||||
SFCActionNode action11 = new SFCActionNode() { Name = nameof(action11), Left = 100, Top = 180, Text = "SET_V1", Expression = "1", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K1_DI") };
|
||||
DiagramViewModel.Add(action11);
|
||||
|
||||
SFCActionNode action12 = new SFCActionNode() { Left = 200, Top = 180, Text = "SET_V2", Expression = "1", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K2_DI") };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(action12);
|
||||
SFCActionNode action12 = new SFCActionNode() {Name = nameof(action12), Left = 200, Top = 180, Text = "SET_V2", Expression = "1", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K2_DI") };
|
||||
DiagramViewModel.Add(action12);
|
||||
|
||||
SFCActionNode action13 = new SFCActionNode() { Left = 300, Top = 180, Text = "SET_V3", Expression = "1", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K3_DI") };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(action13);
|
||||
SFCActionNode action13 = new SFCActionNode() {Name = nameof(action13), Left = 300, Top = 180, Text = "SET_V3", Expression = "1", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K3_DI") };
|
||||
DiagramViewModel.Add(action13);
|
||||
|
||||
SFCActionNode action14 = new SFCActionNode() { Left = 400, Top = 180, Text = "RES_V4", Expression = "0", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K4_DI") };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(action14);
|
||||
SFCActionNode action14 = new SFCActionNode() {Name = nameof(action14), Left = 400, Top = 180, Text = "RES_V4", Expression = "0", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K4_DI") };
|
||||
DiagramViewModel.Add(action14);
|
||||
|
||||
SFCConditionNode condition2 = new SFCConditionNode() { Left = 0, Top = 240, Text = "X1", Expression = "p0>50", LinkPoint = new ObservableCollection<LinkPoint> { SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T2") } };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(condition2);
|
||||
SFCConditionNode condition2 = new SFCConditionNode() {Name = nameof(condition2), Left = 0, Top = 240, Text = "X1", Expression = "p0>50", LinkPoint = new ObservableCollection<LinkPoint> { SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T2") } };
|
||||
DiagramViewModel.Add(condition2);
|
||||
|
||||
SFCNodeNode step2 = new SFCNodeNode() { Left = 0, Top = 300, Text = "S2" };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(step2);
|
||||
SFCNodeNode step2 = new SFCNodeNode() {Name = nameof(step2), Left = 0, Top = 300, Text = "S2" };
|
||||
DiagramViewModel.Add(step2);
|
||||
|
||||
SFCActionNode action2 = new SFCActionNode() { Left = 100, Top = 300, Text = "SET_V4", Expression = "1", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K4_DI") };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(action2);
|
||||
SFCActionNode action2 = new SFCActionNode() {Name = nameof(action2), Left = 100, Top = 300, Text = "SET_V4", Expression = "1", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K4_DI") };
|
||||
DiagramViewModel.Add(action2);
|
||||
|
||||
SFCConditionNode condition3 = new SFCConditionNode() { Left = 0, Top = 360, Text = "X2", Expression = "p0>70", LinkPoint = new ObservableCollection<LinkPoint> { SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T2") } };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(condition3);
|
||||
SFCConditionNode condition3 = new SFCConditionNode() {Name = nameof(condition3), Left = 0, Top = 360, Text = "X2", Expression = "p0>70", LinkPoint = new ObservableCollection<LinkPoint> { SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T2") } };
|
||||
DiagramViewModel.Add(condition3);
|
||||
|
||||
SFCNodeNode step3 = new SFCNodeNode() { Left = 0, Top = 420, Text = "S3" };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(step3);
|
||||
SFCNodeNode step3 = new SFCNodeNode() { Name = nameof(step3), Left = 0, Top = 420, Text = "S3" };
|
||||
DiagramViewModel.Add(step3);
|
||||
|
||||
SFCActionNode action3 = new SFCActionNode() { Left = 100, Top = 420, Text = "RES_V1", Expression = "0", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K1_DI") };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(action3);
|
||||
SFCActionNode action3 = new SFCActionNode() {Name = nameof(action3), Left = 100, Top = 420, Text = "RES_V1", Expression = "0", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K1_DI") };
|
||||
DiagramViewModel.Add(action3);
|
||||
|
||||
SFCConditionNode condition4 = new SFCConditionNode() { Left = 0, Top = 480, Text = "X3", Expression = "p0>80", LinkPoint = new ObservableCollection<LinkPoint> { SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T2") } };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(condition4);
|
||||
SFCConditionNode condition4 = new SFCConditionNode() {Name = nameof(condition4), Left = 0, Top = 480, Text = "X3", Expression = "p0>80", LinkPoint = new ObservableCollection<LinkPoint> { SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T2") } };
|
||||
DiagramViewModel.Add(condition4);
|
||||
|
||||
SFCCOBeginNode cobegin = new SFCCOBeginNode() { Left = 38, Top = 540, Text = "" };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(cobegin);
|
||||
SFCCOBeginNode cobegin = new SFCCOBeginNode() {Name = nameof(cobegin), Left = 38, Top = 540, Text = "" };
|
||||
DiagramViewModel.Add(cobegin);
|
||||
|
||||
SFCNodeNode step4 = new SFCNodeNode() { Left = 0, Top = 600, Text = "S4" };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(step4);
|
||||
SFCNodeNode step4 = new SFCNodeNode() {Name = nameof(step4), Left = 0, Top = 600, Text = "S4" };
|
||||
DiagramViewModel.Add(step4);
|
||||
|
||||
SFCActionNode action4 = new SFCActionNode() { Left = 100, Top = 600, Text = "RES_V2", Expression = "0", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K2_DI") };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(action4);
|
||||
SFCActionNode action4 = new SFCActionNode() {Name = nameof(action4), Left = 100, Top = 600, Text = "RES_V2", Expression = "0", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K2_DI") };
|
||||
DiagramViewModel.Add(action4);
|
||||
|
||||
SFCConditionNode condition5 = new SFCConditionNode() { Left = 0, Top = 660, Text = "X4", Expression = "p0==0", LinkPoint = new ObservableCollection<LinkPoint> { SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K2_DO") } };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(condition5);
|
||||
SFCConditionNode condition5 = new SFCConditionNode() {Name = nameof(condition5), Left = 0, Top = 660, Text = "X4", Expression = "p0==0", LinkPoint = new ObservableCollection<LinkPoint> { SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K2_DO") } };
|
||||
DiagramViewModel.Add(condition5);
|
||||
|
||||
SFCNodeNode step5 = new SFCNodeNode() { Left = 200, Top = 600, Text = "S5" };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(step5);
|
||||
SFCNodeNode step5 = new SFCNodeNode() {Name = nameof(step5), Left = 200, Top = 600, Text = "S5" };
|
||||
DiagramViewModel.Add(step5);
|
||||
|
||||
SFCActionNode action5 = new SFCActionNode() { Left = 300, Top = 600, Text = "RES_V3", Expression = "0", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K3_DI") };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(action5);
|
||||
SFCActionNode action5 = new SFCActionNode() {Name = nameof(action5), Left = 300, Top = 600, Text = "RES_V3", Expression = "0", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K3_DI") };
|
||||
DiagramViewModel.Add(action5);
|
||||
|
||||
SFCConditionNode condition6 = new SFCConditionNode() { Left = 200, Top = 660, Text = "X5", Expression = "p0==0", LinkPoint = new ObservableCollection<LinkPoint> { SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K3_DO") } };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(condition6);
|
||||
SFCConditionNode condition6 = new SFCConditionNode() {Name = nameof(condition6), Left = 200, Top = 660, Text = "X5", Expression = "p0==0", LinkPoint = new ObservableCollection<LinkPoint> { SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K3_DO") } };
|
||||
DiagramViewModel.Add(condition6);
|
||||
|
||||
SFCCOEndNode coend = new SFCCOEndNode() { Left = 38, Top = 720, Text = "" };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(coend);
|
||||
SFCCOEndNode coend = new SFCCOEndNode() {Name = nameof(coend), Left = 38, Top = 720, Text = "" };
|
||||
DiagramViewModel.Add(coend);
|
||||
|
||||
ConnectorViewModel connector1_1 = new ConnectorViewModel(start.Output[0], condition1_1.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector1_1);
|
||||
ConnectionViewModel connector1_1 = new ConnectionViewModel(DiagramViewModel, start.Output[0], condition1_1.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector1_1), };
|
||||
DiagramViewModel.Add(connector1_1);
|
||||
|
||||
ConnectorViewModel connector2_1 = new ConnectorViewModel(condition1_1.Output[0], step1.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector2_1);
|
||||
ConnectionViewModel connector2_1 = new ConnectionViewModel(DiagramViewModel, condition1_1.Output[0], step1.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector2_1), };
|
||||
DiagramViewModel.Add(connector2_1);
|
||||
|
||||
ConnectorViewModel connector1_2 = new ConnectorViewModel(start.Output[0], condition1_2.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector1_2);
|
||||
ConnectionViewModel connector1_2 = new ConnectionViewModel(DiagramViewModel, start.Output[0], condition1_2.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector1_2) };
|
||||
DiagramViewModel.Add(connector1_2);
|
||||
|
||||
ConnectorViewModel connector2_2 = new ConnectorViewModel(condition1_2.Output[0], step1.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector2_2);
|
||||
ConnectionViewModel connector2_2 = new ConnectionViewModel(DiagramViewModel, condition1_2.Output[0], step1.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector2_2) };
|
||||
DiagramViewModel.Add(connector2_2);
|
||||
|
||||
ConnectorViewModel connector31 = new ConnectorViewModel(step1.Action[0], action11.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector31);
|
||||
ConnectionViewModel connector31 = new ConnectionViewModel(DiagramViewModel, step1.Action[0], action11.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector31), };
|
||||
DiagramViewModel.Add(connector31);
|
||||
|
||||
ConnectorViewModel connector32 = new ConnectorViewModel(step1.Action[0], action12.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector32);
|
||||
ConnectionViewModel connector32 = new ConnectionViewModel(DiagramViewModel, step1.Action[0], action12.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector32) };
|
||||
DiagramViewModel.Add(connector32);
|
||||
|
||||
ConnectorViewModel connector33 = new ConnectorViewModel(step1.Action[0], action13.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector33);
|
||||
ConnectionViewModel connector33 = new ConnectionViewModel(DiagramViewModel, step1.Action[0], action13.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector33) };
|
||||
DiagramViewModel.Add(connector33);
|
||||
|
||||
ConnectorViewModel connector34 = new ConnectorViewModel(step1.Action[0], action14.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector34);
|
||||
ConnectionViewModel connector34 = new ConnectionViewModel(DiagramViewModel, step1.Action[0], action14.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector34) };
|
||||
DiagramViewModel.Add(connector34);
|
||||
|
||||
ConnectorViewModel connector4 = new ConnectorViewModel(step1.Output[0], condition2.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector4);
|
||||
ConnectionViewModel connector4 = new ConnectionViewModel(DiagramViewModel, step1.Output[0], condition2.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector4) };
|
||||
DiagramViewModel.Add(connector4);
|
||||
|
||||
ConnectorViewModel connector5 = new ConnectorViewModel(condition2.Output[0], step2.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector5);
|
||||
ConnectionViewModel connector5 = new ConnectionViewModel(DiagramViewModel, condition2.Output[0], step2.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector5) };
|
||||
DiagramViewModel.Add(connector5);
|
||||
|
||||
ConnectorViewModel connector6 = new ConnectorViewModel(step2.Action[0], action2.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector6);
|
||||
ConnectionViewModel connector6 = new ConnectionViewModel(DiagramViewModel, step2.Action[0], action2.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector6) };
|
||||
DiagramViewModel.Add(connector6);
|
||||
|
||||
ConnectorViewModel connector7 = new ConnectorViewModel(step2.Output[0], condition3.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector7);
|
||||
ConnectionViewModel connector7 = new ConnectionViewModel(DiagramViewModel, step2.Output[0], condition3.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector7) };
|
||||
DiagramViewModel.Add(connector7);
|
||||
|
||||
ConnectorViewModel connector8 = new ConnectorViewModel(condition3.Output[0], step3.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector8);
|
||||
ConnectionViewModel connector8 = new ConnectionViewModel(DiagramViewModel, condition3.Output[0], step3.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector8) };
|
||||
DiagramViewModel.Add(connector8);
|
||||
|
||||
ConnectorViewModel connector9 = new ConnectorViewModel(step3.Action[0], action3.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector9);
|
||||
ConnectionViewModel connector9 = new ConnectionViewModel(DiagramViewModel, step3.Action[0], action3.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector9) };
|
||||
DiagramViewModel.Add(connector9);
|
||||
|
||||
ConnectorViewModel connector10 = new ConnectorViewModel(step3.Output[0], condition4.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector10);
|
||||
ConnectionViewModel connector10 = new ConnectionViewModel(DiagramViewModel, step3.Output[0], condition4.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector10) };
|
||||
DiagramViewModel.Add(connector10);
|
||||
|
||||
ConnectorViewModel connector11 = new ConnectorViewModel(condition4.Output[0], cobegin.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector11);
|
||||
ConnectionViewModel connector11 = new ConnectionViewModel(DiagramViewModel, condition4.Output[0], cobegin.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector11) };
|
||||
DiagramViewModel.Add(connector11);
|
||||
|
||||
ConnectorViewModel connector12 = new ConnectorViewModel(cobegin.Output[0], step4.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector12);
|
||||
ConnectionViewModel connector12 = new ConnectionViewModel(DiagramViewModel, cobegin.Output[0], step4.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector12) };
|
||||
DiagramViewModel.Add(connector12);
|
||||
|
||||
ConnectorViewModel connector13 = new ConnectorViewModel(step4.Action[0], action4.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector13);
|
||||
ConnectionViewModel connector13 = new ConnectionViewModel(DiagramViewModel, step4.Action[0], action4.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector13) };
|
||||
DiagramViewModel.Add(connector13);
|
||||
|
||||
ConnectorViewModel connector14 = new ConnectorViewModel(step4.Output[0], condition5.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector14);
|
||||
ConnectionViewModel connector14 = new ConnectionViewModel(DiagramViewModel, step4.Output[0], condition5.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector14) };
|
||||
DiagramViewModel.Add(connector14);
|
||||
|
||||
ConnectorViewModel connector15 = new ConnectorViewModel(cobegin.Output[1], step5.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector15);
|
||||
ConnectionViewModel connector15 = new ConnectionViewModel(DiagramViewModel, cobegin.Output[1], step5.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector15), };
|
||||
DiagramViewModel.Add(connector15);
|
||||
|
||||
ConnectorViewModel connector16 = new ConnectorViewModel(step5.Action[0], action5.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector16);
|
||||
ConnectionViewModel connector16 = new ConnectionViewModel(DiagramViewModel, step5.Action[0], action5.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector16), };
|
||||
DiagramViewModel.Add(connector16);
|
||||
|
||||
ConnectorViewModel connector17 = new ConnectorViewModel(step5.Output[0], condition6.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector17);
|
||||
ConnectionViewModel connector17 = new ConnectionViewModel(DiagramViewModel, step5.Output[0], condition6.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector17), };
|
||||
DiagramViewModel.Add(connector17);
|
||||
|
||||
ConnectorViewModel connector18 = new ConnectorViewModel(condition5.Output[0], coend.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector18);
|
||||
ConnectionViewModel connector18 = new ConnectionViewModel(DiagramViewModel, condition5.Output[0], coend.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector18), };
|
||||
DiagramViewModel.Add(connector18);
|
||||
|
||||
ConnectorViewModel connector19 = new ConnectorViewModel(condition6.Output[0], coend.Input[1], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector19);
|
||||
ConnectionViewModel connector19 = new ConnectionViewModel(DiagramViewModel, condition6.Output[0], coend.Input[1], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector19), };
|
||||
DiagramViewModel.Add(connector19);
|
||||
|
||||
ConnectorViewModel connector20 = new ConnectorViewModel(coend.Output[0], start.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(connector20);
|
||||
ConnectionViewModel connector20 = new ConnectionViewModel(DiagramViewModel, coend.Output[0], start.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(connector20), };
|
||||
DiagramViewModel.Add(connector20);
|
||||
|
||||
#region 模拟部分
|
||||
TextDesignerItemViewModel despcription = new TextDesignerItemViewModel()
|
||||
{
|
||||
Name = nameof(despcription),
|
||||
Left = 230,
|
||||
Top = 270,
|
||||
ItemWidth = 300,
|
||||
@@ -211,68 +213,67 @@ namespace AIStudio.Wpf.Flowchart
|
||||
};
|
||||
despcription.FontViewModel.HorizontalAlignment = HorizontalAlignment.Left;
|
||||
despcription.FontViewModel.VerticalAlignment = VerticalAlignment.Top;
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(despcription);
|
||||
DiagramViewModel.Add(despcription);
|
||||
|
||||
Simulate_ListViewModel list = new Simulate_ListViewModel()
|
||||
{
|
||||
Name = nameof(list),
|
||||
Left = 410,
|
||||
Top = 390,
|
||||
};
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(list);
|
||||
DiagramViewModel.Add(list);
|
||||
|
||||
Simulate_StartViewModel btnstart = new Simulate_StartViewModel() { Left = 0, Top = 0, LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "S0"), };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(btnstart);
|
||||
Simulate_StartViewModel btnstart = new Simulate_StartViewModel() { Name = nameof(btnstart), Left = 0, Top = 0, LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "S0"), };
|
||||
DiagramViewModel.Add(btnstart);
|
||||
|
||||
Simulate_TankViewModel tank1 = new Simulate_TankViewModel() { Left = 100, Top = 43, ItemWidth = 48, ItemHeight = 60, Text = "T1", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T1") };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(tank1);
|
||||
Simulate_TankViewModel tank1 = new Simulate_TankViewModel() {Name = nameof(tank1), Left = 100, Top = 43, ItemWidth = 48, ItemHeight = 60, Text = "T1", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T1") };
|
||||
DiagramViewModel.Add(tank1);
|
||||
|
||||
Simulate_SolenoidViewModel k1 = new Simulate_SolenoidViewModel() { Left = 200, Top = 0, Text = "K1", DILinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K1_DI"), DOLinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K1_DO") };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(k1);
|
||||
Simulate_SolenoidViewModel k1 = new Simulate_SolenoidViewModel() {Name = nameof(k1), Left = 200, Top = 0, Text = "K1", DILinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K1_DI"), DOLinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K1_DO") };
|
||||
DiagramViewModel.Add(k1);
|
||||
|
||||
Simulate_SolenoidViewModel k2 = new Simulate_SolenoidViewModel() { Left = 200, Top = 60, Text = "K2", DILinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K2_DI"), DOLinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K2_DO") };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(k2);
|
||||
Simulate_SolenoidViewModel k2 = new Simulate_SolenoidViewModel() {Name = nameof(k2), Left = 200, Top = 60, Text = "K2", DILinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K2_DI"), DOLinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K2_DO") };
|
||||
DiagramViewModel.Add(k2);
|
||||
|
||||
Simulate_SolenoidViewModel k3 = new Simulate_SolenoidViewModel() { Left = 200, Top = 120, Text = "K3", DILinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K3_DI"), DOLinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K3_DO") };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(k3);
|
||||
Simulate_SolenoidViewModel k3 = new Simulate_SolenoidViewModel() {Name = nameof(k3), Left = 200, Top = 120, Text = "K3", DILinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K3_DI"), DOLinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K3_DO") };
|
||||
DiagramViewModel.Add(k3);
|
||||
|
||||
Simulate_TankViewModel tank2 = new Simulate_TankViewModel() { Left = 300, Top = 28, Text = "T2", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T2") };
|
||||
Simulate_TankViewModel tank2 = new Simulate_TankViewModel() {Name = nameof(tank2), Left = 300, Top = 28, Text = "T2", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T2") };
|
||||
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(tank2);
|
||||
DiagramViewModel.Add(tank2);
|
||||
|
||||
Simulate_SolenoidViewModel k4 = new Simulate_SolenoidViewModel() { Left = 400, Top = 60, Text = "K4", DILinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K4_DI"), DOLinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K4_DO") };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(k4);
|
||||
Simulate_SolenoidViewModel k4 = new Simulate_SolenoidViewModel() {Name = nameof(k4), Left = 400, Top = 60, Text = "K4", DILinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K4_DI"), DOLinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "K4_DO") };
|
||||
DiagramViewModel.Add(k4);
|
||||
|
||||
Simulate_TankViewModel tank3 = new Simulate_TankViewModel() { Left = 500, Top = 103, ItemWidth = 48, ItemHeight = 60, Text = "T3", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T3") };
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(tank3);
|
||||
Simulate_TankViewModel tank3 = new Simulate_TankViewModel() {Name = nameof(tank3), Left = 500, Top = 103, ItemWidth = 48, ItemHeight = 60, Text = "T3", LinkPoint = SFCService.LinkPoint.FirstOrDefault(p => p.Name == "T3") };
|
||||
DiagramViewModel.Add(tank3);
|
||||
|
||||
ConnectorViewModel conn1 = new ConnectorViewModel(tank1.Output[0], k1.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(conn1);
|
||||
ConnectionViewModel conn1 = new ConnectionViewModel(DiagramViewModel, tank1.Output[0], k1.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(conn1), };
|
||||
DiagramViewModel.Add(conn1);
|
||||
|
||||
ConnectorViewModel conn2 = new ConnectorViewModel(tank1.Output[0], k2.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(conn2);
|
||||
ConnectionViewModel conn2 = new ConnectionViewModel(DiagramViewModel, tank1.Output[0], k2.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(conn2) };
|
||||
DiagramViewModel.Add(conn2);
|
||||
|
||||
ConnectorViewModel conn3 = new ConnectorViewModel(tank1.Output[0], k3.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(conn3);
|
||||
ConnectionViewModel conn3 = new ConnectionViewModel(DiagramViewModel, tank1.Output[0], k3.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(conn3) };
|
||||
DiagramViewModel.Add(conn3);
|
||||
|
||||
ConnectorViewModel conn4 = new ConnectorViewModel(k1.Output[0], tank2.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(conn4);
|
||||
ConnectionViewModel conn4 = new ConnectionViewModel(DiagramViewModel, k1.Output[0], tank2.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(conn4) };
|
||||
DiagramViewModel.Add(conn4);
|
||||
|
||||
ConnectorViewModel conn5 = new ConnectorViewModel(k2.Output[0], tank2.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(conn5);
|
||||
ConnectionViewModel conn5 = new ConnectionViewModel(DiagramViewModel, k2.Output[0], tank2.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(conn5) };
|
||||
DiagramViewModel.Add(conn5);
|
||||
|
||||
ConnectorViewModel conn6 = new ConnectorViewModel(k3.Output[0], tank2.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(conn6);
|
||||
ConnectionViewModel conn6 = new ConnectionViewModel(DiagramViewModel, k3.Output[0], tank2.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(conn6) };
|
||||
DiagramViewModel.Add(conn6);
|
||||
|
||||
ConnectorViewModel conn7 = new ConnectorViewModel(tank2.Output[1], k4.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(conn7);
|
||||
ConnectionViewModel conn7 = new ConnectionViewModel(DiagramViewModel, tank2.Output[1], k4.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(conn7), };
|
||||
DiagramViewModel.Add(conn7);
|
||||
|
||||
ConnectorViewModel conn8 = new ConnectorViewModel(k4.Output[0], tank3.Input[0], _service.DrawModeViewModel.VectorLineDrawMode);
|
||||
DiagramViewModel.DirectAddItemCommand.Execute(conn8);
|
||||
ConnectionViewModel conn8 = new ConnectionViewModel(DiagramViewModel, k4.Output[0], tank3.Input[0], _service.DrawModeViewModel.LineDrawMode, _service.DrawModeViewModel.LineRouterMode) { Name = nameof(conn8) };
|
||||
DiagramViewModel.Add(conn8);
|
||||
#endregion
|
||||
|
||||
DiagramViewModel.ClearSelectedItems();
|
||||
|
||||
SFCService.InitData(DiagramViewModel.Items.OfType<SFCNode>().ToList(), DiagramViewModel.Items.OfType<ConnectorViewModel>().ToList(), DiagramViewModel);
|
||||
SFCService.InitData(DiagramViewModel.Items.OfType<SFCNode>().ToList(), DiagramViewModel.Items.OfType<ConnectionViewModel>().ToList(), DiagramViewModel);
|
||||
|
||||
readDataTimer.Elapsed += timeCycle;
|
||||
readDataTimer.Interval = 1000;
|
||||
@@ -298,7 +299,7 @@ namespace AIStudio.Wpf.Flowchart
|
||||
|
||||
foreach (var viewModel in DiagramViewModels)
|
||||
{
|
||||
SFCService.DisposeData(viewModel);
|
||||
SFCService.Dispose(viewModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
35
AIStudio.Wpf.DiagramApp/ViewModels/ScriptViewModel.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AIStudio.Wpf.DiagramApp.Models;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
{
|
||||
public class ScriptViewModel : PageViewModel
|
||||
{
|
||||
public ScriptViewModel(string title, string status, DiagramType diagramType) : base(title, status, diagramType)
|
||||
{
|
||||
Init(true);
|
||||
}
|
||||
|
||||
public ScriptViewModel(string filename, DiagramDocument diagramDocument) : base(filename, diagramDocument)
|
||||
{
|
||||
if (DiagramViewModel != null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected override void InitDiagramViewModel()
|
||||
{
|
||||
base.InitDiagramViewModel();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using AIStudio.Wpf.DiagramHelper.Commands;
|
||||
using AIStudio.Wpf.DiagramHelper.Extensions.ViewModels;
|
||||
using AIStudio.Wpf.DiagramHelper.Helpers;
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals.Commands;
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.ViewModels;
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals;
|
||||
using AIStudio.Wpf.DiagramApp.Models;
|
||||
using AIStudio.Wpf.Flowchart;
|
||||
using AIStudio.Wpf.Flowchart.ViewModels;
|
||||
@@ -18,14 +18,21 @@ using AIStudio.Wpf.SFC.ViewModels;
|
||||
using System.Windows.Media;
|
||||
using AIStudio.Wpf.Flowchart.Models;
|
||||
using AIStudio.Wpf.SFC.Models;
|
||||
using System.Windows;
|
||||
using System;
|
||||
using AIStudio.Wpf.DiagramDesigner.Models;
|
||||
using AIStudio.Wpf.DiagramDesigner.ViewModels;
|
||||
using AIStudio.Wpf.DiagramDesigner.ViewModels.BaseViewModel;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
{
|
||||
public class ToolBoxViewModel : BindableBase
|
||||
{
|
||||
private IDiagramServiceProvider _service { get { return DiagramServicesProvider.Instance.Provider; } }
|
||||
public ToolBoxViewModel()
|
||||
private MainWindowViewModel _mainWindowViewModel;
|
||||
|
||||
public ToolBoxViewModel(MainWindowViewModel mainWindowViewModel)
|
||||
{
|
||||
_mainWindowViewModel = mainWindowViewModel;
|
||||
Init();
|
||||
}
|
||||
|
||||
@@ -42,11 +49,26 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public ObservableCollection<ToolBoxCategory> TotalToolBoxCategory { get; set; }
|
||||
public ObservableCollection<ToolBoxCategory> TotalToolBoxCategory
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public ToolBoxCategory MyToolBoxCategory { get { return ToolBoxCategory[0]; } }
|
||||
public ToolBoxCategory MyToolBoxCategory
|
||||
{
|
||||
get
|
||||
{
|
||||
return ToolBoxCategory?.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
public ToolBoxCategory SvgToolBoxCategory { get { return ToolBoxCategory[2]; } }
|
||||
public ToolBoxCategory SvgToolBoxCategory
|
||||
{
|
||||
get
|
||||
{
|
||||
return ToolBoxCategory?.FirstOrDefault(p => p.Header == "Svg");
|
||||
}
|
||||
}
|
||||
|
||||
private ICommand _deleteCommand;
|
||||
public ICommand DeleteCommand
|
||||
@@ -89,11 +111,17 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
ToolBoxCategory.Add(new MineToolBoxCategory() { Header = "我的形状", ToolBoxItems = new ObservableCollection<ToolBoxData>(), IsExpanded = true });
|
||||
|
||||
List<ToolBoxData> toolBoxItems = new List<ToolBoxData>();
|
||||
toolBoxItems.Add(new ImageToolBoxData("../Images/Setting.png", typeof(SettingsDesignerItemViewModel)));
|
||||
toolBoxItems.Add(new ImageToolBoxData("../Images/Persist.png", typeof(PersistDesignerItemViewModel)));
|
||||
toolBoxItems.Add(new ImageToolBoxData("../Images/Setting.png", typeof(SettingsDesignerItemViewModel), description: "致谢WPF-Diagram-Designer的开源作者,保留开源作品中的两个设计"));
|
||||
toolBoxItems.Add(new ImageToolBoxData("../Images/Persist.png", typeof(PersistDesignerItemViewModel), description: "致谢WPF-Diagram-Designer的开源作者,保留开源作品中的两个设计"));
|
||||
|
||||
ToolBoxCategory.Add(new ToolBoxCategory() { Header = "WPF-Diagram-Designer", ToolBoxItems = new ObservableCollection<ToolBoxData>(toolBoxItems), IsExpanded = true });
|
||||
|
||||
|
||||
List<ToolBoxData> defaultToolBoxItems = new List<ToolBoxData>();
|
||||
defaultToolBoxItems.Add(new TextToolBoxData("", typeof(DefaultDesignerItemViewModel)));
|
||||
|
||||
ToolBoxCategory.Add(new ToolBoxCategory() { Header = "Default", ToolBoxItems = new ObservableCollection<ToolBoxData>(defaultToolBoxItems), IsExpanded = true });
|
||||
|
||||
ToolBoxCategory.Add(new ToolBoxCategory() { Header = "Svg", ToolBoxItems = new ObservableCollection<ToolBoxData>() });
|
||||
|
||||
List<PathToolBoxData> pathToolBoxItems = new List<PathToolBoxData>();
|
||||
@@ -168,12 +196,12 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
ToolBoxCategory.Add(new ToolBoxCategory() { Header = "逻辑图", ToolBoxItems = new ObservableCollection<ToolBoxData>(logicalChartToolBoxItems) });
|
||||
|
||||
List<ToolBoxData> flowchartToolBoxItems = new List<ToolBoxData>();
|
||||
flowchartToolBoxItems.Add(new FlowchartToolBoxData(NodeKinds.Start, typeof(StartFlowNode)));
|
||||
flowchartToolBoxItems.Add(new FlowchartToolBoxData(NodeKinds.End, typeof(EndFlowNode)));
|
||||
flowchartToolBoxItems.Add(new FlowchartToolBoxData(NodeKinds.Middle, typeof(MiddleFlowNode)));
|
||||
flowchartToolBoxItems.Add(new FlowchartToolBoxData(NodeKinds.Decide, typeof(DecideFlowNode)));
|
||||
flowchartToolBoxItems.Add(new FlowchartToolBoxData(NodeKinds.COBegin, typeof(COBeginFlowNode)));
|
||||
flowchartToolBoxItems.Add(new FlowchartToolBoxData(NodeKinds.COEnd, typeof(COEndFlowNode)));
|
||||
flowchartToolBoxItems.Add(new FlowchartToolBoxData(NodeKinds.Start, typeof(StartFlowNode), 32, 32, new Size(80, 40)));
|
||||
flowchartToolBoxItems.Add(new FlowchartToolBoxData(NodeKinds.End, typeof(EndFlowNode), 32, 32, new Size(80, 40)));
|
||||
flowchartToolBoxItems.Add(new FlowchartToolBoxData(NodeKinds.Middle, typeof(MiddleFlowNode), 32, 32, new Size(80, 40)));
|
||||
flowchartToolBoxItems.Add(new FlowchartToolBoxData(NodeKinds.Decide, typeof(DecideFlowNode), 32, 32, new Size(80, 40)));
|
||||
flowchartToolBoxItems.Add(new FlowchartToolBoxData(NodeKinds.COBegin, typeof(COBeginFlowNode), 32, 32, new Size(80, 40))); ;
|
||||
flowchartToolBoxItems.Add(new FlowchartToolBoxData(NodeKinds.COEnd, typeof(COEndFlowNode), 32, 32, new Size(80, 40)));
|
||||
ToolBoxCategory.Add(new ToolBoxCategory() { Header = "流程图", ToolBoxItems = new ObservableCollection<ToolBoxData>(flowchartToolBoxItems) });
|
||||
|
||||
List<ToolBoxData> mediaToolBoxItems = new List<ToolBoxData>();
|
||||
@@ -220,28 +248,41 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
|
||||
private void LoadMyItems()
|
||||
{
|
||||
if (!Directory.Exists(_custom))
|
||||
{
|
||||
Directory.CreateDirectory(_custom);
|
||||
}
|
||||
|
||||
if (Directory.Exists(_custom))
|
||||
{
|
||||
var files = Directory.GetFiles(_custom);
|
||||
foreach (var filename in files.Where(p => p.ToLower().EndsWith(".json")))
|
||||
{
|
||||
var itemBase = ReadMyItem(filename);
|
||||
if (itemBase != null)
|
||||
{
|
||||
MyToolBoxCategory.ToolBoxItems.Add(new DesignerItemToolBoxData(itemBase, filename, TypeHelper.GetType(itemBase.ItemTypeName)));
|
||||
}
|
||||
AddMyItem(filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private DesignerItemBase ReadMyItem(string filename)
|
||||
private object ReadMyItem(string filename)
|
||||
{
|
||||
try
|
||||
{
|
||||
var xmlobject = JsonConvert.DeserializeObject<DiagramDocument>(File.ReadAllText(filename));
|
||||
var diagramItemData = xmlobject.DiagramItems[0].AllDesignerItems[0];
|
||||
|
||||
return diagramItemData;
|
||||
if (xmlobject.DiagramItems[0].DesignerItems.Count > 1)
|
||||
{
|
||||
var itemBase = new MultipleDesignerItemToolBoxData(new SerializableObject() { DesignerItems = xmlobject.DiagramItems[0].DesignerItems, Connections = xmlobject.DiagramItems[0].Connections }, filename);
|
||||
|
||||
return itemBase;
|
||||
}
|
||||
else
|
||||
{
|
||||
Type type = TypeHelper.GetType(xmlobject.DiagramItems[0].DesignerItems[0].SerializableTypeName);
|
||||
|
||||
var itemBase = JsonConvert.DeserializeObject(xmlobject.DiagramItems[0].DesignerItems[0].SerializableString, type) as DesignerItemBase;
|
||||
|
||||
return itemBase;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -253,22 +294,44 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
|
||||
private void AddMyItem()
|
||||
{
|
||||
if (_service.SelectedItem is DesignerItemViewModelBase designer)
|
||||
if (_mainWindowViewModel?.PageViewModel?.DiagramViewModel != null)
|
||||
{
|
||||
DiagramDocument diagramDocument = new DiagramDocument();
|
||||
diagramDocument.DiagramItems = new List<DiagramItem>();
|
||||
DiagramItem diagramItem = new DiagramItem();
|
||||
diagramItem.AddItems(new List<DesignerItemViewModelBase> { designer });
|
||||
|
||||
var selectedDesignerItems = _mainWindowViewModel?.PageViewModel?.DiagramViewModel.SelectedItems.OfType<DesignerItemViewModelBase>();
|
||||
var selectedConnections = _mainWindowViewModel?.PageViewModel?.DiagramViewModel.SelectedItems.OfType<ConnectionViewModel>();
|
||||
|
||||
diagramItem.DesignerItems = selectedDesignerItems.Select(p => p.ToSerializableItem(".json")).Where(p => p != null).ToList();
|
||||
diagramItem.Connections = selectedConnections.Select(p => p.ToSerializableItem(".json")).Where(p => p != null).ToList();
|
||||
|
||||
diagramDocument.DiagramItems.Add(diagramItem);
|
||||
string newname = NewNameHelper.GetNewName(MyToolBoxCategory.ToolBoxItems.OfType<DesignerItemToolBoxData>().Select(p => Path.GetFileNameWithoutExtension(p.FileName)), "");
|
||||
var filename = $"{_custom}\\{newname}.json";
|
||||
File.WriteAllText(filename, JsonConvert.SerializeObject(diagramDocument));
|
||||
|
||||
AddMyItem(filename);
|
||||
}
|
||||
}
|
||||
|
||||
private void AddMyItem(string filename)
|
||||
{
|
||||
try
|
||||
{
|
||||
var itemBase = ReadMyItem(filename);
|
||||
if (itemBase != null)
|
||||
if (itemBase is DesignerItemBase designer)
|
||||
{
|
||||
MyToolBoxCategory.ToolBoxItems.Add(new DesignerItemToolBoxData(itemBase, filename, TypeHelper.GetType(itemBase.ItemTypeName)));
|
||||
MyToolBoxCategory.ToolBoxItems.Add(new DesignerItemToolBoxData(designer, filename, TypeHelper.GetType(designer.ItemTypeName)));
|
||||
}
|
||||
else if (itemBase is MultipleDesignerItemToolBoxData multiple)
|
||||
{
|
||||
MyToolBoxCategory.ToolBoxItems.Add(multiple);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,7 +352,10 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels
|
||||
|
||||
public class ToolBoxCategory : BindableBase
|
||||
{
|
||||
public string Header { get; set; }
|
||||
public string Header
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
private bool _isExpanded;
|
||||
public bool IsExpanded
|
||||
|
||||
@@ -31,8 +31,6 @@ namespace AIStudio.Wpf.DiagramApp
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
this.HookEvents();
|
||||
|
||||
MainWindowViewModel = new MainWindowViewModel();
|
||||
this.DataContext = MainWindowViewModel;
|
||||
this.Closing += MainWindow_Closing;
|
||||
@@ -40,13 +38,8 @@ namespace AIStudio.Wpf.DiagramApp
|
||||
|
||||
protected override void OnPreviewKeyDown(KeyEventArgs e)
|
||||
{
|
||||
e.Handled = MainWindowViewModel.KeyExecuted(e.KeyboardDevice.Modifiers == ModifierKeys.None ? e.Key.ToString() : e.KeyboardDevice.Modifiers.ToString() + "+" + e.Key.ToString());
|
||||
}
|
||||
|
||||
private void HookEvents()
|
||||
{
|
||||
|
||||
this.PreviewMouseWheel += this.OnPreviewMouseWheel;
|
||||
base.OnPreviewKeyDown(e);
|
||||
e.Handled = MainWindowViewModel.KeyExecuted(e);
|
||||
}
|
||||
|
||||
private void ZoomSlider_OnValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
@@ -55,21 +48,6 @@ namespace AIStudio.Wpf.DiagramApp
|
||||
TextOptions.SetTextFormattingMode(this, textFormattingMode);
|
||||
}
|
||||
|
||||
private void OnPreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||
{
|
||||
if (Keyboard.IsKeyDown(Key.LeftCtrl) == false
|
||||
&& Keyboard.IsKeyDown(Key.RightCtrl) == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var newZoomValue = this.zoomSlider.Value + (e.Delta > 0 ? 0.1 : -0.1);
|
||||
|
||||
this.zoomSlider.Value = Math.Max(Math.Min(newZoomValue, this.zoomSlider.Maximum), this.zoomSlider.Minimum);
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void btnPrint_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
PrintDialog printDialog = new PrintDialog();
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:Fluent="urn:fluent-ribbon"
|
||||
xmlns:controls="clr-namespace:AIStudio.Wpf.DiagramHelper.Controls;assembly=AIStudio.Wpf.DiagramHelper"
|
||||
xmlns:controls="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Controls;assembly=AIStudio.Wpf.DiagramDesigner.Additionals"
|
||||
xmlns:views="clr-namespace:AIStudio.Wpf.DiagramApp.Views"
|
||||
xmlns:converter="clr-namespace:AIStudio.Wpf.DiagramHelper.Converters;assembly=AIStudio.Wpf.DiagramHelper"
|
||||
xmlns:helper="clr-namespace:AIStudio.Wpf.DiagramHelper.Helpers;assembly=AIStudio.Wpf.DiagramHelper"
|
||||
xmlns:converter="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Converters;assembly=AIStudio.Wpf.DiagramDesigner.Additionals"
|
||||
xmlns:helper="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals;assembly=AIStudio.Wpf.DiagramDesigner.Additionals"
|
||||
xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram"
|
||||
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
|
||||
xmlns:flowchart="clr-namespace:AIStudio.Wpf.Flowchart;assembly=AIStudio.Wpf.Flowchart"
|
||||
@@ -23,17 +23,17 @@
|
||||
<TabControl Style="{StaticResource UniformTabControlStyle}" >
|
||||
<TabItem Header="填充" Height="34">
|
||||
<StackPanel
|
||||
DataContext="{Binding SelectedItem.ColorViewModel.FillColor}"
|
||||
DataContext="{Binding SelectedItemViewModel.ColorViewModel.FillColor}"
|
||||
Visibility="{Binding .,Converter={StaticResource NullableToVisibilityConverter}}">
|
||||
<StackPanel>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={converter:ConverterValueMapToBool Parameter='None'}, ConverterParameter='None'}" Content="无填充" />
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={converter:ConverterValueMapToBool Parameter='SolidColorBrush'}, ConverterParameter='SolidColorBrush'}" Content="单色填充"/>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={converter:ConverterValueMapToBool Parameter='LinearGradientBrush'}, ConverterParameter='LinearGradientBrush'}" Content="线性渐变填充"/>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={converter:ConverterValueMapToBool Parameter='RadialGradientBrush'}, ConverterParameter='RadialGradientBrush'}" Content="径向渐变填充"/>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={converter:ConverterValueMapToBool Parameter='DrawingBrush'}, ConverterParameter='DrawingBrush'}" Content="图案填充"/>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={converter:ConverterValueMapToBool Parameter='ImageBrush'}, ConverterParameter='ImageBrush'}" Content="图片或纹理填充"/>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={dd:ConverterValueMapToBool Parameter='None'}, ConverterParameter='None'}" Content="无填充" />
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={dd:ConverterValueMapToBool Parameter='SolidColorBrush'}, ConverterParameter='SolidColorBrush'}" Content="单色填充"/>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={dd:ConverterValueMapToBool Parameter='LinearGradientBrush'}, ConverterParameter='LinearGradientBrush'}" Content="线性渐变填充"/>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={dd:ConverterValueMapToBool Parameter='RadialGradientBrush'}, ConverterParameter='RadialGradientBrush'}" Content="径向渐变填充"/>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={dd:ConverterValueMapToBool Parameter='DrawingBrush'}, ConverterParameter='DrawingBrush'}" Content="图案填充"/>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={dd:ConverterValueMapToBool Parameter='ImageBrush'}, ConverterParameter='ImageBrush'}" Content="图片或纹理填充"/>
|
||||
</StackPanel>
|
||||
<DockPanel Visibility="{Binding BrushType,Converter={converter:ConverterValueMapSetToVisibility},ConverterParameter='SolidColorBrush'}">
|
||||
<DockPanel Visibility="{Binding BrushType,Converter={dd:ConverterValueMapSetToVisibility},ConverterParameter='SolidColorBrush'}">
|
||||
<!-- The following code shows theme colors mode for color gallery -->
|
||||
<Fluent:DropDownButton DockPanel.Dock="Right" Margin="5" Height="24" Width="60"
|
||||
Template="{StaticResource RibbonDropDownButtonControlTemplate1}"
|
||||
@@ -56,9 +56,9 @@
|
||||
</Fluent:DropDownButton>
|
||||
<TextBlock Margin="5" VerticalAlignment="Center" Text="颜色"/>
|
||||
</DockPanel>
|
||||
<StackPanel Visibility="{Binding BrushType,Converter={converter:ConverterValueMapSetToVisibility},ConverterParameter='LinearGradientBrush^RadialGradientBrush'}">
|
||||
<DockPanel Visibility="{Binding BrushType,Converter={converter:ConverterValueMapSetToVisibility},ConverterParameter='LinearGradientBrush'}">
|
||||
<Fluent:ComboBox DockPanel.Dock="Right" Margin="5" Size="Small" Width="140" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:LinearOrientation}" SelectedItem="{Binding LinearOrientation}">
|
||||
<StackPanel Visibility="{Binding BrushType,Converter={dd:ConverterValueMapSetToVisibility},ConverterParameter='LinearGradientBrush^RadialGradientBrush'}">
|
||||
<DockPanel Visibility="{Binding BrushType,Converter={dd:ConverterValueMapSetToVisibility},ConverterParameter='LinearGradientBrush'}">
|
||||
<Fluent:ComboBox DockPanel.Dock="Right" Margin="5" Size="Small" Width="140" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:LinearOrientation}" SelectedItem="{Binding LinearOrientation}">
|
||||
<Fluent:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
|
||||
@@ -67,8 +67,8 @@
|
||||
</Fluent:ComboBox>
|
||||
<TextBlock Text="方向" VerticalAlignment="Center" Margin="5"/>
|
||||
</DockPanel>
|
||||
<DockPanel Visibility="{Binding BrushType,Converter={converter:ConverterValueMapSetToVisibility},ConverterParameter='RadialGradientBrush'}">
|
||||
<Fluent:ComboBox DockPanel.Dock="Right" Margin="5" Size="Small" Width="140" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:RadialOrientation}" SelectedItem="{Binding RadialOrientation}">
|
||||
<DockPanel Visibility="{Binding BrushType,Converter={dd:ConverterValueMapSetToVisibility},ConverterParameter='RadialGradientBrush'}">
|
||||
<Fluent:ComboBox DockPanel.Dock="Right" Margin="5" Size="Small" Width="140" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:RadialOrientation}" SelectedItem="{Binding RadialOrientation}">
|
||||
<Fluent:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
|
||||
@@ -84,7 +84,7 @@
|
||||
</DockPanel>
|
||||
<controls:GradientStopControl />
|
||||
</StackPanel>
|
||||
<StackPanel Visibility="{Binding BrushType,Converter={converter:ConverterValueSetToOppositeVisibility},ConverterParameter='None'}">
|
||||
<StackPanel Visibility="{Binding BrushType,Converter={dd:ConverterValueSetToOppositeVisibility},ConverterParameter='None'}">
|
||||
<TextBlock Text="亮度" VerticalAlignment="Center" Margin="5"/>
|
||||
<DockPanel>
|
||||
<Fluent:Spinner DockPanel.Dock="Right" Margin="5" Width="60" Size="Small" Value="{Binding Light}" Maximum="1" Minimum="-1"
|
||||
@@ -92,7 +92,7 @@
|
||||
<Slider Margin="5" Maximum="1" Minimum="-1" Value="{Binding Light}" Style="{StaticResource DefaultSlider}"/>
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Visibility="{Binding BrushType,Converter={converter:ConverterValueSetToOppositeVisibility},ConverterParameter='None'}">
|
||||
<StackPanel Visibility="{Binding BrushType,Converter={dd:ConverterValueSetToOppositeVisibility},ConverterParameter='None'}">
|
||||
<TextBlock Text="透明度" VerticalAlignment="Center" Margin="5"/>
|
||||
<DockPanel>
|
||||
<Fluent:Spinner DockPanel.Dock="Right" Margin="5" Width="60" Size="Small" Value="{Binding Opacity}" Maximum="1" Minimum="0"
|
||||
@@ -104,16 +104,16 @@
|
||||
</TabItem>
|
||||
<TabItem Header="线条" Height="34">
|
||||
<StackPanel
|
||||
DataContext="{Binding SelectedItem.ColorViewModel.LineColor}"
|
||||
DataContext="{Binding SelectedItemViewModel.ColorViewModel.LineColor}"
|
||||
Visibility="{Binding .,Converter={StaticResource NullableToVisibilityConverter}}">
|
||||
<StackPanel>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={converter:ConverterValueMapToBool Parameter='None'}, ConverterParameter='None'}" Content="无线条" />
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={converter:ConverterValueMapToBool Parameter='SolidColorBrush'}, ConverterParameter='SolidColorBrush'}" Content="实线"/>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={converter:ConverterValueMapToBool Parameter='LinearGradientBrush'}, ConverterParameter='LinearGradientBrush'}" Content="线性渐变填充"/>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={converter:ConverterValueMapToBool Parameter='RadialGradientBrush'}, ConverterParameter='RadialGradientBrush'}" Content="径向渐变填充"/>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={dd:ConverterValueMapToBool Parameter='None'}, ConverterParameter='None'}" Content="无线条" />
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={dd:ConverterValueMapToBool Parameter='SolidColorBrush'}, ConverterParameter='SolidColorBrush'}" Content="实线"/>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={dd:ConverterValueMapToBool Parameter='LinearGradientBrush'}, ConverterParameter='LinearGradientBrush'}" Content="线性渐变填充"/>
|
||||
<RadioButton Margin="5" IsChecked="{Binding BrushType,Converter={dd:ConverterValueMapToBool Parameter='RadialGradientBrush'}, ConverterParameter='RadialGradientBrush'}" Content="径向渐变填充"/>
|
||||
</StackPanel>
|
||||
|
||||
<DockPanel Visibility="{Binding BrushType,Converter={converter:ConverterValueMapSetToVisibility},ConverterParameter='SolidColorBrush'}">
|
||||
<DockPanel Visibility="{Binding BrushType,Converter={dd:ConverterValueMapSetToVisibility},ConverterParameter='SolidColorBrush'}">
|
||||
<!-- The following code shows theme colors mode for color gallery -->
|
||||
<Fluent:DropDownButton DockPanel.Dock="Right" Margin="5" Height="24" Width="60"
|
||||
Template="{StaticResource RibbonDropDownButtonControlTemplate1}"
|
||||
@@ -136,9 +136,9 @@
|
||||
</Fluent:DropDownButton>
|
||||
<TextBlock Margin="5" VerticalAlignment="Center" Text="颜色"/>
|
||||
</DockPanel>
|
||||
<StackPanel Visibility="{Binding BrushType,Converter={converter:ConverterValueMapSetToVisibility},ConverterParameter='LinearGradientBrush^RadialGradientBrush'}">
|
||||
<DockPanel Visibility="{Binding BrushType,Converter={converter:ConverterValueMapSetToVisibility},ConverterParameter='LinearGradientBrush'}">
|
||||
<Fluent:ComboBox DockPanel.Dock="Right" Margin="5" Size="Small" Width="140" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:LinearOrientation}" SelectedItem="{Binding LinearOrientation}">
|
||||
<StackPanel Visibility="{Binding BrushType,Converter={dd:ConverterValueMapSetToVisibility},ConverterParameter='LinearGradientBrush^RadialGradientBrush'}">
|
||||
<DockPanel Visibility="{Binding BrushType,Converter={dd:ConverterValueMapSetToVisibility},ConverterParameter='LinearGradientBrush'}">
|
||||
<Fluent:ComboBox DockPanel.Dock="Right" Margin="5" Size="Small" Width="140" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:LinearOrientation}" SelectedItem="{Binding LinearOrientation}">
|
||||
<Fluent:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
|
||||
@@ -147,8 +147,8 @@
|
||||
</Fluent:ComboBox>
|
||||
<TextBlock Text="方向" VerticalAlignment="Center" Margin="5"/>
|
||||
</DockPanel>
|
||||
<DockPanel Visibility="{Binding BrushType,Converter={converter:ConverterValueMapSetToVisibility},ConverterParameter='RadialGradientBrush'}">
|
||||
<Fluent:ComboBox DockPanel.Dock="Right" Margin="5" Size="Small" Width="140" IsEditable="False" helper:EnumHelper.Enum="{x:Type dd:RadialOrientation}" SelectedItem="{Binding RadialOrientation}">
|
||||
<DockPanel Visibility="{Binding BrushType,Converter={dd:ConverterValueMapSetToVisibility},ConverterParameter='RadialGradientBrush'}">
|
||||
<Fluent:ComboBox DockPanel.Dock="Right" Margin="5" Size="Small" Width="140" IsEditable="False" dd:EnumHelper.Enum="{x:Type dd:RadialOrientation}" SelectedItem="{Binding RadialOrientation}">
|
||||
<Fluent:ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
|
||||
@@ -164,7 +164,7 @@
|
||||
</DockPanel>
|
||||
<controls:GradientStopControl />
|
||||
</StackPanel>
|
||||
<StackPanel Visibility="{Binding BrushType,Converter={converter:ConverterValueSetToOppositeVisibility},ConverterParameter='None'}">
|
||||
<StackPanel Visibility="{Binding BrushType,Converter={dd:ConverterValueSetToOppositeVisibility},ConverterParameter='None'}">
|
||||
<TextBlock Text="亮度" VerticalAlignment="Center" Margin="5"/>
|
||||
<DockPanel>
|
||||
<Fluent:Spinner DockPanel.Dock="Right" Margin="5" Width="60" Size="Small" Value="{Binding Light}" Maximum="1" Minimum="-1"
|
||||
@@ -172,7 +172,7 @@
|
||||
<Slider Margin="5" Maximum="1" Minimum="-1" Value="{Binding Light}" Style="{StaticResource DefaultSlider}"/>
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Visibility="{Binding BrushType,Converter={converter:ConverterValueSetToOppositeVisibility},ConverterParameter='None'}">
|
||||
<StackPanel Visibility="{Binding BrushType,Converter={dd:ConverterValueSetToOppositeVisibility},ConverterParameter='None'}">
|
||||
<TextBlock Text="透明度" VerticalAlignment="Center" Margin="5"/>
|
||||
<DockPanel>
|
||||
<Fluent:Spinner DockPanel.Dock="Right" Margin="5" Width="60" Size="Small" Value="{Binding Opacity}" Maximum="1" Minimum="0"
|
||||
@@ -198,21 +198,21 @@
|
||||
<TabControl Style="{StaticResource UniformTabControlStyle}">
|
||||
<TabItem Header="图片" Height="34">
|
||||
<UniformGrid Columns="2" VerticalAlignment="Top">
|
||||
<Fluent:Button Header="插入图片" VerticalAlignment="Top" Command="{Binding AddImageCommand}">
|
||||
<Fluent:Button Header="插入图片" VerticalAlignment="Top" Command="{Binding PageViewModel.AddImageCommand}">
|
||||
<Fluent:Button.LargeIcon>
|
||||
<iconPacks:PackIconMaterial Kind="Image" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
</Fluent:Button.LargeIcon>
|
||||
</Fluent:Button>
|
||||
<Fluent:Button Header="改变图片" VerticalAlignment="Top" Command="{Binding EditImageCommand}">
|
||||
<Fluent:Button Header="改变图片" VerticalAlignment="Top" Command="{Binding PageViewModel.EditImageCommand}">
|
||||
<Fluent:Button.LargeIcon>
|
||||
<iconPacks:PackIconMaterial Kind="ImageEdit" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
</Fluent:Button.LargeIcon>
|
||||
</Fluent:Button>
|
||||
<Fluent:SplitButton Header="图片裁剪" VerticalAlignment="Top" HorizontalAlignment="Stretch" Command="{Binding ResizeImageCommand}">
|
||||
<Fluent:SplitButton Header="图片裁剪" VerticalAlignment="Top" HorizontalAlignment="Stretch" Command="{Binding PageViewModel.ResizeImageCommand}">
|
||||
<Fluent:SplitButton.LargeIcon>
|
||||
<iconPacks:PackIconMaterial Kind="ImagePlus" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
</Fluent:SplitButton.LargeIcon>
|
||||
<ListBox helper:EnumHelper.Enum="{x:Type dd:ClipMode}" SelectedItem="{Binding SelectedItem.ClipMode}" BorderThickness="0">
|
||||
<ListBox dd:EnumHelper.Enum="{x:Type dd:ClipMode}" SelectedItem="{Binding SelectedItemViewModel.ClipMode}" BorderThickness="0">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding .,Converter={StaticResource EnumDescriptionConverter}}" />
|
||||
@@ -220,7 +220,7 @@
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Fluent:SplitButton>
|
||||
<Fluent:Button Header="原始图" VerticalAlignment="Top" Command="{Binding ResetImageCommand}">
|
||||
<Fluent:Button Header="原始图" VerticalAlignment="Top" Command="{Binding PageViewModel.ResetImageCommand}">
|
||||
<Fluent:Button.LargeIcon>
|
||||
<iconPacks:PackIconMaterial Kind="ImageRemove" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
</Fluent:Button.LargeIcon>
|
||||
@@ -229,7 +229,7 @@
|
||||
</TabItem>
|
||||
<TabItem Header="视频" Height="34">
|
||||
<UniformGrid Columns="2" VerticalAlignment="Top">
|
||||
<Fluent:Button Header="插入视频" VerticalAlignment="Top" Command="{Binding AddVideoCommand}">
|
||||
<Fluent:Button Header="插入视频" VerticalAlignment="Top" Command="{Binding PageViewModel.AddVideoCommand}">
|
||||
<Fluent:Button.LargeIcon>
|
||||
<iconPacks:PackIconMaterial Kind="Video" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
</Fluent:Button.LargeIcon>
|
||||
@@ -238,12 +238,12 @@
|
||||
</TabItem>
|
||||
<TabItem Header="二维码" Height="34">
|
||||
<UniformGrid Columns="2" VerticalAlignment="Top">
|
||||
<Fluent:Button Header="插入二维码" VerticalAlignment="Top" Command="{Binding AddBarcodeCommand}" CommandParameter="QR_CODE">
|
||||
<Fluent:Button Header="插入二维码" VerticalAlignment="Top" Command="{Binding PageViewModel.AddBarcodeCommand}" CommandParameter="QR_CODE">
|
||||
<Fluent:Button.LargeIcon>
|
||||
<iconPacks:PackIconMaterial Kind="Qrcode" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
</Fluent:Button.LargeIcon>
|
||||
</Fluent:Button>
|
||||
<Fluent:Button Header="插入条形码" VerticalAlignment="Top" Command="{Binding AddBarcodeCommand}" CommandParameter="CODE_39">
|
||||
<Fluent:Button Header="插入条形码" VerticalAlignment="Top" Command="{Binding PageViewModel.AddBarcodeCommand}" CommandParameter="CODE_39">
|
||||
<Fluent:Button.LargeIcon>
|
||||
<iconPacks:PackIconMaterial Kind="Barcode" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||
</Fluent:Button.LargeIcon>
|
||||
@@ -254,8 +254,8 @@
|
||||
</ControlTemplate>
|
||||
|
||||
<ControlTemplate TargetType="Control" x:Key="PropertyTemplate">
|
||||
<controls:PropertiesView SelectedObject="{Binding SelectedItem}">
|
||||
<controls:PropertiesView.Resources>
|
||||
<dd:PropertiesView SelectedObject="{Binding SelectedItemViewModel}">
|
||||
<dd:PropertiesView.Resources>
|
||||
<Style x:Key="ActTypeStyle" TargetType="{x:Type ContentControl}">
|
||||
<Setter Property="ContentTemplate">
|
||||
<Setter.Value>
|
||||
@@ -277,9 +277,9 @@
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<Grid DataContext="{Binding Path=DataContext,RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}">
|
||||
<controls:MultiSelectComboBox BorderThickness="0" DisplayMemberPath="text" SelectedValuePath="value"
|
||||
<dd:MultiSelectComboBox BorderThickness="0" DisplayMemberPath="text" SelectedValuePath="value"
|
||||
SelectedValues="{Binding UserIds}"
|
||||
ItemsSource="{x:Static flowchart:FlowchartService.Users}" ></controls:MultiSelectComboBox>
|
||||
ItemsSource="{x:Static flowchart:FlowchartService.Users}" ></dd:MultiSelectComboBox>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
@@ -290,16 +290,16 @@
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<Grid DataContext="{Binding Path=DataContext,RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}">
|
||||
<controls:MultiSelectComboBox BorderThickness="0" DisplayMemberPath="text" SelectedValuePath="value"
|
||||
<dd:MultiSelectComboBox BorderThickness="0" DisplayMemberPath="text" SelectedValuePath="value"
|
||||
SelectedValues="{Binding RoleIds}"
|
||||
ItemsSource="{x:Static flowchart:FlowchartService.Roles}"></controls:MultiSelectComboBox>
|
||||
ItemsSource="{x:Static flowchart:FlowchartService.Roles}"></dd:MultiSelectComboBox>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</controls:PropertiesView.Resources>
|
||||
</controls:PropertiesView>
|
||||
</Style>
|
||||
</dd:PropertiesView.Resources>
|
||||
</dd:PropertiesView>
|
||||
</ControlTemplate>
|
||||
</UserControl.Resources>
|
||||
<Grid >
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
xmlns:flowchartmodel="clr-namespace:AIStudio.Wpf.Flowchart.Models;assembly=AIStudio.Wpf.Flowchart"
|
||||
xmlns:sfcmodel="clr-namespace:AIStudio.Wpf.SFC.Models;assembly=AIStudio.Wpf.SFC"
|
||||
xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram"
|
||||
xmlns:conventer="clr-namespace:AIStudio.Wpf.DiagramHelper.Converters;assembly=AIStudio.Wpf.DiagramHelper"
|
||||
xmlns:command="clr-namespace:AIStudio.Wpf.DiagramHelper.Commands;assembly=AIStudio.Wpf.DiagramHelper"
|
||||
xmlns:svg="clr-namespace:Svg2XamlTestExtension;assembly=Svg2XamlTestExtension"
|
||||
xmlns:conventer="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Converters;assembly=AIStudio.Wpf.DiagramDesigner.Additionals"
|
||||
xmlns:command="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Commands;assembly=AIStudio.Wpf.DiagramDesigner.Additionals"
|
||||
xmlns:svg="https://gitee.com/akwkevin/aistudio.-wpf.-test/tree/master/Controls/AIStudio.Wpf.Svg2XamlExtension"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300">
|
||||
<UserControl.Resources>
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
|
||||
<DataTemplate DataType="{x:Type model:ImageToolBoxData}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||
<Rectangle Name="Border"
|
||||
StrokeThickness="1"
|
||||
StrokeDashArray="2"
|
||||
@@ -41,7 +41,7 @@
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type model:MediaToolBoxData}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||
<Rectangle Name="Border"
|
||||
StrokeThickness="1"
|
||||
StrokeDashArray="2"
|
||||
@@ -59,7 +59,7 @@
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type model:TextToolBoxData}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||
<Rectangle Name="Border"
|
||||
StrokeThickness="1"
|
||||
StrokeDashArray="2"
|
||||
@@ -75,7 +75,7 @@
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type model:EllipseTextToolBoxData}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||
<Ellipse Name="Border"
|
||||
StrokeThickness="1"
|
||||
StrokeDashArray="2"
|
||||
@@ -91,7 +91,7 @@
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type model:PathToolBoxData}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||
<Rectangle Name="Border"
|
||||
StrokeThickness="1"
|
||||
StrokeDashArray="2"
|
||||
@@ -106,7 +106,7 @@
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type model:SvgToolBoxData}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||
<Rectangle Name="Border"
|
||||
StrokeThickness="1"
|
||||
StrokeDashArray="2"
|
||||
@@ -121,7 +121,7 @@
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type model:DesignerItemToolBoxData}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||
<Grid.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="删除" Command="{StaticResource DeleteItemCommandReference}" CommandParameter="{Binding .}"/>
|
||||
@@ -132,9 +132,9 @@
|
||||
StrokeDashArray="2"
|
||||
Fill="Transparent"
|
||||
SnapsToDevicePixels="true"/>
|
||||
<Viewbox Stretch="Uniform" DataContext="{Binding DesignerItemViewModel}">
|
||||
<Viewbox Stretch="Uniform" DataContext="{Binding DesignerItemViewModel}" Margin="2">
|
||||
<Grid Width="{Binding ItemWidth}" Height="{Binding ItemHeight}" IsHitTestVisible="False">
|
||||
<ContentControl Content="{Binding .}" Margin="2"/>
|
||||
<ContentControl Content="{Binding .}" />
|
||||
<TextBox Text="{Binding Text}"
|
||||
IsReadOnly="True"
|
||||
TextWrapping="Wrap"
|
||||
@@ -161,8 +161,61 @@
|
||||
</Trigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type model:MultipleDesignerItemToolBoxData}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||
<Grid.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="删除" Command="{StaticResource DeleteItemCommandReference}" CommandParameter="{Binding .}"/>
|
||||
</ContextMenu>
|
||||
</Grid.ContextMenu>
|
||||
<Rectangle Name="Border"
|
||||
StrokeThickness="1"
|
||||
StrokeDashArray="2"
|
||||
Fill="Transparent"
|
||||
SnapsToDevicePixels="true"/>
|
||||
<Viewbox Stretch="Uniform" Margin="2">
|
||||
<ItemsControl ItemsSource="{Binding SelectableDesignerItemViewModels}"
|
||||
Width="{Binding CanvasWidth}"
|
||||
Height="{Binding CanvasHeight}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<Canvas x:Name="rootCanvas"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.Template>
|
||||
<ControlTemplate TargetType="{x:Type ItemsControl}">
|
||||
<Grid>
|
||||
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</ItemsControl.Template>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Width="{Binding ItemWidth}" Height="{Binding ItemHeight}" IsHitTestVisible="False">
|
||||
<ContentControl Content="{Binding .}" Margin="2"/>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
<ItemsControl.Resources>
|
||||
<Style TargetType="{x:Type ContentPresenter}">
|
||||
<Setter Property="Canvas.Left" Value="{Binding Left}" />
|
||||
<Setter Property="Canvas.Top" Value="{Binding Top}" />
|
||||
</Style>
|
||||
</ItemsControl.Resources>
|
||||
</ItemsControl>
|
||||
</Viewbox>
|
||||
|
||||
</Grid>
|
||||
<DataTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter TargetName="Border" Property="Stroke" Value="Gray"/>
|
||||
</Trigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type flowchartmodel:FlowchartToolBoxData}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}">
|
||||
<Grid Width="{Binding Width}" Height="{Binding Height}" ToolTip="{Binding Description}">
|
||||
<Rectangle Name="Border"
|
||||
StrokeThickness="1"
|
||||
StrokeDashArray="2"
|
||||
|
||||
BIN
AIStudio.Wpf.DiagramDesigner.Additionals/A.ico
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
AIStudio.Wpf.DiagramDesigner.Additionals/A.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,35 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
|
||||
|
||||
<PropertyGroup>
|
||||
<UseWPF>true</UseWPF>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<Company>AIStudio.Wpf.Controls</Company>
|
||||
<Authors>akwkevin</Authors>
|
||||
<PackageProjectUrl>https://gitee.com/akwkevin</PackageProjectUrl>
|
||||
<PackageIcon>A.png</PackageIcon>
|
||||
<PackageIconUrl />
|
||||
<NeutralLanguage />
|
||||
<Version>1.0.1</Version>
|
||||
<Description>一个Wpf的Diagram控件帮助库</Description>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Fluent.Ribbon" Version="8.0.3" />
|
||||
<PackageReference Include="MahApps.Metro.IconPacks" Version="4.8.0" />
|
||||
<PackageReference Include="AIStudio.Wpf.Svg2XamlExtension" Version="1.2.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="ZXing.Net" Version="0.16.8" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AIStudio.Wpf.DiagramDesigner\AIStudio.Wpf.DiagramDesigner.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="A.png">
|
||||
<Pack>True</Pack>
|
||||
<PackagePath></PackagePath>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,228 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<AssemblyName>AIStudio.Wpf.DiagramDesigner.Additionals</AssemblyName>
|
||||
<IntermediateOutputPath>obj\Debug\</IntermediateOutputPath>
|
||||
<BaseIntermediateOutputPath>obj\</BaseIntermediateOutputPath>
|
||||
<MSBuildProjectExtensionsPath>F:\aistudio.-wpf.-diagram\AIStudio.Wpf.DiagramDesigner.Additionals\obj\</MSBuildProjectExtensionsPath>
|
||||
<_TargetAssemblyProjectName>AIStudio.Wpf.DiagramDesigner.Additionals</_TargetAssemblyProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
|
||||
<PropertyGroup>
|
||||
<UseWPF>true</UseWPF>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<Company>AIStudio.Wpf.Controls</Company>
|
||||
<Authors>akwkevin</Authors>
|
||||
<PackageProjectUrl>https://gitee.com/akwkevin</PackageProjectUrl>
|
||||
<PackageIcon>A.png</PackageIcon>
|
||||
<PackageIconUrl />
|
||||
<NeutralLanguage />
|
||||
<Version>1.0.1</Version>
|
||||
<Description>一个Wpf的Diagram控件帮助库</Description>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Fluent.Ribbon" Version="8.0.3" />
|
||||
<PackageReference Include="MahApps.Metro.IconPacks" Version="4.8.0" />
|
||||
<PackageReference Include="AIStudio.Wpf.Svg2XamlExtension" Version="1.2.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="ZXing.Net" Version="0.16.8" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AIStudio.Wpf.DiagramDesigner\AIStudio.Wpf.DiagramDesigner.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="A.png">
|
||||
<Pack>True</Pack>
|
||||
<PackagePath>
|
||||
</PackagePath>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ReferencePath Include="F:\aistudio.-wpf.-diagram\AIStudio.Wpf.DiagramDesigner\bin\Debug\net461\AIStudio.Wpf.DiagramDesigner.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\aistudio.wpf.svg2xamlextension\1.2.2\lib\net461\AIStudio.Wpf.Svg2XamlExtension.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\controlzex\4.4.0\lib\net45\ControlzEx.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\fluent.ribbon\8.0.3\lib\net452\Fluent.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.BootstrapIcons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.BoxIcons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.Codicons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.Core.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.Entypo.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.EvaIcons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.FeatherIcons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.FileIcons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.Fontaudio.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.FontAwesome.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.ForkAwesome.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.Ionicons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.JamIcons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.Material.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.MaterialDesign.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.MaterialLight.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.Microns.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.Modern.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.Octicons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.PicolIcons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.PixelartIcons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.RadixIcons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.RemixIcon.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.RPGAwesome.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.SimpleIcons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.Typicons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.Unicons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.VaadinIcons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.WeatherIcons.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\mahapps.metro.iconpacks\4.8.0\lib\net46\MahApps.Metro.IconPacks.Zondicons.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\Microsoft.Win32.Primitives.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\microsoft.xaml.behaviors.wpf\1.1.31\lib\net45\Microsoft.Xaml.Behaviors.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\mscorlib.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\netfx.force.conflicts.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\netstandard.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\newtonsoft.json\13.0.1\lib\net45\Newtonsoft.Json.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\PresentationCore.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\PresentationFramework.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\svgpathproperties\1.1.2\lib\netstandard2.0\SvgPathProperties.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.AppContext.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\system.codedom\7.0.0\lib\netstandard2.0\System.CodeDom.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Collections.Concurrent.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Collections.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Collections.NonGeneric.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Collections.Specialized.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.ComponentModel.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.ComponentModel.EventBasedAsync.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.ComponentModel.Primitives.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.ComponentModel.TypeConverter.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Console.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Core.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Data.Common.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Data.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Diagnostics.Contracts.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Diagnostics.Debug.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Diagnostics.FileVersionInfo.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Diagnostics.Process.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Diagnostics.StackTrace.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Diagnostics.TextWriterTraceListener.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Diagnostics.Tools.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Diagnostics.TraceSource.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Diagnostics.Tracing.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Drawing.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Drawing.Primitives.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Dynamic.Runtime.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Globalization.Calendars.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Globalization.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Globalization.Extensions.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.IO.Compression.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.IO.Compression.FileSystem.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.IO.Compression.ZipFile.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.IO.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.IO.FileSystem.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.IO.FileSystem.DriveInfo.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.IO.FileSystem.Primitives.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.IO.FileSystem.Watcher.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.IO.IsolatedStorage.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.IO.MemoryMappedFiles.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.IO.Pipes.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.IO.UnmanagedMemoryStream.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Linq.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Linq.Expressions.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Linq.Parallel.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Linq.Queryable.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\system.management\7.0.0\lib\netstandard2.0\System.Management.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Net.Http.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Net.NameResolution.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Net.NetworkInformation.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Net.Ping.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Net.Primitives.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Net.Requests.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Net.Security.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Net.Sockets.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Net.WebHeaderCollection.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Net.WebSockets.Client.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Net.WebSockets.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Numerics.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.ObjectModel.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\system.reactive\5.0.0\lib\netstandard2.0\System.Reactive.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Reflection.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Reflection.Extensions.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Reflection.Primitives.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Resources.Reader.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Resources.ResourceManager.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Resources.Writer.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\system.runtime.compilerservices.unsafe\4.5.3\ref\net461\System.Runtime.CompilerServices.Unsafe.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Runtime.CompilerServices.VisualC.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Runtime.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Runtime.Extensions.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Runtime.Handles.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Runtime.InteropServices.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Runtime.InteropServices.RuntimeInformation.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Runtime.Numerics.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Runtime.Serialization.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Runtime.Serialization.Formatters.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Runtime.Serialization.Json.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Runtime.Serialization.Primitives.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Runtime.Serialization.Xml.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Security.Claims.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Security.Cryptography.Algorithms.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Security.Cryptography.Csp.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Security.Cryptography.Encoding.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Security.Cryptography.Primitives.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Security.Cryptography.X509Certificates.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Security.Principal.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Security.SecureString.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Text.Encoding.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Text.Encoding.Extensions.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Text.RegularExpressions.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Threading.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Threading.Overlapped.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Threading.Tasks.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\system.threading.tasks.extensions\4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Threading.Tasks.Parallel.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Threading.Thread.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Threading.ThreadPool.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Threading.Timer.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.ValueTuple.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Web.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Web.Extensions.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Windows.Controls.Ribbon.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Windows.Forms.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Xaml.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Xml.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\System.Xml.Linq.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Xml.ReaderWriter.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Xml.XDocument.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Xml.XmlDocument.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Xml.XmlSerializer.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Xml.XPath.dll" />
|
||||
<ReferencePath Include="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Xml.XPath.XDocument.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\UIAutomationClient.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\UIAutomationClientsideProviders.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\UIAutomationProvider.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\UIAutomationTypes.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\WindowsBase.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\WindowsFormsIntegration.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\wpfanimatedgif\2.0.0\lib\net40\WpfAnimatedGif.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\zxing.net\0.16.8\lib\net461\zxing.dll" />
|
||||
<ReferencePath Include="C:\Users\Administrator\.nuget\packages\zxing.net\0.16.8\lib\net461\zxing.presentation.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.ComponentModel.Annotations.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Reflection.Emit.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Reflection.Emit.ILGeneration.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Reflection.Emit.Lightweight.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Runtime.InteropServices.WindowsRuntime.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.ServiceModel.Duplex.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.ServiceModel.Http.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.ServiceModel.NetTcp.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.ServiceModel.Primitives.dll" />
|
||||
<ReferencePath Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.ServiceModel.Security.dll" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="F:\aistudio.-wpf.-diagram\AIStudio.Wpf.DiagramDesigner.Additionals\obj\Debug\net461\Controls\Barcode.g.cs" />
|
||||
<Compile Include="F:\aistudio.-wpf.-diagram\AIStudio.Wpf.DiagramDesigner.Additionals\obj\Debug\net461\Controls\GradientStopControl.g.cs" />
|
||||
<Compile Include="F:\aistudio.-wpf.-diagram\AIStudio.Wpf.DiagramDesigner.Additionals\obj\Debug\net461\Controls\SliderRotation.g.cs" />
|
||||
<Compile Include="F:\aistudio.-wpf.-diagram\AIStudio.Wpf.DiagramDesigner.Additionals\obj\Debug\net461\GeneratedInternalTypeHelper.g.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Analyzer Include="C:\Users\Administrator\.nuget\packages\wpfanalyzers\3.5.4\analyzers\dotnet\cs\Gu.Roslyn.Extensions.dll" />
|
||||
<Analyzer Include="C:\Users\Administrator\.nuget\packages\wpfanalyzers\3.5.4\analyzers\dotnet\cs\WpfAnalyzers.dll" />
|
||||
</ItemGroup>
|
||||
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
|
||||
</Project>
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Commands
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// This class allows delegating the commanding logic to methods passed as parameters,
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Commands
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Commands
|
||||
{
|
||||
public class CommandReference : Freezable, ICommand
|
||||
{
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Commands
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// The CompositeCommand composes one or more ICommands.
|
||||
@@ -8,7 +8,7 @@ using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Commands
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Commands
|
||||
{
|
||||
[MarkupExtensionReturnType(typeof(object))]
|
||||
public class ControlBinding : MarkupExtension
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Commands
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Commands
|
||||
{
|
||||
#region ConbrolCommand
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Commands
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// An <see cref="ICommand"/> whose delegates can be attached for <see cref="Execute(T)"/> and <see cref="CanExecute(T)"/>.
|
||||
@@ -5,7 +5,7 @@ using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Commands
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// An <see cref="ICommand"/> whose delegates do not take any parameters for <see cref="Execute()"/> and <see cref="CanExecute()"/>.
|
||||
@@ -8,7 +8,7 @@ using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Commands
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// An <see cref="ICommand"/> whose delegates can be attached for <see cref="Execute"/> and <see cref="CanExecute"/>.
|
||||
@@ -4,7 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Commands
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface that defines if the object instance is active
|
||||
@@ -4,7 +4,7 @@ using System.ComponentModel;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Commands
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// Provide a way to observe property changes of INotifyPropertyChanged objects and invokes a
|
||||
@@ -6,7 +6,7 @@ using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Commands
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents each node of nested properties expression and takes care of
|
||||
@@ -5,7 +5,7 @@ using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// 包含一些常用的动画辅助方法
|
||||
@@ -1,9 +1,9 @@
|
||||
<UserControl x:Class="AIStudio.Wpf.DiagramHelper.Controls.Barcode"
|
||||
<UserControl x:Class="AIStudio.Wpf.DiagramDesigner.Additionals.Controls.Barcode"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:AIStudio.Wpf.DiagramHelper.Controls"
|
||||
xmlns:local="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
@@ -1,22 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using WpfAnimatedGif;
|
||||
using ZXing;
|
||||
#if !NET5_0_OR_GREATER
|
||||
using ZXing.Presentation;
|
||||
#endif
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Barcode.xaml 的交互逻辑
|
||||
@@ -29,7 +22,7 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
|
||||
"Text", typeof(string), typeof(Barcode), new FrameworkPropertyMetadata(
|
||||
nameof(Text), typeof(string), typeof(Barcode), new FrameworkPropertyMetadata(
|
||||
string.Empty,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure |
|
||||
FrameworkPropertyMetadataOptions.AffectsRender, OnFormattedTextInvalidated));
|
||||
@@ -41,7 +34,7 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty FormatProperty = DependencyProperty.Register(
|
||||
"Format", typeof(BarcodeFormat), typeof(Barcode), new FrameworkPropertyMetadata(
|
||||
nameof(Format), typeof(BarcodeFormat), typeof(Barcode), new FrameworkPropertyMetadata(
|
||||
BarcodeFormat.QR_CODE,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure |
|
||||
FrameworkPropertyMetadataOptions.AffectsRender, OnFormattedTextInvalidated));
|
||||
@@ -53,7 +46,7 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty SizeProperty = DependencyProperty.Register(
|
||||
"Size", typeof(double), typeof(Barcode), new FrameworkPropertyMetadata(
|
||||
nameof(Size), typeof(double), typeof(Barcode), new FrameworkPropertyMetadata(
|
||||
512d,
|
||||
FrameworkPropertyMetadataOptions.AffectsMeasure |
|
||||
FrameworkPropertyMetadataOptions.AffectsRender, OnFormattedTextInvalidated));
|
||||
@@ -65,7 +58,7 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
|
||||
"Icon", typeof(string), typeof(Barcode), new FrameworkPropertyMetadata(null, OnIconChanged));
|
||||
nameof(Icon), typeof(string), typeof(Barcode), new FrameworkPropertyMetadata(null, OnIconChanged));
|
||||
|
||||
public string Icon
|
||||
{
|
||||
@@ -112,6 +105,20 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
|
||||
private void OnFormattedTextInvalidated()
|
||||
{
|
||||
#if NET5_0_OR_GREATER
|
||||
var writer = new BarcodeWriter<Geometry>()
|
||||
{
|
||||
Format = Format,
|
||||
Options = new ZXing.Common.EncodingOptions
|
||||
{
|
||||
Height = (int)this.Size,
|
||||
Width = (int)this.Size,
|
||||
Margin = 0
|
||||
}
|
||||
};
|
||||
var image = writer.Write(Text ?? "AIStudio画板");
|
||||
imageBarcodeEncoderGeometry.Data = image;
|
||||
#else
|
||||
var writer = new BarcodeWriterGeometry
|
||||
{
|
||||
Format = Format,
|
||||
@@ -124,6 +131,7 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
};
|
||||
var image = writer.Write(Text ?? "AIStudio画板");
|
||||
imageBarcodeEncoderGeometry.Data = image;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
<UserControl x:Class="AIStudio.Wpf.DiagramHelper.Controls.GradientStopControl"
|
||||
<UserControl x:Class="AIStudio.Wpf.DiagramDesigner.Additionals.Controls.GradientStopControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:AIStudio.Wpf.DiagramHelper.Controls"
|
||||
xmlns:local="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Controls"
|
||||
xmlns:Fluent="urn:fluent-ribbon"
|
||||
xmlns:converter="clr-namespace:AIStudio.Wpf.DiagramHelper.Converters"
|
||||
xmlns:helper="clr-namespace:AIStudio.Wpf.DiagramHelper.Helpers"
|
||||
xmlns:converter="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Converters"
|
||||
xmlns:helper="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals"
|
||||
xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram"
|
||||
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
|
||||
mc:Ignorable="d"
|
||||
@@ -14,7 +14,7 @@ using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// GradientStopControl.xaml 的交互逻辑
|
||||
@@ -6,58 +6,58 @@
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
||||
mc:Ignorable="options d">
|
||||
<!-- Matadata -->
|
||||
<system:String x:Key="Theme.Name">{{ThemeName}}</system:String>
|
||||
<system:String x:Key="Theme.Name">Light.Blue</system:String>
|
||||
<system:String x:Key="Theme.Origin">Fluent.Ribbon</system:String>
|
||||
<system:String x:Key="Theme.DisplayName">{{ThemeDisplayName}}</system:String>
|
||||
<system:String x:Key="Theme.BaseColorScheme">{{BaseColorScheme}}</system:String>
|
||||
<system:String x:Key="Theme.ColorScheme">{{ColorScheme}}</system:String>
|
||||
<system:String x:Key="Theme.AlternativeColorScheme">{{AlternativeColorScheme}}</system:String>
|
||||
<system:String x:Key="Theme.DisplayName">Blue (Light)</system:String>
|
||||
<system:String x:Key="Theme.BaseColorScheme">Light</system:String>
|
||||
<system:String x:Key="Theme.ColorScheme">Blue</system:String>
|
||||
<system:String x:Key="Theme.AlternativeColorScheme">Blue</system:String>
|
||||
|
||||
<Color x:Key="Theme.PrimaryAccentColor">{{Fluent.Ribbon.Colors.AccentBaseColor}}</Color>
|
||||
<SolidColorBrush x:Key="Theme.ShowcaseBrush" Color="{{Fluent.Ribbon.Colors.AccentBaseColor}}" options:Freeze="True" />
|
||||
<system:Boolean x:Key="Theme.IsHighContrast">{{IsHighContrast}}</system:Boolean>
|
||||
<Color x:Key="Theme.PrimaryAccentColor">#FF0078D7</Color>
|
||||
<SolidColorBrush x:Key="Theme.ShowcaseBrush" Color="#FF0078D7" options:Freeze="True" />
|
||||
<system:Boolean x:Key="Theme.IsHighContrast">False</system:Boolean>
|
||||
|
||||
<!-- COLORS -->
|
||||
|
||||
<!-- Accent colors -->
|
||||
<Color x:Key="Fluent.Ribbon.Colors.AccentBaseColor">{{Fluent.Ribbon.Colors.AccentBaseColor}}</Color>
|
||||
<Color x:Key="Fluent.Ribbon.Colors.AccentBaseColor">#FF0078D7</Color>
|
||||
<!--80%-->
|
||||
<Color x:Key="Fluent.Ribbon.Colors.AccentColor80">{{Fluent.Ribbon.Colors.AccentColor80}}</Color>
|
||||
<Color x:Key="Fluent.Ribbon.Colors.AccentColor80">#CC0078D7</Color>
|
||||
<!--60%-->
|
||||
<Color x:Key="Fluent.Ribbon.Colors.AccentColor60">{{Fluent.Ribbon.Colors.AccentColor60}}</Color>
|
||||
<Color x:Key="Fluent.Ribbon.Colors.AccentColor60">#990078D7</Color>
|
||||
<!--40%-->
|
||||
<Color x:Key="Fluent.Ribbon.Colors.AccentColor40">{{Fluent.Ribbon.Colors.AccentColor40}}</Color>
|
||||
<Color x:Key="Fluent.Ribbon.Colors.AccentColor40">#660078D7</Color>
|
||||
<!--20%-->
|
||||
<Color x:Key="Fluent.Ribbon.Colors.AccentColor20">{{Fluent.Ribbon.Colors.AccentColor20}}</Color>
|
||||
<Color x:Key="Fluent.Ribbon.Colors.AccentColor20">#330078D7</Color>
|
||||
|
||||
<Color x:Key="Fluent.Ribbon.Colors.HighlightColor">{{Fluent.Ribbon.Colors.HighlightColor}}</Color>
|
||||
<Color x:Key="Fluent.Ribbon.Colors.HighlightColor">#FF086F9E</Color>
|
||||
|
||||
<!-- Base colors -->
|
||||
<Color x:Key="BlackColor">{{BlackColor}}</Color>
|
||||
<Color x:Key="BlackColor20">{{BlackColor20}}</Color>
|
||||
<Color x:Key="WhiteColor">{{WhiteColor}}</Color>
|
||||
<Color x:Key="WhiteColor20">{{WhiteColor20}}</Color>
|
||||
<Color x:Key="Gray1">{{Gray1}}</Color>
|
||||
<Color x:Key="Gray2">{{Gray2}}</Color>
|
||||
<Color x:Key="Gray3">{{Gray3}}</Color>
|
||||
<Color x:Key="Gray4">{{Gray4}}</Color>
|
||||
<Color x:Key="Gray5">{{Gray5}}</Color>
|
||||
<Color x:Key="Gray6">{{Gray6}}</Color>
|
||||
<Color x:Key="Gray7">{{Gray7}}</Color>
|
||||
<Color x:Key="Gray8">{{Gray8}}</Color>
|
||||
<Color x:Key="Gray9">{{Gray9}}</Color>
|
||||
<Color x:Key="Gray10">{{Gray10}}</Color>
|
||||
<Color x:Key="BlackColor">#FF000000</Color>
|
||||
<Color x:Key="BlackColor20">#51000000</Color>
|
||||
<Color x:Key="WhiteColor">#FFFFFFFF</Color>
|
||||
<Color x:Key="WhiteColor20">#51FFFFFF</Color>
|
||||
<Color x:Key="Gray1">#FF333333</Color>
|
||||
<Color x:Key="Gray2">#FF7F7F7F</Color>
|
||||
<Color x:Key="Gray3">#FF9D9D9D</Color>
|
||||
<Color x:Key="Gray4">#FFA59F93</Color>
|
||||
<Color x:Key="Gray5">#FFB9B9B9</Color>
|
||||
<Color x:Key="Gray6">#FFCCCCCC</Color>
|
||||
<Color x:Key="Gray7">#FFD8D8D9</Color>
|
||||
<Color x:Key="Gray8">#FFE0E0E0</Color>
|
||||
<Color x:Key="Gray9">#5EC9C9C9</Color>
|
||||
<Color x:Key="Gray10">#FFF7F7F7</Color>
|
||||
|
||||
<Color x:Key="TransparentWhiteColor">#00FFFFFF</Color>
|
||||
<Color x:Key="Fluent.Ribbon.Colors.HighTransparentWhiteColor">#17FFFFFF</Color>
|
||||
|
||||
<!-- Foreground -->
|
||||
<Color x:Key="Fluent.Ribbon.Colors.IdealForegroundColor">{{Fluent.Ribbon.Colors.IdealForegroundColor}}</Color>
|
||||
<Color x:Key="Fluent.Ribbon.Colors.DarkIdealForegroundDisabledColor">{{Fluent.Ribbon.Colors.DarkIdealForegroundDisabledColor}}</Color>
|
||||
<Color x:Key="Fluent.Ribbon.Colors.IdealForegroundColor">White</Color>
|
||||
<Color x:Key="Fluent.Ribbon.Colors.DarkIdealForegroundDisabledColor">#ADADAD</Color>
|
||||
|
||||
<!-- Misc colors -->
|
||||
<Color x:Key="Fluent.Ribbon.Colors.ExtremeHighlightColor">{{Fluent.Ribbon.Colors.ExtremeHighlightColor}}</Color>
|
||||
<Color x:Key="Fluent.Ribbon.Colors.DarkExtremeHighlightColor">{{Fluent.Ribbon.Colors.DarkExtremeHighlightColor}}</Color>
|
||||
<Color x:Key="Fluent.Ribbon.Colors.ExtremeHighlightColor">#FFFFD232</Color>
|
||||
<Color x:Key="Fluent.Ribbon.Colors.DarkExtremeHighlightColor">#FFF29536</Color>
|
||||
|
||||
<!-- END COLORS -->
|
||||
|
||||
@@ -99,26 +99,26 @@
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.IdealForegroundColorBrush" Color="{StaticResource Fluent.Ribbon.Colors.IdealForegroundColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.IdealForegroundDisabledBrush" Color="{StaticResource Fluent.Ribbon.Colors.IdealForegroundColor}" Opacity="0.4" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.DarkIdealForegroundDisabledBrush" Color="{StaticResource Fluent.Ribbon.Colors.DarkIdealForegroundDisabledColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.LabelTextBrush" Color="{{Fluent.Ribbon.Brushes.LabelTextBrush}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.LabelTextBrush" Color="{StaticResource BlackColor}" options:Freeze="True" />
|
||||
|
||||
<!-- Generic control brushes -->
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Control.BorderBrush" Color="{StaticResource Gray6}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Control.Disabled.BorderBrush" Color="{StaticResource Gray5}" options:Freeze="True" />
|
||||
|
||||
<!-- Backstage -->
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Backstage.Background" Color="{{Fluent.Ribbon.Brushes.Backstage.Background}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Backstage.Foreground" Color="{{Fluent.Ribbon.Brushes.Backstage.Foreground}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Backstage.BackButton.Background" Color="{{Fluent.Ribbon.Brushes.Backstage.BackButton.Background}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Backstage.BackButton.Foreground" Color="{{Fluent.Ribbon.Brushes.Backstage.BackButton.Foreground}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Backstage.Background" Color="{StaticResource Fluent.Ribbon.Colors.AccentBaseColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Backstage.Foreground" Color="{StaticResource Fluent.Ribbon.Colors.IdealForegroundColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Backstage.BackButton.Background" Color="Transparent" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Backstage.BackButton.Foreground" Color="{StaticResource Fluent.Ribbon.Colors.IdealForegroundColor}" options:Freeze="True" />
|
||||
|
||||
<!-- BackstageTabControl -->
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.BackstageTabControl.Button.MouseOver.Background" Color="{{Fluent.Ribbon.Brushes.BackstageTabControl.Button.MouseOver.Background}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.BackstageTabControl.ItemsPanelBackground" Color="{{Fluent.Ribbon.Brushes.BackstageTabControl.ItemsPanelBackground}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.BackstageTabControl.Button.MouseOver.Background" Color="{StaticResource BlackColor20}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.BackstageTabControl.ItemsPanelBackground" Color="{StaticResource Fluent.Ribbon.Colors.AccentBaseColor}" options:Freeze="True" />
|
||||
|
||||
<!-- BackstageTabItem -->
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.BackstageTabItem.Header.Foreground" Color="{{Fluent.Ribbon.Brushes.BackstageTabItem.Header.Foreground}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.BackstageTabItem.MouseOver.Background" Color="{{Fluent.Ribbon.Brushes.BackstageTabItem.MouseOver.Background}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.BackstageTabItem.Selected.Background" Color="{{Fluent.Ribbon.Brushes.BackstageTabItem.Selected.Background}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.BackstageTabItem.Header.Foreground" Color="{StaticResource Fluent.Ribbon.Colors.IdealForegroundColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.BackstageTabItem.MouseOver.Background" Color="{StaticResource BlackColor20}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.BackstageTabItem.Selected.Background" Color="{StaticResource WhiteColor20}" options:Freeze="True" />
|
||||
|
||||
<!-- Button -->
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Button.MouseOver.BorderBrush" Color="{StaticResource Fluent.Ribbon.Colors.AccentColor40}" options:Freeze="True" />
|
||||
@@ -160,13 +160,13 @@
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.GalleryItem.Pressed" Color="{StaticResource Fluent.Ribbon.Colors.AccentColor60}" options:Freeze="True" />
|
||||
|
||||
<!-- Images -->
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Images.QuickAccessToolbarDropDown" Color="{{Fluent.Ribbon.Colors.Images.DefaultColor}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Images.QuickAccessToolbarDropDown" Color="{StaticResource BlackColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Images.QuickAccessToolbarDropDown.BelowRibbon" Color="{StaticResource BlackColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Images.QuickAccessToolbarExtender" Color="{{Fluent.Ribbon.Colors.Images.DefaultColor}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Images.QuickAccessToolbarExtender" Color="{StaticResource BlackColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Images.QuickAccessToolbarExtender.BelowRibbon" Color="{StaticResource BlackColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Images.RibbonCollapse" Color="{{Fluent.Ribbon.Colors.Images.DefaultColor}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Images.RibbonExpand" Color="{{Fluent.Ribbon.Colors.Images.DefaultColor}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Images.RibbonPin" Color="{{Fluent.Ribbon.Colors.Images.DefaultColor}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Images.RibbonCollapse" Color="{StaticResource BlackColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Images.RibbonExpand" Color="{StaticResource BlackColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Images.RibbonPin" Color="{StaticResource BlackColor}" options:Freeze="True" />
|
||||
|
||||
<!-- KeyTip -->
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.KeyTip.Background" Color="{StaticResource Gray1}" options:Freeze="True" />
|
||||
@@ -174,8 +174,8 @@
|
||||
|
||||
<!-- MenuItem -->
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.MenuItem.Background" Color="Transparent" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.ApplicationMenuItem.CheckBox.Background" Color="{{Fluent.Ribbon.Brushes.ApplicationMenuItem.CheckBox.Background}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.ApplicationMenuItem.CheckBox.BorderBrush" Color="{{Fluent.Ribbon.Brushes.ApplicationMenuItem.CheckBox.BorderBrush}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.ApplicationMenuItem.CheckBox.Background" Color="#FFFCF1C2" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.ApplicationMenuItem.CheckBox.BorderBrush" Color="#FFF29536" options:Freeze="True" />
|
||||
|
||||
<LinearGradientBrush x:Key="Fluent.Ribbon.MenuItem.SubMenu.Arrow.Fill" EndPoint="0.945,0.872" StartPoint="0.055,0.128" options:Freeze="True">
|
||||
<GradientStop Color="{StaticResource Gray2}" Offset="1" />
|
||||
@@ -192,36 +192,36 @@
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonGroupBox.Collapsed.BorderBrush" Color="{StaticResource Gray6}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonGroupBox.Collapsed.MouseOver.Background" Color="{StaticResource Gray10}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonGroupBox.DropDownOpen.Background" Color="{StaticResource Gray8}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonGroupBox.Header.Foreground" Color="{{Fluent.Ribbon.Brushes.RibbonGroupBox.Header.Foreground}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonGroupBox.Header.Foreground" Color="{StaticResource Gray2}" options:Freeze="True" />
|
||||
|
||||
<!-- RibbonTabControl -->
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Background" Color="{{Fluent.Ribbon.Brushes.RibbonTabControl.Background}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Background" Color="{StaticResource WhiteColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Foreground" Color="{StaticResource BlackColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Content.Background" Color="{{Fluent.Ribbon.Brushes.RibbonTabControl.Content.Background}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Content.Background" Color="{StaticResource WhiteColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Content.BorderBrush" Color="Transparent" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Content.Foreground" Color="{{Fluent.Ribbon.Brushes.RibbonTabControl.Content.Foreground}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.Content.Foreground" Color="{StaticResource BlackColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.TabsGrid.Background" Color="Transparent" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabControl.TabsGrid.Foreground" Color="{StaticResource BlackColor}" options:Freeze="True" />
|
||||
|
||||
<!-- RibbonContextualTabGroup -->
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonContextualTabGroup.TabItemSelectedForeground" Color="{{Fluent.Ribbon.Brushes.RibbonContextualTabGroup.TabItemSelectedForeground}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonContextualTabGroup.TabItemMouseOverForeground" Color="{{Fluent.Ribbon.Brushes.RibbonContextualTabGroup.TabItemMouseOverForeground}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonContextualTabGroup.TabItemSelectedMouseOverForeground" Color="{{Fluent.Ribbon.Brushes.RibbonContextualTabGroup.TabItemSelectedMouseOverForeground}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonContextualTabGroup.TabItemSelectedForeground" Color="{StaticResource BlackColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonContextualTabGroup.TabItemMouseOverForeground" Color="{StaticResource Fluent.Ribbon.Colors.HighlightColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonContextualTabGroup.TabItemSelectedMouseOverForeground" Color="{StaticResource Fluent.Ribbon.Colors.HighlightColor}" options:Freeze="True" />
|
||||
|
||||
<!-- RibbonTabItem -->
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabItem.Foreground" Color="{{Fluent.Ribbon.Brushes.RibbonTabItem.Foreground}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabItem.Foreground" Color="{StaticResource BlackColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabItem.BorderBrush" Color="{StaticResource Gray8}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabItem.Active.Background" Color="{{Fluent.Ribbon.Brushes.RibbonTabItem.Active.Background}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabItem.MouseOver.Background" Color="{{Fluent.Ribbon.Brushes.RibbonTabItem.MouseOver.Background}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabItem.MouseOver.Foreground" Color="{{Fluent.Ribbon.Brushes.RibbonTabItem.MouseOver.Foreground}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabItem.Active.Background" Color="{StaticResource WhiteColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabItem.MouseOver.Background" Color="Transparent" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabItem.MouseOver.Foreground" Color="{StaticResource Fluent.Ribbon.Colors.HighlightColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabItem.Selected.Foreground" Color="{StaticResource Gray1}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabItem.Selected.MouseOver.Foreground" Color="{{Fluent.Ribbon.Brushes.RibbonTabItem.Selected.MouseOver.Foreground}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabItem.Selected.MouseOver.Foreground" Color="{StaticResource Fluent.Ribbon.Colors.HighlightColor}" options:Freeze="True" />
|
||||
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonTabItem.Contextual.Background.OpacityMask" Color="#14000000" options:Freeze="True" />
|
||||
|
||||
<!-- RibbonWindow -->
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonWindow.TitleBackground" Color="{{Fluent.Ribbon.Brushes.RibbonWindow.TitleBackground}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonWindow.TitleForeground" Color="{{Fluent.Ribbon.Brushes.RibbonWindow.TitleForeground}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonWindow.TitleBackground" Color="Transparent" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.RibbonWindow.TitleForeground" Color="{StaticResource BlackColor}" options:Freeze="True" />
|
||||
|
||||
<!-- Separator -->
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.Separator.BorderBrush" Color="{StaticResource Gray8}" options:Freeze="True" />
|
||||
@@ -257,10 +257,10 @@
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.TextBox.Disabled.BorderBrush" Color="{StaticResource Gray8}" options:Freeze="True" />
|
||||
|
||||
<!-- WindowCommands -->
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.Foreground" Color="{{Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.Foreground}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.Foreground" Color="{StaticResource BlackColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.Background" Color="{StaticResource TransparentWhiteColor}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.MouseOver.Background" Color="{{Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.MouseOver.Background}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.Pressed.Background" Color="{{Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.Pressed.Background}}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.MouseOver.Background" Color="{StaticResource Fluent.Ribbon.Colors.AccentColor20}" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CaptionButton.Pressed.Background" Color="{StaticResource Fluent.Ribbon.Colors.AccentColor40}" options:Freeze="True" />
|
||||
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CloseButton.MouseOver.Background" Color="#E81123" options:Freeze="True" />
|
||||
<SolidColorBrush x:Key="Fluent.Ribbon.Brushes.WindowCommands.CloseButton.Pressed.Background" Color="#A92831" options:Freeze="True" />
|
||||
@@ -5,7 +5,7 @@ using System.Windows;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Controls
|
||||
{
|
||||
public class OutlineText : FrameworkElement
|
||||
{
|
||||
@@ -6,7 +6,7 @@ using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Controls
|
||||
{
|
||||
public class RectangleGridEventArgs
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
<UserControl x:Class="AIStudio.Wpf.DiagramHelper.Controls.SliderRotation"
|
||||
<UserControl x:Class="AIStudio.Wpf.DiagramDesigner.Additionals.Controls.SliderRotation"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:AIStudio.Wpf.DiagramHelper.Controls"
|
||||
xmlns:local="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
Name="sliderRotation"
|
||||
@@ -12,7 +12,7 @@ using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// SliderRotation.xaml 的交互逻辑
|
||||
@@ -3,7 +3,7 @@ using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// A ruler control which supports both centimeters and inches. In order to use it vertically, change the <see cref="Marks">Marks</see> property to <c>Up</c> and rotate it ninety degrees.
|
||||
@@ -59,7 +59,7 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
{
|
||||
if (this.AutoSize)
|
||||
{
|
||||
return (double)(Unit == Unit.Cm ? DipHelper.DipToCm(this.ActualWidth) : DipHelper.DipToInch(this.ActualWidth)) / this.Zoom;
|
||||
return (double)(Unit == Unit.Cm ? ScreenHelper.WidthToCm(this.ActualWidth) : ScreenHelper.WidthToInch(this.ActualWidth)) / this.Zoom;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -255,9 +255,9 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
var rect = new Rect(0, 0, RenderSize.Width, RenderSize.Height);
|
||||
drawingContext.DrawRectangle(Background, null, rect);
|
||||
|
||||
double xDest = (Unit == Unit.Cm ? DipHelper.CmToDip(Length) : DipHelper.InchToDip(Length)) * this.Zoom;
|
||||
double xDest = (Unit == Unit.Cm ? ScreenHelper.CmToWidth(Length) : ScreenHelper.InchToWidth(Length)) * this.Zoom;
|
||||
drawingContext.DrawRectangle(null, BorderPen, new Rect(new Point(0.0, 0.0), new Point(xDest, Height)));
|
||||
double chip = Unit == Unit.Cm ? DipHelper.CmToDip(Chip) : DipHelper.InchToDip(Chip);
|
||||
double chip = Unit == Unit.Cm ? ScreenHelper.CmToWidth(Chip) : ScreenHelper.InchToWidth(Chip);
|
||||
drawingContext.DrawLine(RedPen, new Point(chip, 0), new Point(chip, Height));
|
||||
|
||||
//画偏移位置之前的
|
||||
@@ -268,21 +268,21 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
double d;
|
||||
if (Unit == Unit.Cm)
|
||||
{
|
||||
d = DipHelper.CmToDip(dUnit) * this.Zoom;
|
||||
d = ScreenHelper.CmToWidth(dUnit) * this.Zoom;
|
||||
if (dUnit < Length)
|
||||
{
|
||||
for (int i = 1; i <= 9; i++)
|
||||
{
|
||||
if (i != 5)
|
||||
{
|
||||
double dMm = DipHelper.CmToDip(dUnit + 0.1 * i) * this.Zoom;
|
||||
double dMm = ScreenHelper.CmToWidth(dUnit + 0.1 * i) * this.Zoom;
|
||||
if (Marks == MarksLocation.Up)
|
||||
drawingContext.DrawLine(ThinPen, new Point(dMm, 0), new Point(dMm, SegmentHeight / 3.0));
|
||||
else
|
||||
drawingContext.DrawLine(ThinPen, new Point(dMm, Height), new Point(dMm, Height - SegmentHeight / 3.0));
|
||||
}
|
||||
}
|
||||
double dMiddle = DipHelper.CmToDip(dUnit + 0.5) * this.Zoom;
|
||||
double dMiddle = ScreenHelper.CmToWidth(dUnit + 0.5) * this.Zoom;
|
||||
if (Marks == MarksLocation.Up)
|
||||
drawingContext.DrawLine(p, new Point(dMiddle, 0), new Point(dMiddle, SegmentHeight * 2.0 / 3.0));
|
||||
else
|
||||
@@ -291,30 +291,30 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
}
|
||||
else
|
||||
{
|
||||
d = DipHelper.InchToDip(dUnit) * this.Zoom;
|
||||
d = ScreenHelper.InchToWidth(dUnit) * this.Zoom;
|
||||
if (dUnit < Length)
|
||||
{
|
||||
if (Marks == MarksLocation.Up)
|
||||
{
|
||||
double dQuarter = DipHelper.InchToDip(dUnit + 0.25) * this.Zoom;
|
||||
double dQuarter = ScreenHelper.InchToWidth(dUnit + 0.25) * this.Zoom;
|
||||
drawingContext.DrawLine(ThinPen, new Point(dQuarter, 0),
|
||||
new Point(dQuarter, SegmentHeight / 3.0));
|
||||
double dMiddle = DipHelper.InchToDip(dUnit + 0.5) * this.Zoom;
|
||||
double dMiddle = ScreenHelper.InchToWidth(dUnit + 0.5) * this.Zoom;
|
||||
drawingContext.DrawLine(p, new Point(dMiddle, 0),
|
||||
new Point(dMiddle, SegmentHeight * 2D / 3D));
|
||||
double d3Quarter = DipHelper.InchToDip(dUnit + 0.75) * this.Zoom;
|
||||
double d3Quarter = ScreenHelper.InchToWidth(dUnit + 0.75) * this.Zoom;
|
||||
drawingContext.DrawLine(ThinPen, new Point(d3Quarter, 0),
|
||||
new Point(d3Quarter, SegmentHeight / 3.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
double dQuarter = DipHelper.InchToDip(dUnit + 0.25) * this.Zoom;
|
||||
double dQuarter = ScreenHelper.InchToWidth(dUnit + 0.25) * this.Zoom;
|
||||
drawingContext.DrawLine(ThinPen, new Point(dQuarter, Height),
|
||||
new Point(dQuarter, Height - SegmentHeight / 3.0));
|
||||
double dMiddle = DipHelper.InchToDip(dUnit + 0.5) * this.Zoom;
|
||||
double dMiddle = ScreenHelper.InchToWidth(dUnit + 0.5) * this.Zoom;
|
||||
drawingContext.DrawLine(p, new Point(dMiddle, Height),
|
||||
new Point(dMiddle, Height - SegmentHeight * 2D / 3D));
|
||||
double d3Quarter = DipHelper.InchToDip(dUnit + 0.75) * this.Zoom;
|
||||
double d3Quarter = ScreenHelper.InchToWidth(dUnit + 0.75) * this.Zoom;
|
||||
drawingContext.DrawLine(ThinPen, new Point(d3Quarter, Height),
|
||||
new Point(d3Quarter, Height - SegmentHeight / 3.0));
|
||||
}
|
||||
@@ -333,7 +333,7 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
CultureInfo.CurrentCulture,
|
||||
FlowDirection.LeftToRight,
|
||||
new Typeface("Arial"),
|
||||
DipHelper.PtToDip(6),
|
||||
9,
|
||||
Brushes.DimGray);
|
||||
ft.SetFontWeight(FontWeights.Regular);
|
||||
ft.TextAlignment = TextAlignment.Center;
|
||||
@@ -353,21 +353,21 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
double d;
|
||||
if (Unit == Unit.Cm)
|
||||
{
|
||||
d = DipHelper.CmToDip(dUnit) * this.Zoom;
|
||||
d = ScreenHelper.CmToWidth(dUnit) * this.Zoom;
|
||||
if (dUnit < Length)
|
||||
{
|
||||
for (int i = 1; i <= 9; i++)
|
||||
{
|
||||
if (i != 5)
|
||||
{
|
||||
double dMm = DipHelper.CmToDip(dUnit + 0.1 * i) * this.Zoom;
|
||||
double dMm = ScreenHelper.CmToWidth(dUnit + 0.1 * i) * this.Zoom;
|
||||
if (Marks == MarksLocation.Up)
|
||||
drawingContext.DrawLine(ThinPen, new Point(dMm, 0), new Point(dMm, SegmentHeight / 3.0));
|
||||
else
|
||||
drawingContext.DrawLine(ThinPen, new Point(dMm, Height), new Point(dMm, Height - SegmentHeight / 3.0));
|
||||
}
|
||||
}
|
||||
double dMiddle = DipHelper.CmToDip(dUnit + 0.5) * this.Zoom;
|
||||
double dMiddle = ScreenHelper.CmToWidth(dUnit + 0.5) * this.Zoom;
|
||||
if (Marks == MarksLocation.Up)
|
||||
drawingContext.DrawLine(p, new Point(dMiddle, 0), new Point(dMiddle, SegmentHeight * 2.0 / 3.0));
|
||||
else
|
||||
@@ -376,30 +376,30 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
}
|
||||
else
|
||||
{
|
||||
d = DipHelper.InchToDip(dUnit) * this.Zoom;
|
||||
d = ScreenHelper.InchToWidth(dUnit) * this.Zoom;
|
||||
if (dUnit < Length)
|
||||
{
|
||||
if (Marks == MarksLocation.Up)
|
||||
{
|
||||
double dQuarter = DipHelper.InchToDip(dUnit + 0.25) * this.Zoom;
|
||||
double dQuarter = ScreenHelper.InchToWidth(dUnit + 0.25) * this.Zoom;
|
||||
drawingContext.DrawLine(ThinPen, new Point(dQuarter, 0),
|
||||
new Point(dQuarter, SegmentHeight / 3.0));
|
||||
double dMiddle = DipHelper.InchToDip(dUnit + 0.5) * this.Zoom;
|
||||
double dMiddle = ScreenHelper.InchToWidth(dUnit + 0.5) * this.Zoom;
|
||||
drawingContext.DrawLine(p, new Point(dMiddle, 0),
|
||||
new Point(dMiddle, SegmentHeight * 2D / 3D));
|
||||
double d3Quarter = DipHelper.InchToDip(dUnit + 0.75) * this.Zoom;
|
||||
double d3Quarter = ScreenHelper.InchToWidth(dUnit + 0.75) * this.Zoom;
|
||||
drawingContext.DrawLine(ThinPen, new Point(d3Quarter, 0),
|
||||
new Point(d3Quarter, SegmentHeight / 3.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
double dQuarter = DipHelper.InchToDip(dUnit + 0.25) * this.Zoom;
|
||||
double dQuarter = ScreenHelper.InchToWidth(dUnit + 0.25) * this.Zoom;
|
||||
drawingContext.DrawLine(ThinPen, new Point(dQuarter, Height),
|
||||
new Point(dQuarter, Height - SegmentHeight / 3.0));
|
||||
double dMiddle = DipHelper.InchToDip(dUnit + 0.5) * this.Zoom;
|
||||
double dMiddle = ScreenHelper.InchToWidth(dUnit + 0.5) * this.Zoom;
|
||||
drawingContext.DrawLine(p, new Point(dMiddle, Height),
|
||||
new Point(dMiddle, Height - SegmentHeight * 2D / 3D));
|
||||
double d3Quarter = DipHelper.InchToDip(dUnit + 0.75) * this.Zoom;
|
||||
double d3Quarter = ScreenHelper.InchToWidth(dUnit + 0.75) * this.Zoom;
|
||||
drawingContext.DrawLine(ThinPen, new Point(d3Quarter, Height),
|
||||
new Point(d3Quarter, Height - SegmentHeight / 3.0));
|
||||
}
|
||||
@@ -418,7 +418,7 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
CultureInfo.CurrentCulture,
|
||||
FlowDirection.LeftToRight,
|
||||
new Typeface("Arial"),
|
||||
DipHelper.PtToDip(6),
|
||||
9,
|
||||
Brushes.DimGray);
|
||||
ft.SetFontWeight(FontWeights.Regular);
|
||||
ft.TextAlignment = TextAlignment.Center;
|
||||
@@ -442,11 +442,11 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
//Size desiredSize;
|
||||
//if (Unit == Unit.Cm)
|
||||
//{
|
||||
// desiredSize = new Size(DipHelper.CmToDip(Length), Height);
|
||||
// desiredSize = new Size(ScreenHelper.CmToWidth(Length), Height);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// desiredSize = new Size(DipHelper.InchToDip(Length), Height);
|
||||
// desiredSize = new Size(ScreenHelper.InchToWidth(Length), Height);
|
||||
//}
|
||||
//return desiredSize;
|
||||
}
|
||||
@@ -474,145 +474,145 @@ namespace AIStudio.Wpf.DiagramHelper.Controls
|
||||
Up, Down
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A helper class for DIP (Device Independent Pixels) conversion and scaling operations.
|
||||
/// </summary>
|
||||
public static class DipHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts millimeters to DIP (Device Independant Pixels).
|
||||
/// </summary>
|
||||
/// <param name="mm">A millimeter value.</param>
|
||||
/// <returns>A DIP value.</returns>
|
||||
public static double MmToDip(double mm)
|
||||
{
|
||||
return CmToDip(mm / 10.0);
|
||||
}
|
||||
///// <summary>
|
||||
///// A helper class for DIP (Device Independent Pixels) conversion and scaling operations.
|
||||
///// </summary>
|
||||
//public static class DipHelper
|
||||
//{
|
||||
// /// <summary>
|
||||
// /// Converts millimeters to DIP (Device Independant Pixels).
|
||||
// /// </summary>
|
||||
// /// <param name="mm">A millimeter value.</param>
|
||||
// /// <returns>A DIP value.</returns>
|
||||
// public static double MmToDip(double mm)
|
||||
// {
|
||||
// return CmToDip(mm / 10.0);
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Converts centimeters to DIP (Device Independant Pixels).
|
||||
/// </summary>
|
||||
/// <param name="cm">A centimeter value.</param>
|
||||
/// <returns>A DIP value.</returns>
|
||||
public static double CmToDip(double cm)
|
||||
{
|
||||
return (cm * 96.0 / 2.54);
|
||||
}
|
||||
// /// <summary>
|
||||
// /// Converts centimeters to DIP (Device Independant Pixels).
|
||||
// /// </summary>
|
||||
// /// <param name="cm">A centimeter value.</param>
|
||||
// /// <returns>A DIP value.</returns>
|
||||
// public static double CmToDip(double cm)
|
||||
// {
|
||||
// return (cm * 96.0 / 2.54);
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Converts inches to DIP (Device Independant Pixels).
|
||||
/// </summary>
|
||||
/// <param name="inch">An inch value.</param>
|
||||
/// <returns>A DIP value.</returns>
|
||||
public static double InchToDip(double inch)
|
||||
{
|
||||
return (inch * 96.0);
|
||||
}
|
||||
public static double DipToInch(double dip)
|
||||
{
|
||||
return dip / 96D;
|
||||
}
|
||||
// /// <summary>
|
||||
// /// Converts inches to DIP (Device Independant Pixels).
|
||||
// /// </summary>
|
||||
// /// <param name="inch">An inch value.</param>
|
||||
// /// <returns>A DIP value.</returns>
|
||||
// public static double InchToDip(double inch)
|
||||
// {
|
||||
// return (inch * 96.0);
|
||||
// }
|
||||
// public static double DipToInch(double dip)
|
||||
// {
|
||||
// return dip / 96D;
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Converts font points to DIP (Device Independant Pixels).
|
||||
/// </summary>
|
||||
/// <param name="pt">A font point value.</param>
|
||||
/// <returns>A DIP value.</returns>
|
||||
public static double PtToDip(double pt)
|
||||
{
|
||||
return (pt * 96.0 / 72.0);
|
||||
}
|
||||
// /// <summary>
|
||||
// /// Converts font points to DIP (Device Independant Pixels).
|
||||
// /// </summary>
|
||||
// /// <param name="pt">A font point value.</param>
|
||||
// /// <returns>A DIP value.</returns>
|
||||
// public static double PtToDip(double pt)
|
||||
// {
|
||||
// return (pt * 96.0 / 72.0);
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Converts DIP (Device Independant Pixels) to centimeters.
|
||||
/// </summary>
|
||||
/// <param name="dip">A DIP value.</param>
|
||||
/// <returns>A centimeter value.</returns>
|
||||
public static double DipToCm(double dip)
|
||||
{
|
||||
return (dip * 2.54 / 96.0);
|
||||
}
|
||||
// /// <summary>
|
||||
// /// Converts DIP (Device Independant Pixels) to centimeters.
|
||||
// /// </summary>
|
||||
// /// <param name="dip">A DIP value.</param>
|
||||
// /// <returns>A centimeter value.</returns>
|
||||
// public static double DipToCm(double dip)
|
||||
// {
|
||||
// return (dip * 2.54 / 96.0);
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Converts DIP (Device Independant Pixels) to millimeters.
|
||||
/// </summary>
|
||||
/// <param name="dip">A DIP value.</param>
|
||||
/// <returns>A millimeter value.</returns>
|
||||
public static double DipToMm(double dip)
|
||||
{
|
||||
return DipToCm(dip) * 10.0;
|
||||
}
|
||||
// /// <summary>
|
||||
// /// Converts DIP (Device Independant Pixels) to millimeters.
|
||||
// /// </summary>
|
||||
// /// <param name="dip">A DIP value.</param>
|
||||
// /// <returns>A millimeter value.</returns>
|
||||
// public static double DipToMm(double dip)
|
||||
// {
|
||||
// return DipToCm(dip) * 10.0;
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system DPI scale factor (compared to 96 dpi).
|
||||
/// From http://blogs.msdn.com/jaimer/archive/2007/03/07/getting-system-dpi-in-wpf-app.aspx
|
||||
/// Should not be called before the Loaded event (else XamlException mat throw)
|
||||
/// </summary>
|
||||
/// <returns>A Point object containing the X- and Y- scale factor.</returns>
|
||||
private static Point GetSystemDpiFactor()
|
||||
{
|
||||
PresentationSource source = PresentationSource.FromVisual(Application.Current.MainWindow);
|
||||
Matrix m = source.CompositionTarget.TransformToDevice;
|
||||
return new Point(m.M11, m.M22);
|
||||
}
|
||||
// /// <summary>
|
||||
// /// Gets the system DPI scale factor (compared to 96 dpi).
|
||||
// /// From http://blogs.msdn.com/jaimer/archive/2007/03/07/getting-system-dpi-in-wpf-app.aspx
|
||||
// /// Should not be called before the Loaded event (else XamlException mat throw)
|
||||
// /// </summary>
|
||||
// /// <returns>A Point object containing the X- and Y- scale factor.</returns>
|
||||
// private static Point GetSystemDpiFactor()
|
||||
// {
|
||||
// PresentationSource source = PresentationSource.FromVisual(Application.Current.MainWindow);
|
||||
// Matrix m = source.CompositionTarget.TransformToDevice;
|
||||
// return new Point(m.M11, m.M22);
|
||||
// }
|
||||
|
||||
private const double DpiBase = 96.0;
|
||||
// private const double DpiBase = 96.0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the system configured DPI.
|
||||
/// </summary>
|
||||
/// <returns>A Point object containing the X- and Y- DPI.</returns>
|
||||
public static Point GetSystemDpi()
|
||||
{
|
||||
Point sysDpiFactor = GetSystemDpiFactor();
|
||||
return new Point(
|
||||
sysDpiFactor.X * DpiBase,
|
||||
sysDpiFactor.Y * DpiBase);
|
||||
}
|
||||
// /// <summary>
|
||||
// /// Gets the system configured DPI.
|
||||
// /// </summary>
|
||||
// /// <returns>A Point object containing the X- and Y- DPI.</returns>
|
||||
// public static Point GetSystemDpi()
|
||||
// {
|
||||
// Point sysDpiFactor = GetSystemDpiFactor();
|
||||
// return new Point(
|
||||
// sysDpiFactor.X * DpiBase,
|
||||
// sysDpiFactor.Y * DpiBase);
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the physical pixel density (DPI) of the screen.
|
||||
/// </summary>
|
||||
/// <param name="diagonalScreenSize">Size - in inch - of the diagonal of the screen.</param>
|
||||
/// <returns>A Point object containing the X- and Y- DPI.</returns>
|
||||
public static Point GetPhysicalDpi(double diagonalScreenSize)
|
||||
{
|
||||
Point sysDpiFactor = GetSystemDpiFactor();
|
||||
double pixelScreenWidth = SystemParameters.PrimaryScreenWidth * sysDpiFactor.X;
|
||||
double pixelScreenHeight = SystemParameters.PrimaryScreenHeight * sysDpiFactor.Y;
|
||||
double formatRate = pixelScreenWidth / pixelScreenHeight;
|
||||
// /// <summary>
|
||||
// /// Gets the physical pixel density (DPI) of the screen.
|
||||
// /// </summary>
|
||||
// /// <param name="diagonalScreenSize">Size - in inch - of the diagonal of the screen.</param>
|
||||
// /// <returns>A Point object containing the X- and Y- DPI.</returns>
|
||||
// public static Point GetPhysicalDpi(double diagonalScreenSize)
|
||||
// {
|
||||
// Point sysDpiFactor = GetSystemDpiFactor();
|
||||
// double pixelScreenWidth = SystemParameters.PrimaryScreenWidth * sysDpiFactor.X;
|
||||
// double pixelScreenHeight = SystemParameters.PrimaryScreenHeight * sysDpiFactor.Y;
|
||||
// double formatRate = pixelScreenWidth / pixelScreenHeight;
|
||||
|
||||
double inchHeight = diagonalScreenSize / Math.Sqrt(formatRate * formatRate + 1.0);
|
||||
double inchWidth = formatRate * inchHeight;
|
||||
// double inchHeight = diagonalScreenSize / Math.Sqrt(formatRate * formatRate + 1.0);
|
||||
// double inchWidth = formatRate * inchHeight;
|
||||
|
||||
double xDpi = Math.Round(pixelScreenWidth / inchWidth);
|
||||
double yDpi = Math.Round(pixelScreenHeight / inchHeight);
|
||||
// double xDpi = Math.Round(pixelScreenWidth / inchWidth);
|
||||
// double yDpi = Math.Round(pixelScreenHeight / inchHeight);
|
||||
|
||||
return new Point(xDpi, yDpi);
|
||||
}
|
||||
// return new Point(xDpi, yDpi);
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Converts a DPI into a scale factor (compared to system DPI).
|
||||
/// </summary>
|
||||
/// <param name="dpi">A Point object containing the X- and Y- DPI to convert.</param>
|
||||
/// <returns>A Point object containing the X- and Y- scale factor.</returns>
|
||||
public static Point DpiToScaleFactor(Point dpi)
|
||||
{
|
||||
Point sysDpi = GetSystemDpi();
|
||||
return new Point(
|
||||
dpi.X / sysDpi.X,
|
||||
dpi.Y / sysDpi.Y);
|
||||
}
|
||||
// /// <summary>
|
||||
// /// Converts a DPI into a scale factor (compared to system DPI).
|
||||
// /// </summary>
|
||||
// /// <param name="dpi">A Point object containing the X- and Y- DPI to convert.</param>
|
||||
// /// <returns>A Point object containing the X- and Y- scale factor.</returns>
|
||||
// public static Point DpiToScaleFactor(Point dpi)
|
||||
// {
|
||||
// Point sysDpi = GetSystemDpi();
|
||||
// return new Point(
|
||||
// dpi.X / sysDpi.X,
|
||||
// dpi.Y / sysDpi.Y);
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the scale factor to apply to a WPF application
|
||||
/// so that 96 DIP always equals 1 inch on the screen (whatever the system DPI).
|
||||
/// </summary>
|
||||
/// <param name="diagonalScreenSize">Size - in inch - of the diagonal of the screen</param>
|
||||
/// <returns>A Point object containing the X- and Y- scale factor.</returns>
|
||||
public static Point GetScreenIndependentScaleFactor(double diagonalScreenSize)
|
||||
{
|
||||
return DpiToScaleFactor(GetPhysicalDpi(diagonalScreenSize));
|
||||
}
|
||||
}
|
||||
// /// <summary>
|
||||
// /// Gets the scale factor to apply to a WPF application
|
||||
// /// so that 96 DIP always equals 1 inch on the screen (whatever the system DPI).
|
||||
// /// </summary>
|
||||
// /// <param name="diagonalScreenSize">Size - in inch - of the diagonal of the screen</param>
|
||||
// /// <returns>A Point object containing the X- and Y- scale factor.</returns>
|
||||
// public static Point GetScreenIndependentScaleFactor(double diagonalScreenSize)
|
||||
// {
|
||||
// return DpiToScaleFactor(GetPhysicalDpi(diagonalScreenSize));
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Converters
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Converters
|
||||
{
|
||||
public class Boolean2VisibilityReConverter : IValueConverter
|
||||
{
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals.Controls;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Converters
|
||||
{
|
||||
public class CountShiftConverter : IMultiValueConverter
|
||||
{
|
||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (values != null && values.Length > 2)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
var diagram = values[0] as FrameworkElement;
|
||||
var zoomValue = (double)values[1];
|
||||
var pageunit = (PageUnit)values[2];
|
||||
var unit = Unit.Cm;
|
||||
if (pageunit > PageUnit.km)
|
||||
{
|
||||
unit = Unit.Inch;
|
||||
}
|
||||
Vector vector = System.Windows.Media.VisualTreeHelper.GetOffset(diagram);
|
||||
|
||||
if (parameter?.ToString() == "Y")
|
||||
{
|
||||
var value = 0 - (unit == Unit.Cm ? ScreenHelper.WidthToCm(vector.Y - 20) : ScreenHelper.WidthToInch(vector.Y - 20)) / zoomValue;
|
||||
return value;
|
||||
}
|
||||
else
|
||||
{
|
||||
var value = 0 - (unit == Unit.Cm ? ScreenHelper.WidthToCm(vector.X - 20) : ScreenHelper.WidthToInch(vector.X - 20)) / zoomValue;
|
||||
return value;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Converters
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Converters
|
||||
{
|
||||
public class DoubleToThickness : IValueConverter
|
||||
{
|
||||
@@ -21,7 +21,7 @@ using System.Text;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Converters
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Converters
|
||||
{
|
||||
class HtmlColorConverter : IValueConverter
|
||||
{
|
||||
@@ -9,7 +9,7 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Converters
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Converters
|
||||
{
|
||||
public class IndentConverter : IValueConverter
|
||||
{
|
||||
@@ -4,7 +4,7 @@ using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Converters
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Converters
|
||||
{
|
||||
//选中项索引转换成可见项
|
||||
public class IntVisibilityConverter : MarkupExtension, IValueConverter
|
||||
@@ -3,7 +3,7 @@ using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Converters
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Converters
|
||||
{
|
||||
public class NullableToBooleanConverter : IValueConverter
|
||||
{
|
||||
@@ -3,7 +3,7 @@ using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Converters
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Converters
|
||||
{
|
||||
public class NullableToVisibilityConverter : IValueConverter
|
||||
{
|
||||
@@ -5,7 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Converters
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Converters
|
||||
{
|
||||
public class NumberConverter : IValueConverter
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
using AIStudio.Wpf.DiagramHelper.Controls;
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals.Controls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Converters
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Converters
|
||||
{
|
||||
public class RulerUnitConverter : IValueConverter
|
||||
{
|
||||
@@ -7,7 +7,7 @@ using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Converters
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Converters
|
||||
{
|
||||
public class StringPathConverter : IValueConverter
|
||||
{
|
||||
@@ -3,7 +3,7 @@ using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Converters
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Converters
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts a Thickness to a new Thickness. It's possible to ignore a side With the IgnoreThicknessSide property.
|
||||
@@ -3,7 +3,7 @@ using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Converters
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Converters
|
||||
{
|
||||
public class ThicknessToDoubleConverter : IValueConverter
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Extensions.Models
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.Models
|
||||
{
|
||||
public class PathDesignerItem : DesignerItemBase
|
||||
{
|
||||
@@ -1,8 +1,8 @@
|
||||
using System.Xml.Serialization;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using AIStudio.Wpf.DiagramHelper.Extensions.ViewModels;
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.ViewModels;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Extensions.Models
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.Models
|
||||
{
|
||||
public class PersistDesignerItem : DesignerItemBase
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using AIStudio.Wpf.DiagramHelper.Extensions.ViewModels;
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.ViewModels;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Extensions.Models
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.Models
|
||||
{
|
||||
public class SettingsDesignerItem : DesignerItemBase
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
using AIStudio.Wpf.DiagramHelper.Commands;
|
||||
using AIStudio.Wpf.DiagramHelper.Models;
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals.Commands;
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals.Models;
|
||||
using System.Windows.Input;
|
||||
using ZXing;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Extensions.ViewModels
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.ViewModels
|
||||
{
|
||||
public class BarcodeDesignerItemData : TitleBindableBase
|
||||
{
|
||||
@@ -1,36 +1,61 @@
|
||||
using AIStudio.Wpf.DiagramHelper.Services;
|
||||
using System;
|
||||
using System;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using AIStudio.Wpf.DiagramDesigner.Models;
|
||||
using AIStudio.Wpf.DiagramDesigner.Services;
|
||||
using ZXing;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Extensions.ViewModels
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.ViewModels
|
||||
{
|
||||
public class BarcodeDesignerItemViewModel : DesignerItemViewModelBase
|
||||
{
|
||||
private IUIVisualizerService visualiserService;
|
||||
|
||||
public BarcodeDesignerItemViewModel() : base()
|
||||
public BarcodeDesignerItemViewModel() : this(null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public BarcodeDesignerItemViewModel(IDiagramViewModel parent, DesignerItemBase designer) : base(parent, designer)
|
||||
public BarcodeDesignerItemViewModel(IDiagramViewModel root) : base(root)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void Init()
|
||||
public BarcodeDesignerItemViewModel(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer)
|
||||
{
|
||||
base.Init();
|
||||
|
||||
}
|
||||
|
||||
public BarcodeDesignerItemViewModel(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType)
|
||||
{
|
||||
}
|
||||
|
||||
public override SelectableItemBase GetSerializableObject()
|
||||
{
|
||||
return new DesignerItemBase(this, Format.ToString());
|
||||
}
|
||||
|
||||
protected override void Init(IDiagramViewModel root, bool initNew)
|
||||
{
|
||||
base.Init(root, initNew);
|
||||
|
||||
CustomText = true;
|
||||
|
||||
visualiserService = ApplicationServicesProvider.Instance.Provider.VisualizerService;
|
||||
|
||||
}
|
||||
|
||||
protected override void LoadDesignerItemViewModel(IDiagramViewModel parent, SelectableDesignerItemBase designerbase)
|
||||
protected override void InitNew()
|
||||
{
|
||||
base.LoadDesignerItemViewModel(parent, designerbase);
|
||||
base.InitNew();
|
||||
}
|
||||
|
||||
Format = (BarcodeFormat)Enum.Parse(typeof(BarcodeFormat), (designerbase as DesignerItemBase).Reserve.ToString());
|
||||
protected override void LoadDesignerItemViewModel(SelectableItemBase designerbase)
|
||||
{
|
||||
base.LoadDesignerItemViewModel(designerbase);
|
||||
|
||||
if (designerbase is DesignerItemBase designer)
|
||||
{
|
||||
Format = (BarcodeFormat)Enum.Parse(typeof(BarcodeFormat), designer.Reserve.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public void AutoSize()
|
||||
@@ -53,19 +78,6 @@ namespace AIStudio.Wpf.DiagramHelper.Extensions.ViewModels
|
||||
|
||||
public BarcodeFormat Format { get; set; } = BarcodeFormat.QR_CODE;
|
||||
|
||||
private bool _showText;
|
||||
public override bool ShowText
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _showText, value);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool EditData()
|
||||
{
|
||||
if (IsReadOnly == true) return false;
|
||||
@@ -1,17 +1,16 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:viewmodel="clr-namespace:AIStudio.Wpf.DiagramHelper.Extensions.ViewModels"
|
||||
xmlns:viewmodel="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.ViewModels"
|
||||
xmlns:gif="http://wpfanimatedgif.codeplex.com"
|
||||
xmlns:converter="clr-namespace:AIStudio.Wpf.DiagramHelper.Converters"
|
||||
xmlns:controls="clr-namespace:AIStudio.Wpf.DiagramHelper.Controls"
|
||||
xmlns:converter="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Converters"
|
||||
xmlns:controls="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Controls"
|
||||
xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram"
|
||||
xmlns:Fluent="urn:fluent-ribbon"
|
||||
xmlns:s="clr-namespace:AIStudio.Wpf.DiagramDesigner;assembly=AIStudio.Wpf.DiagramDesigner"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors">
|
||||
|
||||
<converter:BoolVisibilityConverter x:Key="BoolVisibilityConverter"/>
|
||||
<dd:BoolVisibilityConverter x:Key="BoolVisibilityConverter"/>
|
||||
<converter:DoubleToThickness x:Key="DoubleToThickness"/>
|
||||
<s:ColorBrushConverter x:Key="ColorBrushConverter"/>
|
||||
<dd:ColorBrushConverter x:Key="ColorBrushConverter"/>
|
||||
|
||||
|
||||
<DataTemplate DataType="{x:Type viewmodel:BarcodeDesignerItemViewModel}">
|
||||
@@ -1,7 +1,7 @@
|
||||
using AIStudio.Wpf.DiagramHelper.Models;
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals.Models;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Extensions.ViewModels
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.ViewModels
|
||||
{
|
||||
public class OutLineTextDesignerItemData : TitleBindableBase
|
||||
{
|
||||
@@ -13,7 +13,7 @@ namespace AIStudio.Wpf.DiagramHelper.Extensions.ViewModels
|
||||
{
|
||||
this.Title = "矢量文本";
|
||||
this.Text = item.Text;
|
||||
this.FontViewModel = CopyHelper.Mapper<FontViewModel, IFontViewModel>(item.FontViewModel);
|
||||
this.FontViewModel = CopyHelper.Mapper(item.FontViewModel);
|
||||
}
|
||||
|
||||
private IFontViewModel _fontViewModel;
|
||||
@@ -1,31 +1,50 @@
|
||||
using AIStudio.Wpf.DiagramHelper.Services;
|
||||
using System.Globalization;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using AIStudio.Wpf.DiagramDesigner.Models;
|
||||
using AIStudio.Wpf.DiagramDesigner.Services;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Extensions.ViewModels
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.ViewModels
|
||||
{
|
||||
public class OutLineTextDesignerItemViewModel : TextDesignerItemViewModel
|
||||
{
|
||||
private IUIVisualizerService visualiserService;
|
||||
|
||||
public OutLineTextDesignerItemViewModel(IDiagramViewModel parent, DesignerItemBase designer) : base(parent, designer)
|
||||
public OutLineTextDesignerItemViewModel() : this(null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public OutLineTextDesignerItemViewModel() : base()
|
||||
public OutLineTextDesignerItemViewModel(IDiagramViewModel root) : base(root)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void Init()
|
||||
public OutLineTextDesignerItemViewModel(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer)
|
||||
{
|
||||
base.Init();
|
||||
|
||||
visualiserService = ApplicationServicesProvider.Instance.Provider.VisualizerService;
|
||||
}
|
||||
|
||||
public OutLineTextDesignerItemViewModel(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override SelectableItemBase GetSerializableObject()
|
||||
{
|
||||
return new TextDesignerItem(this);
|
||||
}
|
||||
|
||||
protected override void Init(IDiagramViewModel root, bool initNew)
|
||||
{
|
||||
base.Init(root, initNew);
|
||||
|
||||
visualiserService = ApplicationServicesProvider.Instance.Provider.VisualizerService;
|
||||
}
|
||||
|
||||
protected override void InitNew()
|
||||
{
|
||||
base.InitNew();
|
||||
FontViewModel.FontFamily = "Arial";
|
||||
FontViewModel.FontSize = 36;
|
||||
}
|
||||
@@ -70,7 +89,7 @@ namespace AIStudio.Wpf.DiagramHelper.Extensions.ViewModels
|
||||
if (visualiserService.ShowDialog(data) == true)
|
||||
{
|
||||
Text = data.Text;
|
||||
FontViewModel = CopyHelper.Mapper<FontViewModel, IFontViewModel>(data.FontViewModel);
|
||||
FontViewModel = CopyHelper.Mapper(data.FontViewModel);
|
||||
AutoSize();
|
||||
return true;
|
||||
}
|
||||
@@ -1,17 +1,15 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:viewmodel="clr-namespace:AIStudio.Wpf.DiagramHelper.Extensions.ViewModels"
|
||||
xmlns:viewmodel="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.ViewModels"
|
||||
xmlns:gif="http://wpfanimatedgif.codeplex.com"
|
||||
xmlns:converter="clr-namespace:AIStudio.Wpf.DiagramHelper.Converters"
|
||||
xmlns:controls="clr-namespace:AIStudio.Wpf.DiagramHelper.Controls"
|
||||
xmlns:controls="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Controls"
|
||||
xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram"
|
||||
xmlns:Fluent="urn:fluent-ribbon"
|
||||
xmlns:s="clr-namespace:AIStudio.Wpf.DiagramDesigner;assembly=AIStudio.Wpf.DiagramDesigner"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors">
|
||||
|
||||
<converter:BoolVisibilityConverter x:Key="BoolVisibilityConverter"/>
|
||||
<converter:DoubleToThickness x:Key="DoubleToThickness"/>
|
||||
<s:ColorBrushConverter x:Key="ColorBrushConverter"/>
|
||||
<dd:BoolVisibilityConverter x:Key="BoolVisibilityConverter"/>
|
||||
<dd:DoubleToThickness x:Key="DoubleToThickness"/>
|
||||
<dd:ColorBrushConverter x:Key="ColorBrushConverter"/>
|
||||
|
||||
<DataTemplate DataType="{x:Type viewmodel:OutLineTextDesignerItemViewModel}">
|
||||
<Viewbox Stretch="Fill" IsHitTestVisible="False">
|
||||
@@ -44,9 +42,9 @@
|
||||
Text="{Binding Text}"
|
||||
FontSize="{Binding ElementName=comboBoxFontSize,Path=SelectedItem}"
|
||||
FontFamily="{Binding ElementName=comboBoxFontName,Path=SelectedItem}"
|
||||
FontWeight="{Binding ElementName=buttonBold,Path=IsChecked,Converter={converter:ConverterBoolToValueMap Parameter='Regular'}, ConverterParameter='Bold'}"
|
||||
FontStyle="{Binding ElementName=buttonItalic,Path=IsChecked,Converter={converter:ConverterBoolToValueMap Parameter='Normal'}, ConverterParameter='Italic'}"
|
||||
TextDecorations="{Binding ElementName=buttonUnderline,Path=IsChecked,Converter={converter:ConverterBoolToValueMap Parameter='None'}, ConverterParameter='Underline'}"
|
||||
FontWeight="{Binding ElementName=buttonBold,Path=IsChecked,Converter={dd:ConverterBoolToValueMap Parameter='Regular'}, ConverterParameter='Bold'}"
|
||||
FontStyle="{Binding ElementName=buttonItalic,Path=IsChecked,Converter={dd:ConverterBoolToValueMap Parameter='Normal'}, ConverterParameter='Italic'}"
|
||||
TextDecorations="{Binding ElementName=buttonUnderline,Path=IsChecked,Converter={dd:ConverterBoolToValueMap Parameter='None'}, ConverterParameter='Underline'}"
|
||||
Height="100"
|
||||
Margin="5"
|
||||
TextWrapping="Wrap"/>
|
||||
@@ -91,19 +89,19 @@
|
||||
</Fluent:ComboBox>
|
||||
<Fluent:ToggleButton KeyTip="B"
|
||||
x:Name="buttonBold"
|
||||
Icon="pack://application:,,,/AIStudio.Wpf.DiagramHelper;component/Images/Bold.png"
|
||||
Icon="pack://application:,,,/AIStudio.Wpf.DiagramDesigner.Additionals;component/Images/Bold.png"
|
||||
HorizontalAlignment="Left"
|
||||
SizeDefinition="Small"
|
||||
IsChecked="{Binding FontViewModel.FontWeight,Converter={converter:ConverterValueMapToBool Parameter='Regular'}, ConverterParameter='Bold'}"/>
|
||||
IsChecked="{Binding FontViewModel.FontWeight,Converter={dd:ConverterValueMapToBool Parameter='Regular'}, ConverterParameter='Bold'}"/>
|
||||
<Fluent:ToggleButton x:Name="buttonItalic"
|
||||
KeyTip="I"
|
||||
Icon="pack://application:,,,/AIStudio.Wpf.DiagramHelper;component/Images/Italic.png"
|
||||
Icon="pack://application:,,,/AIStudio.Wpf.DiagramDesigner.Additionals;component/Images/Italic.png"
|
||||
HorizontalAlignment="Left"
|
||||
SizeDefinition="Small"
|
||||
IsChecked="{Binding FontViewModel.FontStyle,Converter={converter:ConverterValueMapToBool Parameter='Normal'}, ConverterParameter='Italic'}"/>
|
||||
IsChecked="{Binding FontViewModel.FontStyle,Converter={dd:ConverterValueMapToBool Parameter='Normal'}, ConverterParameter='Italic'}"/>
|
||||
<Fluent:ToggleButton x:Name="buttonUnderline"
|
||||
KeyTip="U"
|
||||
Icon="pack://application:,,,/AIStudio.Wpf.DiagramHelper;component/Images/Underline.png"
|
||||
Icon="pack://application:,,,/AIStudio.Wpf.DiagramDesigner.Additionals;component/Images/Underline.png"
|
||||
HorizontalAlignment="Left"
|
||||
SizeDefinition="Small"
|
||||
IsChecked="{Binding FontViewModel.Underline}"/>
|
||||
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using AIStudio.Wpf.DiagramDesigner.Models;
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.Models;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.ViewModels
|
||||
{
|
||||
public class PathItemViewModel : DesignerItemViewModelBase
|
||||
{
|
||||
public PathItemViewModel() : this(null)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public PathItemViewModel(IDiagramViewModel root) : base(root)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public PathItemViewModel(IDiagramViewModel root, SelectableItemBase designer) : base(root, designer)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public PathItemViewModel(IDiagramViewModel root, SerializableItem serializableItem, string serializableType) : base(root, serializableItem, serializableType)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override SelectableItemBase GetSerializableObject()
|
||||
{
|
||||
return new PathDesignerItem(this);
|
||||
}
|
||||
|
||||
protected override void Init(IDiagramViewModel root, bool initNew)
|
||||
{
|
||||
base.Init(root, initNew);
|
||||
|
||||
this.ShowConnectors = false;
|
||||
}
|
||||
|
||||
protected override void InitNew()
|
||||
{
|
||||
base.InitNew();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:AIStudio.Wpf.DiagramDesigner;assembly=AIStudio.Wpf.DiagramDesigner"
|
||||
xmlns:viewmodel="clr-namespace:AIStudio.Wpf.DiagramHelper.Extensions.ViewModels"
|
||||
xmlns:convent="clr-namespace:AIStudio.Wpf.DiagramHelper.Converters">
|
||||
xmlns:viewmodel="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.ViewModels"
|
||||
xmlns:convent="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Converters">
|
||||
<convent:StringPathConverter x:Key="stringPathConverter"/>
|
||||
<s:ColorBrushConverter x:Key="ColorBrushConverter" />
|
||||
<Brush x:Key="ItemStroke">#FFD69436</Brush>
|
||||
@@ -1,6 +1,6 @@
|
||||
using AIStudio.Wpf.DiagramHelper.Models;
|
||||
using AIStudio.Wpf.DiagramDesigner.Additionals.Models;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramHelper.Extensions.ViewModels
|
||||
namespace AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.ViewModels
|
||||
{
|
||||
/// <summary>
|
||||
/// This is passed to the PopupWindow.xaml window, where a DataTemplate is used to provide the
|
||||