MindFusion Pack for WPF 2014.R1

MindFusion has released its Pack for WPF 2014.R1. Here is an overview of the new features:

Support for Visual Studio 2013
The installer can create a toolbox palette in VS2013 for the components and optionally installs VS2013 sample projects.

diagram16x16MindFusion.Diagramming

Import of Visio 2013 files
The new Visio2013Importer class can import *.vsdx files, which were created with Microsoft Visio 2013. The importer requires a reference to the MindFusion.Diagramming.Wpf.VisioImport.dll assembly. You can use the various overloads of the Import method to import the Visio drawing into a DiagramDocument, whose pages correspond to the Visio pages or into a single Diagram, whose content
is merged from all important pages.

Zoom control
The ZoomControl class lets the users change interactively the current zoom level and scroll position of a Diagram or DiagramView. In order to use it, you should add a Zoom control to the window, place it anywhere over the target diagram and set the control’s Target property to that diagram or view. The Zoom control offers numerous customization properties.

Miscellaneous

  • Enable the AllowRenamePages property of TabbedDiagramView to let users rename a DiagramPage interactively by clicking on its tab.
  • Several new shapes added for better compatibility with Visio 2013 basic stencil: RightTriangle, Decagon, Trapezoid, Star4Pointed, Star5Pointed, Star6Pointed, Star7Pointed, Star16Pointed, Star24Pointed, Star32Pointed, Donut, Plaque.
  • DefaultEncoding and AutoDetectEncoding properties added to PdfExporter.
  • and much more.
The Zoom control and the new predefined shape nodes

The Zoom control and the new predefined shape nodes

You can read details about the new features of the pack at the news page on the forum. The trial version is available for direct download from this link:

Download MindFusion.Pack for WPF 2014.R1

About MindFusion.Wpf Pack: A set of advanced WPF components that help you build your business application easy and on time. The tools provide you with a complete set of features to create, edit and render complex flowcharts, charts, diagrams, calendars, schedules, maps and reports. A set of gauges and UI elements is also included. Each component offers various samples, tutorials and detailed documentation. The controls offer simple and intuitive API, completely customizable appearance, numerous input/output options and a rich event set. Each tool has been thoroughly tested to guarantee that you and your application get the high quality and performance you deserve.

You can read more about the capabilities of each component at its features page:

Prices and licenses are explained in details at the buy page. We offer permanent discounts to certain types of commercial as well non commercial organizations – check here if you qualify.

MindFusion Pack for WPF 2013.R2

MindFusion has just released Pack for WPF 2013.R2, which adds the following new features to the components in the pack:

chartMindFusion.Charting

Bubble Chart Control

You can now create beautiful bubble charts with the new BubbleChart class. The bubble chart can hold unlimited number of BubbleSeries. The appearance of the chart is completely customizable with various properties for the pens, brushes, labels and the other visual settings of the chart.

A bubble chart in Wpf.

A bubble chart in Wpf.

3D Charts Improvements

All 3D charts derive now from a new base class – the Chart3D class. This way the control has parallel 2D and 3D chart hierarchies. The 3D chart classes support most of the properties of the 2D classes.

Hit testing in 3D has been improved. The Chart3D.HitTest method returns a ChartHitTestResult3D object, which contains information about the result of the hit-testing operation and a list of ChartElement objects available in the 2D version.

The SurfaceChart exposes a variety of new properties including CloseModelFigure, Effect3D, SurfaceType. The SurfaceType property now enables the surface chart to display its associated data as scatter marks, rather than a surface. You can customize the scatter marks through the new properties in the SurfaceSeries class – ScatterSize, ScatterType, and ShowScatterFlag.

Chart Effects

You can now create visual effects in all 2D charts with the ChartEffect property.

Miscellaneous

diagram16x16MindFusion.Diagramming

Display 3D Graphs

You can use the new DiagramView3D control to display the elements of a diagram in 3D space. Assign the Diagram that should be displayed in this view to the Diagram property. DiagramView3D adds a 3D model to the scene for each node or link of the specified diagram. The positions of nodes in 3D coordinate space are specified via the Position3D attached property.

The new 3D graph viewer

The new 3D graph viewer

Import of OpenOffice Draw Files

Use the new DrawImporter class to import .odg files, which you have created with the OpenOffice Draw vector graphics editor. In order to use it, you must add a reference to the MindFusion.Diagramming.Wpf.DrawImport.dll assembly. Various overloads of the Import method can be used to import the OpenOffice drawing into a DiagramDocument whose pages correspond to the Draw pages, or into a single Diagram whose content is merged from all imported pages.

Import of Visio 2003 XML drawings

You can now import Visio 2003 XML Drawing files (*.vdx) into the Diagramming for Wpf wit the new VisioImporter. The standard Visio flowchart shapes, as well as most of the UML and Database entity shapes are imported to their closest representation in the MindFusion.Diagramming object model. The Visio connectors are imported as DiagramLink objects, preserving the relationship between the connected nodes. The Import method imports all Visio pages into a DiagramDocument, creating a DiagramPage for each page from the *.vdx file. The GetPageCount method gives you how many pages there are in a Visio document. Call the ImportPage method to import just a single page.

Miscellaneous

  • Improved appearance of hatch patterns used to draw frames for several HandlesStyle types.
  • Added support for loading HatchBrush objects from files saved by Windows Forms and ASP.NET versions of the diagramming control.
  • AttachTo overloads that attach nodes to link segments or control points now allow specifying negative index values.
  • Negative values are interpreted as relative to the last point or segment, regardless of the current number of link segments. For example, -2 denotes the second-to-last point or segment.
  • And much more.

You can find more about the new features of the components at the forum. Here is a link to download the trial version:

Download MindFusion.Pack for WPF 2013.R2

About MindFusion.Wpf Pack: A set of advanced WPF components that help you build your business application easy and on time. The tools provide you with a complete set of features to create, edit and render complex flowcharts, charts, diagrams, calendars, schedules, maps and reports. A set of gauges and UI elements is also included. Each component offers various samples, tutorials and detailed documentation. The controls offer simple and intuitive API, completely customizable appearance, numerous input/output options and a rich event set. Each tool has been thoroughly tested to guarantee that you and your application get the high quality and performance you deserve.

You can read more about the capabilities of each component at its features page:

Prices and licenses are explained in details at the buy page. We offer permanent discounts to certain types of commercial as well non commercial organizations – check here if you qualify.

Diagramming for WPF 3.0.2

MindFusion has just released Diagramming for Wpf programming component v. 3.0.2. Most of the newly added features are requested by our customers. Here are details:

Visio 2003 Import

The new VisioImporter lets you import Visio 2003 XML Drawing files (*.vdx) into WpfDiagram. You can import all standard Visio flowchart shapes as well most of the UML and Database entity shapes. The shapes are imported to their closest representations in the MindFusion.Diagramming for Wpf object model. The relationships between the objects are preserved and the Visio links are imported as DiagramLink objects. Additionally, most of the attributes of the Visio objects such as text, text format, fill and line colour and style are preserved. WpfDiagram raises an event for each imported node and you can set the shape node if it is not recognized by the control or you want to change the shape.

The Import method imports all Visio pages into a DiagramDocument. A DiagramPage is created for each page from the VDX file. The new GetPageCount and ImportPage methods let you determine how many pages are in the Visio document and import only a single one. You can import all Visio pages into a single diagram.

It is easy to import a  diagram from Visio.

It is easy to import a diagram from Visio.

Miscellaneous

  • The overload methods of AttachTo that attach node to link segments or control points, now let you specify negative index values. Negative values are interpreted as relative to the last point or segment, regardless of the current number of link segments.
  • The handling of Clip paths in PdfExporter is improved.
  • You can export the swimplane grid to Visio by setting the ExportLanes property of the VisioExporter.
  • The Copy method lets you copy text attributes between objects that implement the ITextAttribute interface, such as diagram items table cells, tree items.
  • as well other new features – check the full list here.
An arrow is shaped by its control points.

An arrow is shaped by its control points.

You can download the trial version of the software from this link:

Download MindFusion.Diagramming for WPF 3.0.2

The download contains all runtime libraries of the control, various samples for different .NET versions, extensive desktop documentation and step-by-step tutorials.

If you face difficulties installing or using Diagramming for Wpf, please contact MindFusion support team per e-mail or phone. You can also use the forum or help desk. All support inquiries are answered within hours of receiving them.

About MindFusion.Diagramming for Wpf: Designed and developed to be easy to integrate, use, and customize, this native WPF component places at your disposal every single feature you would ever need to create flowcharts, diagrams, graphs, schemes, DB relationships, trees and many more. Its long list of style options gives you complete control over the appearance of the diagram. With a set of eight automatic layouts you are sure to choose the best arrangement for your items and make the diagram easy to comprehend.

The control boasts a long list of events, properties and methods for user interaction, item creation, data input and output. You can read the full features list here. The online demo shows samples that demonstrate various capabilities of the control. The licensing scheme and prices are uploaded at the buy page. Source code is also available.

Create diagram connectors using drag and drop

In this post we show how to create diagram links via drag-and-drop operation from a NodeListView used as a palette. Since the NodeListView control can contain only DiagramNode objects, we will create a custom node shape representing a connector. Once the dummy connector node is created, the NodeCreated event handler will replace it with a DiagramLink. In addition, the handler will find nearby nodes and automatically connect the link to them.

Let’s start with a new WPF project. Add a reference to mindfusion.diagramming.dll, and add Diagram and NodeListView controls to the window:

<ScrollViewer
	Grid.Column="0"
	Focusable="False"
	HorizontalScrollBarVisibility="Visible">
	
	<diag:Diagram
		x:Name="diagram"
		AllowDrop="True"
		NodeCreated="OnNodeCreated"
		NodeModified="OnNodeModified">
	</diag:Diagram>
	
</ScrollViewer>

<diag:NodeListView
	x:Name="nodeList"
	Grid.Column="1">
</diag:NodeListView>

In the Window constructor, create a custom node shape that will represent connectors:

var connectorShape = new Shape(
	null, // no borders
	new[] // decorations
	{
		new LineTemplate(10, 10, 10, 50),
		new LineTemplate(10, 50, 90, 50),
		new LineTemplate(90, 50, 90, 90)
	},
	null,
	FillRule.Nonzero, "Connector");

Add a few nodes to the NodeListView, along with the dummy connector node:

var item1 = new ShapeNode { Shape = Shapes.Rectangle };
NodeListView.SetLabel(item1, "Activity");
nodeList.Items.Add(item1);

var item2 = new ShapeNode { Shape = Shapes.Decision };
NodeListView.SetLabel(item2, "Decision");
nodeList.Items.Add(item2);

var item3 = new ShapeNode { Shape = connectorShape };
NodeListView.SetLabel(item3, "Connector");
nodeList.Items.Add(item3);

In the NodeCreated event handler, check if the newly created node represents a connector, and replace it with a DiagramLink:

var node = e.Node as ShapeNode;
if (node != null)
{
	if (node.Shape.Id == "Connector")
	{
		// replace the dummy connector node with a DiagramLink
		var bounds = node.Bounds;
		diagram.Items.Remove(node);

		var link = diagram.Factory.CreateDiagramLink(
			bounds.TopLeft, bounds.BottomRight);
		link.SegmentCount = 3;
		link.Shape = LinkShape.Cascading;

		ConnectToNearbyNode(link);
	}
	...
}

Otherwise if it is a regular node, set its anchor points and connect it to nearby unconnected links, if there are any:

else
{
	node.AnchorPattern = AnchorPattern.Decision2In2Out;
	node.Effects.Add(new GlassEffect());
	ConnectToNearbyLink(node);
}

The ConnectToNearbyNode method uses a LINQ query to find nodes in the vicinity of the link’s start or end point. If one is found at a distance shorter than 120 points, it is set as the link’s Origin or Destination.

private void ConnectToNearbyNode(DiagramLink link)
{
	// connect to a nearby origin node
	var origin = diagram.Nodes.OrderBy(n =>
		Utilities.Distance(n.GetCenter(), link.StartPoint)).FirstOrDefault();

	if (origin != null)
	{
		var distance = Utilities.Distance(origin.GetCenter(), link.StartPoint);
		if (distance < 120)
		{
			link.Origin = origin;
			link.Route();
		}
	}

	// connect to a nearby destination node
	var destination = diagram.Nodes.Where(n => n != origin).OrderBy(n =>
		Utilities.Distance(n.GetCenter(), link.EndPoint)).FirstOrDefault();

	if (destination != null)
	{
		var distance = Utilities.Distance(destination.GetCenter(), link.EndPoint);
		if (distance < 120)
		{
			link.Destination = destination;
			link.Route();
		}
	}
}

Similarly, the ConnectToNearbyLink method finds a nearby unconnected link and sets the specified node as the link’s Origin or Destination.

private void ConnectToNearbyLink(DiagramNode node)
{
	var outLink = diagram.Links.Where(l => l.Origin is DummyNode).OrderBy(l =>
		Utilities.Distance(node.GetCenter(), l.StartPoint)).FirstOrDefault();

	if (outLink != null)
	{
		var distance = Utilities.Distance(node.GetCenter(), outLink.StartPoint);
		if (distance < 90)
		{
			outLink.Origin = node;
			outLink.Route();
			return;
		}
	}

	var inLink = diagram.Links.Where(l => l.Destination is DummyNode).OrderBy(l =>
		Utilities.Distance(node.GetCenter(), l.EndPoint)).FirstOrDefault();

	if (inLink != null)
	{
		var distance = Utilities.Distance(node.GetCenter(), inLink.EndPoint);
		if (distance < 90)
		{
			inLink.Destination = node;
			inLink.Route();
			return;
		}
	}
}

The result of several drag and drop operation is displayed below.

The complete sample project is available for download here:
https://mindfusion.eu/_samples/LinkDragDrop.zip

Enjoy!

Custom appearance of WPF Resource view

Continuing from the previous post we will now customize the appearance of the Resource view to achieve a more aesthetically pleasing presentation. The appearance of the view is customized by setting various properties of the Calendar.ResourceViewSettings object.

We will build our presentation on the Silver theme by reducing the sharpness and contrast of colors and making the font uniform across the entire view. The customization process is divided to the following steps:

Customize the view background.

calendar.ResourceViewSettings.CalendarStyle.Background = Brushes.White;

Customize the row headers.

calendar.ResourceViewSettings.ExpandableRows = false;
calendar.ResourceViewSettings.HeaderStyle.FontFamily = headerFont;
calendar.ResourceViewSettings.HeaderStyle.FontSize = 13;
calendar.ResourceViewSettings.HeaderStyle.Foreground = new SolidColorBrush(Color.FromArgb(255, 64, 64, 64));
calendar.ResourceViewSettings.HeaderStyle.Background = Brushes.White;
calendar.ResourceViewSettings.HeaderStyle.BorderBrush = borderBrush;
calendar.ResourceViewSettings.HeaderStyle.BorderThickness = new Thickness(0, 0, 0, 1);

Customize the view cells.

calendar.ResourceViewSettings.CellStyle.Background = Brushes.White;
calendar.ResourceViewSettings.CellStyle.BorderBrush = borderBrush;
calendar.ResourceViewSettings.WeekendStyle.Background = new SolidColorBrush(Color.FromArgb(255, 250, 250, 250));
calendar.ResourceViewSettings.WeekendStyle.BorderBrush = borderBrush;

Customize the view timelines.

calendar.ResourceViewSettings.BottomTimelineSettings.CalendarStyle.Background = Brushes.White;
calendar.ResourceViewSettings.BottomTimelineSettings.CalendarStyle.BorderBrush = borderBrush;
calendar.ResourceViewSettings.BottomTimelineSettings.CalendarStyle.FontFamily = headerFont;
calendar.ResourceViewSettings.BottomTimelineSettings.CalendarStyle.FontSize = 13;
calendar.ResourceViewSettings.BottomTimelineSettings.CalendarStyle.FontWeight = FontWeights.Normal;
calendar.ResourceViewSettings.BottomTimelineSettings.NowFillBrush = Brushes.Transparent;
calendar.ResourceViewSettings.MiddleTimelineSettings.CalendarStyle.Background = Brushes.White;
calendar.ResourceViewSettings.MiddleTimelineSettings.CalendarStyle.BorderBrush = borderBrush;
calendar.ResourceViewSettings.MiddleTimelineSettings.CalendarStyle.FontFamily = headerFont;
calendar.ResourceViewSettings.MiddleTimelineSettings.CalendarStyle.FontSize = 13;
calendar.ResourceViewSettings.MiddleTimelineSettings.CalendarStyle.FontWeight = FontWeights.Normal;
calendar.ResourceViewSettings.MiddleTimelineSettings.NowFillBrush = Brushes.Transparent;

Note that the font, headerFont and borderBrush variables are defined as follows:

FontFamily font = new FontFamily("Segoe UI");
FontFamily headerFont = new FontFamily("Segoe UI Light");
Brush borderBrush = new SolidColorBrush(Color.FromArgb(255, 224, 224, 224));

The final result is displayed below.

scheduling-resourceviewappearance

The complete sample project is available for download here:
https://mindfusion.eu/_samples/WpfPlannerResourceViewAppearance.zip

You can get the trial version of MindFusion.Scheduling for WPF from this link:
https://mindfusion.eu/WpfPlannerTrial.zip

Enjoy!