diff --git a/AIStudio.Wpf.ADiagram/Demos/Flowchart/FlowchartService.cs b/AIStudio.Wpf.ADiagram/Demos/Flowchart/FlowchartService.cs index 611b73c..9e8dc4d 100644 --- a/AIStudio.Wpf.ADiagram/Demos/Flowchart/FlowchartService.cs +++ b/AIStudio.Wpf.ADiagram/Demos/Flowchart/FlowchartService.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Media; +using Util.DiagramDesigner; namespace AIStudio.Wpf.ADiagram.Demos.Flowchart { @@ -43,5 +45,27 @@ namespace AIStudio.Wpf.ADiagram.Demos.Flowchart _roles = value; } } + + public static void Approve(FlowNode flowNode, int status, string remark) + { + flowNode.Status = status; + switch (status) + { + case 100: + flowNode.Color = Colors.Green.ToString(); + break; + case 2: + flowNode.Color = Colors.Red.ToString(); + break; + case 3: + flowNode.Color = Colors.Red.ToString(); + break; + case 4: + flowNode.Color = Colors.Red.ToString(); + break; + } + } + + } } diff --git a/AIStudio.Wpf.ADiagram/Demos/Flowchart/FlowchartViewModel.cs b/AIStudio.Wpf.ADiagram/Demos/Flowchart/FlowchartViewModel.cs index 36698d8..69e8582 100644 --- a/AIStudio.Wpf.ADiagram/Demos/Flowchart/FlowchartViewModel.cs +++ b/AIStudio.Wpf.ADiagram/Demos/Flowchart/FlowchartViewModel.cs @@ -98,5 +98,6 @@ namespace AIStudio.Wpf.ADiagram.Demos.Flowchart DiagramViewModel.ClearSelectedItems(); } + } } diff --git a/AIStudio.Wpf.ADiagram/Demos/Flowchart/ViewModels/FlowNode.cs b/AIStudio.Wpf.ADiagram/Demos/Flowchart/ViewModels/FlowNode.cs index 33551af..e7635d6 100644 --- a/AIStudio.Wpf.ADiagram/Demos/Flowchart/ViewModels/FlowNode.cs +++ b/AIStudio.Wpf.ADiagram/Demos/Flowchart/ViewModels/FlowNode.cs @@ -60,13 +60,36 @@ namespace AIStudio.Wpf.ADiagram.Demos.Flowchart { SetProperty(ref _color, value); } - } + } [Browsable(false)] public NodeKinds Kind { get; set; } [Browsable(false)] public string StateImage { get; set; } + + #region 没有存起来,仅仅测试使用 + private int _status; + + public int Status + { + get { return _status; } + set + { + SetProperty(ref _status, value); + } + } + + private string _remark; + public string Remark + { + get { return _remark; } + set + { + SetProperty(ref _remark, value); + } + } + #endregion } public class StartFlowNode : FlowNode diff --git a/AIStudio.Wpf.ADiagram/Demos/Flowchart/Views/ApproveWindow.xaml b/AIStudio.Wpf.ADiagram/Demos/Flowchart/Views/ApproveWindow.xaml new file mode 100644 index 0000000..a8380b9 --- /dev/null +++ b/AIStudio.Wpf.ADiagram/Demos/Flowchart/Views/ApproveWindow.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + diff --git a/AIStudio.Wpf.ADiagram/Demos/Flowchart/Views/ApproveWindow.xaml.cs b/AIStudio.Wpf.ADiagram/Demos/Flowchart/Views/ApproveWindow.xaml.cs new file mode 100644 index 0000000..82b2380 --- /dev/null +++ b/AIStudio.Wpf.ADiagram/Demos/Flowchart/Views/ApproveWindow.xaml.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Text; +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.Shapes; +using Util.DiagramDesigner; + +namespace AIStudio.Wpf.ADiagram.Demos.Flowchart.Views +{ + /// + /// ApproveWindow.xaml 的交互逻辑 + /// + public partial class ApproveWindow : Window + { + public ApproveWindow() + { + InitializeComponent(); + } + } + + public class ApproveWindowViewModel : BindableBase + { + private int _status; + public int Status + { + get + { + return _status; + } + set + { + SetProperty(ref _status, value); + } + } + + private string _remark; + public string Remark + { + get + { + return _remark; + } + set + { + SetProperty(ref _remark, value); + } + } + } +} diff --git a/Util.DiagramDesigner/ViewModels/BaseViewModel/DesignerItemViewModelBase.cs b/Util.DiagramDesigner/ViewModels/BaseViewModel/DesignerItemViewModelBase.cs index 3b2f305..2988759 100644 --- a/Util.DiagramDesigner/ViewModels/BaseViewModel/DesignerItemViewModelBase.cs +++ b/Util.DiagramDesigner/ViewModels/BaseViewModel/DesignerItemViewModelBase.cs @@ -66,7 +66,6 @@ namespace Util.DiagramDesigner get { return (connectors != null && connectors.Count >= 4) ? connectors[3] : null; } } - //public ConnectorViewModel ConnectorViewModel { get; set; } private string _icon; [CanDo] diff --git a/Util.DiagramDesigner/ViewModels/ConnectorViewModel.cs b/Util.DiagramDesigner/ViewModels/ConnectorViewModel.cs index 04e27e3..b478a40 100644 --- a/Util.DiagramDesigner/ViewModels/ConnectorViewModel.cs +++ b/Util.DiagramDesigner/ViewModels/ConnectorViewModel.cs @@ -144,7 +144,6 @@ namespace Util.DiagramDesigner { SourceA = PointHelper.GetPointForConnector(_sourceConnectorInfo); (_sourceConnectorInfo.DataItem as INotifyPropertyChanged).PropertyChanged += new WeakINPCEventHandler(ConnectorViewModel_PropertyChanged).Handler; - //_sourceConnectorInfo.DataItem.ConnectorViewModel = this; } } } @@ -164,7 +163,6 @@ namespace Util.DiagramDesigner { SourceB = PointHelper.GetPointForConnector((FullyCreatedConnectorInfo)_sinkConnectorInfo); (((FullyCreatedConnectorInfo)_sinkConnectorInfo).DataItem as INotifyPropertyChanged).PropertyChanged += new WeakINPCEventHandler(ConnectorViewModel_PropertyChanged).Handler; - //((FullyCreatedConnectorInfo)_sinkConnectorInfo).DataItem.ConnectorViewModel = this; } else {