Just in case this matter which I don't think it should but I'm creating a view in an existing WebForms app. I have all the plumbing working but I can't get the diagram control to show on a view. I'm using the MVC control and I can get things to the view just fine but the diagram itself just doesn't show up. I'm using the boilerplate test code from the tutorial so I don't think it is that. Any help would be appreciated. Here's the view but it is pretty straight forward.
Oh, the diagram is there if I inspect the page with Firebug but it doesn't show. Do I need a render or something?
@using MindFusion.Diagramming.Mvc
@using MindFusion.Diagramming;
@using System.Drawing;
@using SolidBrush = MindFusion.Drawing.SolidBrush;
@using LinearGradientBrush = MindFusion.Drawing.LinearGradientBrush;
@model NorthropGrumman.EPower.UI.Web.Admin.Areas.Admin.Models.ProcessDesignerModel
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>@Model.PageTitle</title>
<script src="~/Scripts/MindFusion.Diagramming.js"></script>
<script>
@{
DiagramView view = new DiagramView("diagramView1");
//Test Code
Diagram diagram = view.Diagram;
diagram.BackBrush = new SolidBrush(Color.AntiqueWhite);
diagram.LinkHeadShape = ArrowHeads.Triangle;
diagram.LinkHeadShapeSize = 3;
DiagramStyle style = new DiagramStyle();
style.FontFamily = "Verdana";
style.Brush = new LinearGradientBrush(Color.LightBlue, Color.Blue, 90);
style.Stroke = new SolidBrush(Color.Black);
ShapeNode node1 = diagram.Factory.CreateShapeNode(new RectangleF(55, 10, 40, 15));
node1.Shape = Shapes.Terminator;
node1.Text = "Start";
node1.Brush = new LinearGradientBrush(Color.Yellow, Color.Orange, 90);
ShapeNode node2 = diagram.Factory.CreateShapeNode(new RectangleF(50, 40, 50, 20));
node2.Text = "Receive order via e-mail";
ShapeNode node3 = diagram.Factory.CreateShapeNode(new RectangleF(50, 70, 50, 20));
node3.Text = "Copy and paste e-mail data into database";
ShapeNode node4 = diagram.Factory.CreateShapeNode(new RectangleF(55, 100, 40, 40));
node4.Shape = Shape.FromId("Decision");
node4.Text = "Shipping involved?";
node4.Brush = new LinearGradientBrush(Color.White, Color.Fuchsia, 90);
ShapeNode node5 = diagram.Factory.CreateShapeNode(new RectangleF(100, 135, 50, 20));
node5.Shape = Shape.FromId("Save");
node5.Text = "Print invoice and UPS label";
node5.Brush = new SolidBrush(Color.Chartreuse);
ShapeNode node6 = diagram.Factory.CreateShapeNode(new RectangleF(100, 165, 50, 20));
node6.Text = "Send e-mail to confirm shipping";
diagram.Nodes.Add(node6);
ShapeNode node7 = diagram.Factory.CreateShapeNode(new RectangleF(100, 195, 50, 20));
node7.Text = "Assemble package and ship";
ShapeNode node8 = diagram.Factory.CreateShapeNode(new RectangleF(55, 230, 40, 15));
node8.Shape = Shapes.Terminator;
node8.Text = "End";
node8.Brush = new LinearGradientBrush(Color.Yellow, Color.Orange, 90);
diagram.Factory.CreateDiagramLink(node1, node2);
diagram.Factory.CreateDiagramLink(node2, node3);
diagram.Factory.CreateDiagramLink(node3, node4);
DiagramLink link4 = diagram.Factory.CreateDiagramLink(node4, node5);
link4.Text = "Yes";
diagram.Factory.CreateDiagramLink(node5, node6);
diagram.Factory.CreateDiagramLink(node6, node7);
diagram.Factory.CreateDiagramLink(node7, node8);
DiagramLink link8 = diagram.Factory.CreateDiagramLink(node4, node8);
link8.Text = "No";
// End Test Code
diagram.Style = style;
ViewBag.DiagramView = view;
}
</script>
</head>
<body>
<h2>@Model.PageHeader</h2>
<div width="90%">
@Html.DiagramView((DiagramView)ViewBag.DiagramView, new { style = "width:1000px; height:700px" })
</div>
</body>
</html>