Пример #1
0
        private void InitializeDiagram()
        {
            //Initialize SwimlaneCollection to SfDiagram
            this.Swimlanes = new SwimlaneCollection();

            //Creating the SwimlaneViewModel
            SwimlaneViewModel swimlane = new SwimlaneViewModel()
            {
                UnitWidth   = 450,
                UnitHeight  = 120,
                OffsetX     = 300,
                OffsetY     = 150,
                Orientation = Orientation.Horizontal,
            };

            //Creating Header for SwimlaneViewModel
            swimlane.Header = new SwimlaneHeader()
            {
                UnitHeight = 32,
                Annotation = new AnnotationEditorViewModel()
                {
                    Content = "SALES PROCESS FLOW CHART"
                },
            };
            LaneViewModel lane1 = new LaneViewModel()
            {
                UnitHeight = 100,
                Header     = new SwimlaneHeader()
                {
                    UnitHeight = 30,
                    Annotation = new AnnotationEditorViewModel()
                    {
                        Content = "Consumer"
                    }
                }
            };

            swimlane.Lanes = new LaneCollection()
            {
                lane1
            };
            NodeViewModel node = new NodeViewModel()
            {
                UnitHeight = 50, UnitWidth = 50, LaneOffsetX = 100, LaneOffsetY = 30
            };
            NodeViewModel node1 = new NodeViewModel()
            {
                UnitHeight = 50, UnitWidth = 50, LaneOffsetX = 250, LaneOffsetY = 30
            };

            (this.Nodes as NodeCollection).Add(node);
            (this.Nodes as NodeCollection).Add(node1);
            (lane1.Children as LaneChildren).Add(node);
            (lane1.Children as LaneChildren).Add(node1);

            //Add Swimlane to Swimlanes property of the Diagram
            (this.Swimlanes as SwimlaneCollection).Add(swimlane);
        }
Пример #2
0
        private void InitializeDiagram()
        {
            //Initialize SwimlaneCollection to SfDiagram
            this.Swimlanes = new SwimlaneCollection();

            //Creating the SwimlaneViewModel
            SwimlaneViewModel swimlane = new SwimlaneViewModel()
            {
                UnitWidth   = 450,
                UnitHeight  = 120,
                OffsetX     = 300,
                OffsetY     = 150,
                Orientation = Orientation.Horizontal,
            };

            //Creating Header for SwimlaneViewModel
            swimlane.Header = new SwimlaneHeader()
            {
                UnitHeight = 32,
                Annotation = new AnnotationEditorViewModel()
                {
                    Content = "SALES PROCESS FLOW CHART"
                },
            };

            swimlane.Phases = new PhaseCollection()
            {
                new PhaseViewModel()
                {
                    UnitWidth = 450,
                    Header    = new SwimlaneHeader()
                    {
                        UnitHeight = 24,
                        Annotation = new AnnotationEditorViewModel()
                        {
                            Content = "Phase 1"
                        },
                    }
                }
            };

            //Add Swimlane to Swimlanes property of the Diagram
            (this.Swimlanes as SwimlaneCollection).Add(swimlane);
        }
Пример #3
0
        private void InitializeDiagram()
        {
            //Initialize SwimlaneCollection to SfDiagram
            this.Swimlanes = new SwimlaneCollection();

            //Creating the SwimlaneViewModel
            SwimlaneViewModel swimlane = new SwimlaneViewModel()
            {
                UnitWidth   = 450,
                UnitHeight  = 420,
                OffsetX     = 400,
                OffsetY     = 450,
                Orientation = Orientation.Horizontal,
            };
            LaneViewModel lane1 = new LaneViewModel()
            {
                UnitHeight = 100,
            };

            swimlane.Lanes = new LaneCollection()
            {
                lane1
            };

            CustomNodeVM node = new CustomNodeVM()
            {
                UnitHeight = 50, UnitWidth = 50, LaneOffsetX = 100, LaneOffsetY = 30
            };

            CustomNodeVM node1 = new CustomNodeVM()
            {
                UnitHeight = 50, UnitWidth = 50, LaneOffsetX = 250, LaneOffsetY = 30
            };

            (this.Nodes as NodeCollection).Add(node);
            (this.Nodes as NodeCollection).Add(node1);

            (lane1.Children as LaneChildren).Add(node);
            (lane1.Children as LaneChildren).Add(node1);

            //Add Swimlane to Swimlanes property of the Diagram
            (this.Swimlanes as SwimlaneCollection).Add(swimlane);
        }
Пример #4
0
        private void InitializeDiagram()
        {
            SwimlaneViewModel swimLane = new SwimlaneViewModel();

            swimLane.Orientation = Orientation.Horizontal;
            swimLane.OffsetX     = 400;
            swimLane.OffsetY     = 300;
            swimLane.UnitWidth   = 650;
            swimLane.UnitHeight  = 500;

            swimLane.Header = new SwimlaneHeaderViewModel()
            {
                UnitHeight = 50,
                Annotation = new AnnotationEditorViewModel()
                {
                    Content = "SALES PROCESS FLOW CHART"
                },
            };
            PhaseViewModel nn1 = CreatePhaseViewModel(true, "Phase1", 0);

            nn1.UnitWidth = 760;

            swimLane.Phases = new ObservableCollection <PhaseViewModel>()
            {
                nn1
            };

            LaneViewModel ll1 = CreateLaneViewModel(true, "Consumer", 270);
            NodeViewModel n1  = ChildElement(ll1, "Rectangle", "Consumer learns of product", 130, 55);
            NodeViewModel n2  = ChildElement(ll1, "Decision", "Does Consumer \n want the product", 320, 55);
            NodeViewModel n3  = ChildElement(ll1, "Flow", "No sales lead", 520, 55);
            NodeViewModel n4  = ChildElement(ll1, "Rectangle", "Sell to consumer", 680, 55);


            LaneViewModel ll2 = CreateLaneViewModel(true, "Marketing", 270);
            NodeViewModel n5  = ChildElement(ll2, "Rectangle", "Create marketing campaigns", 130, 55);
            NodeViewModel n6  = ChildElement(ll2, "Rectangle", "Marketing finds sales leads", 320, 55);


            LaneViewModel ll3 = CreateLaneViewModel(true, "Sales", 270);
            NodeViewModel n7  = ChildElement(ll3, "Rectangle", "Sales receives lead", 320, 60);

            LaneViewModel ll4 = CreateLaneViewModel(true, "Success", 270);
            NodeViewModel n8  = ChildElement(ll4, "Rectangle", "Success helps retain consumer as a customer", 680, 55);

            ll1.UnitHeight = 115;
            ll2.UnitHeight = 115;
            ll3.UnitHeight = 115;
            ll4.UnitHeight = 115;
            swimLane.Lanes = new ObservableCollection <LaneViewModel>()
            {
                ll1, ll2, ll3, ll4
            };

            (this.Swimlanes as ObservableCollection <SwimlaneViewModel>).Add(swimLane);



            CreateConnection(n1, n2);
            ConnectorViewModel noconnector = CreateConnection(n2, n3);

            noconnector.Annotations = new ObservableCollection <IAnnotation>()
            {
                new AnnotationEditorViewModel()
                {
                    Content = "No"
                }
            };
            CreateConnection(n4, n8);
            ConnectorViewModel yesconnector = CreateConnection(n2, n6);

            yesconnector.Annotations = new ObservableCollection <IAnnotation>()
            {
                new AnnotationEditorViewModel()
                {
                    Content = "Yes", RotationReference = RotationReference.Page, Length = 0.4
                }
            };
            CreateConnection(n5, n1);
            CreateConnection(n6, n7);
            ConnectorViewModel con   = CreateConnection(n4, n7);
            NodePortViewModel  port  = CreatePort(n4, 0, 0.5);
            NodePortViewModel  port1 = CreatePort(n7, 1, 0.5);

            con.SourcePort = port;
            con.TargetPort = port1;
        }