diff --git a/AIStudio.Wpf.Diagram.sln b/AIStudio.Wpf.Diagram.sln index ec250f8..3819309 100644 --- a/AIStudio.Wpf.Diagram.sln +++ b/AIStudio.Wpf.Diagram.sln @@ -27,6 +27,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution 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("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AIStudio.Wpf.Mind", "AIStudio.Wpf.Mind\AIStudio.Wpf.Mind.csproj", "{85C437B9-16D2-4076-ABCD-52029AC232FC}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -61,6 +63,10 @@ Global {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 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -69,6 +75,7 @@ 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} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D30FC641-F06C-4E35-AEA5-48A9B6E59CE0} diff --git a/AIStudio.Wpf.DiagramApp/ViewModels/FlowchartViewModel.cs b/AIStudio.Wpf.DiagramApp/ViewModels/FlowchartViewModel.cs index f817837..ec70c36 100644 --- a/AIStudio.Wpf.DiagramApp/ViewModels/FlowchartViewModel.cs +++ b/AIStudio.Wpf.DiagramApp/ViewModels/FlowchartViewModel.cs @@ -52,16 +52,16 @@ namespace AIStudio.Wpf.Flowchart DesignerItemViewModelBase decide = new DecideFlowNode() { Left = 100, Top = 200, ItemWidth = 80, ItemHeight = 40, Color = Colors.Yellow.ToString(), Text = "5" }; DiagramViewModel.DirectAddItemCommand.Execute(decide); - DesignerItemViewModelBase middle2 = new MiddleFlowNode() { Left = 200, Top = 300, ItemWidth = 80, ItemHeight = 40, Color = Colors.Yellow.ToString(), Text = "分管领导", UserIds = new List { "操作员1", "操作员2" }, ActType = "and" }; + DesignerItemViewModelBase middle2 = new MiddleFlowNode() { Left = 200, Top = 300, ItemWidth = 80, ItemHeight = 40, Color = Colors.Yellow.ToString(), Text = "分管领导", UserIds = new List { "操作员1", "操作员2" }, ActType = "and", DoubleApprove = true }; DiagramViewModel.DirectAddItemCommand.Execute(middle2); DesignerItemViewModelBase cobegin = new COBeginFlowNode() { Left = 100, Top = 400, ItemWidth = 80, ItemHeight = 40, Color = Colors.Yellow.ToString() }; DiagramViewModel.DirectAddItemCommand.Execute(cobegin); - DesignerItemViewModelBase middle3 = new MiddleFlowNode() { Left = 100, Top = 500, ItemWidth = 80, ItemHeight = 40, Color = Colors.Yellow.ToString(), Text = "财务审批", UserIds = new List { "Admin" }, ActType = "or" }; + DesignerItemViewModelBase middle3 = new MiddleFlowNode() { Left = 100, Top = 500, ItemWidth = 80, ItemHeight = 40, Color = Colors.Yellow.ToString(), Text = "财务审批", UserIds = new List { "Admin" }, ActType = "or", DoubleApprove = true }; DiagramViewModel.DirectAddItemCommand.Execute(middle3); - DesignerItemViewModelBase middle4 = new MiddleFlowNode() { Left = 200, Top = 500, ItemWidth = 80, ItemHeight = 40, Color = Colors.Yellow.ToString(), Text = "人力审批", RoleIds = new List { "操作员", "管理员" }, ActType = "or" }; + DesignerItemViewModelBase middle4 = new MiddleFlowNode() { Left = 200, Top = 500, ItemWidth = 80, ItemHeight = 40, Color = Colors.Yellow.ToString(), Text = "人力审批", RoleIds = new List { "操作员", "管理员" }, ActType = "or", DoubleApprove = true }; DiagramViewModel.DirectAddItemCommand.Execute(middle4); DesignerItemViewModelBase coend = new COEndFlowNode() { Left = 100, Top = 600, ItemWidth = 80, ItemHeight = 40, Color = Colors.Yellow.ToString() }; diff --git a/AIStudio.Wpf.DiagramDesigner/Controls/PropertiesView.xaml b/AIStudio.Wpf.DiagramDesigner/Controls/PropertiesView.xaml index f306213..1ad2b98 100644 --- a/AIStudio.Wpf.DiagramDesigner/Controls/PropertiesView.xaml +++ b/AIStudio.Wpf.DiagramDesigner/Controls/PropertiesView.xaml @@ -25,19 +25,13 @@ diff --git a/AIStudio.Wpf.DiagramDesigner/Controls/PropertiesView.xaml.cs b/AIStudio.Wpf.DiagramDesigner/Controls/PropertiesView.xaml.cs index 84ca700..28f2908 100644 --- a/AIStudio.Wpf.DiagramDesigner/Controls/PropertiesView.xaml.cs +++ b/AIStudio.Wpf.DiagramDesigner/Controls/PropertiesView.xaml.cs @@ -45,14 +45,7 @@ namespace AIStudio.Wpf.DiagramDesigner.Controls protected virtual void OnSelectedObjectChanged(object oldValue, object newValue) { - // We do not want to process the change now if the grid is initializing (ie. BeginInit/EndInit). - var obj = oldValue as INotifyPropertyChanged; - if (obj != null) - obj.PropertyChanged -= PropertyChanged; DisplayProperties(); - obj = newValue as INotifyPropertyChanged; - if (obj != null) - obj.PropertyChanged += PropertyChanged; } #endregion //SelectedObject @@ -87,11 +80,6 @@ namespace AIStudio.Wpf.DiagramDesigner.Controls DisplayProperties(); } - void PropertyChanged(object sender, PropertyChangedEventArgs e) - { - DisplayProperties(); - } - private void DisplayProperties() { _panel.Children.Clear(); diff --git a/AIStudio.Wpf.Flowchart/A.ico b/AIStudio.Wpf.Flowchart/A.ico deleted file mode 100644 index cc92975..0000000 Binary files a/AIStudio.Wpf.Flowchart/A.ico and /dev/null differ diff --git a/AIStudio.Wpf.Flowchart/Controls/FlowchartEditor.xaml.cs b/AIStudio.Wpf.Flowchart/Controls/FlowchartEditor.xaml.cs index 304ca53..1ec51a7 100644 --- a/AIStudio.Wpf.Flowchart/Controls/FlowchartEditor.xaml.cs +++ b/AIStudio.Wpf.Flowchart/Controls/FlowchartEditor.xaml.cs @@ -248,30 +248,12 @@ namespace AIStudio.Wpf.Flowchart.Controls } #endregion - //protected override void OnPreviewKeyDown(KeyEventArgs e) - //{ - // base.OnPreviewKeyDown(e); - - // bool executed = true; - // var para = e.KeyboardDevice.Modifiers == ModifierKeys.None ? e.Key.ToString() : e.KeyboardDevice.Modifiers.ToString() + "+" + e.Key.ToString(); - - // switch (para) - // { - // case "Control+A": _diagramViewModel.SelectAllCommand.Execute(null); break; - // case "Control+C": _diagramViewModel.CopyCommand.Execute(null); break; - // case "Control+V": _diagramViewModel.PasteCommand.Execute(null); break; - // case "Control+X": _diagramViewModel.CutCommand.Execute(null); break; - // case "Control+Z": _diagramViewModel.UndoCommand.Execute(null); break; - // case "Control+Y": _diagramViewModel.RedoCommand.Execute(null); break; - // case "Delete": _diagramViewModel.DeleteCommand.Execute(null); break; - // case "Left": _diagramViewModel.LeftMoveCommand.Execute(null); break; - // case "Right": _diagramViewModel.RightMoveCommand.Execute(null); break; - // case "Up": _diagramViewModel.UpMoveCommand.Execute(null); break; - // case "Down": _diagramViewModel.DownMoveCommand.Execute(null); break; - // default: executed = false; break; - // } - // e.Handled = executed; - //} + protected override void OnPreviewKeyDown(KeyEventArgs e) + { + base.OnPreviewKeyDown(e); + + e.Handled = _diagramViewModel.ExecuteShortcut(e); + } } } diff --git a/AIStudio.Wpf.Flowchart/ViewModels/MiddleFlowNode.cs b/AIStudio.Wpf.Flowchart/ViewModels/MiddleFlowNode.cs index 590195b..fa546bb 100644 --- a/AIStudio.Wpf.Flowchart/ViewModels/MiddleFlowNode.cs +++ b/AIStudio.Wpf.Flowchart/ViewModels/MiddleFlowNode.cs @@ -74,21 +74,29 @@ namespace AIStudio.Wpf.Flowchart.ViewModels } } + public bool DoubleApprove + { + get;set; + } + protected override void ExecuteEditCommand(object param) { if (IsReadOnly == true) return; - if (Status == 1) + if (DoubleApprove) { - MiddleFlowNodeData data = new MiddleFlowNodeData(); - if (visualiserService.ShowDialog(data) == true) + if (Status == 1) { - FlowchartService.Approve(this, data.Status, data.Remark); + MiddleFlowNodeData data = new MiddleFlowNodeData(); + if (visualiserService.ShowDialog(data) == true) + { + FlowchartService.Approve(this, data.Status, data.Remark); + } + } + else + { + MessageBox.Show("该节点不能进行审批!!!"); } - } - else - { - MessageBox.Show("该节点不能进行审批!!!"); } } diff --git a/AIStudio.Wpf.Mind/A.png b/AIStudio.Wpf.Mind/A.png new file mode 100644 index 0000000..b6949fa Binary files /dev/null and b/AIStudio.Wpf.Mind/A.png differ diff --git a/AIStudio.Wpf.Mind/AIStudio.Wpf.Mind.csproj b/AIStudio.Wpf.Mind/AIStudio.Wpf.Mind.csproj new file mode 100644 index 0000000..536b337 --- /dev/null +++ b/AIStudio.Wpf.Mind/AIStudio.Wpf.Mind.csproj @@ -0,0 +1,22 @@ + + + + true + AIStudio.Wpf.Controls + akwkevin + https://gitee.com/akwkevin + A.png + + + 1.0.6 + 一个Wpf的流程图控件 + + + + + True + + + + + diff --git a/AIStudio.Wpf.Mind/Properties/AssemblyInfo.cs b/AIStudio.Wpf.Mind/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8b5504e --- /dev/null +++ b/AIStudio.Wpf.Mind/Properties/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)]