Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Version 3.3 beta (Read 15319 times)
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Version 3.3 beta
Mar 31st, 2015 at 12:12pm
Print Post  
WpfDiagram version 3.3 contains the following new features and improvements:

Support for Visio stencils
The diagram can now display shapes from stencil files in Visio 2003 XML stencil format (.vsx). To load a stencil file, use an instance of the VisioStencil class. The shapes are displayed in the diagram through VisioNode objects. To associate a stencil shape with the node, create an instance of the VisioContent class and assign it to the node's Content property.



Note that standard stencils installed with Visio are copyrighted by Microsoft, and you should not use them in your application. This feature is intended to let you use public domain stencils, or commercial clipart you have purchased a license for.

Visio import and export classes do not support VisioNodes yet; this will be implemented in next releases.

License keys
There is no separate trial build of the control assemblies anymore. Instead, set the Diagram.LicenseKey property to disable the component's evaluation mode and stop displaying trial messages. If your application contains more than one Diagram instance or other controls by MindFusion, you could call MindFusion.Licensing.LicenseManager.AddLicense(key) from application start-up code to specify the key once instead of setting it per each control. License key strings are now listed on the Keys & Downloads page at MindFusion's customer portal.

AnchorPatern improvements
~ The XUnit and YUnit properties allow specifying the coordinates of an AnchorPoint as a fixed offset from the node's top-left corner rather than in percentage, so that the point position does not change when the node is resized.
~ The AnchorPattern property of Shape class lets you associate anchor points with shape definitions. If a ShapeNode instance does not contain its own AnchorPattern, it will derive the one defined by the node's Shape.
~ TableNode.RowAnchorPattern property lets you specify default AnchorPattern for all table rows.

Miscellaneous
~ LinkHitDistance is now backed by a dependency property.
~ Fixed node spacing in bottom-to-top TreeLayout.
~ TabbedDiagramView.AllowRenamePages now automatically sets new Title values instead of only raising events.
~ ChangeUnit now also scales stoke widths.
~ ShapeDesigner supports alignment grid, which can be customized using ShowGrid, AlignToGrid and GridSize properties.
~ ShapeDesigner allows specifying anchor points for the shape.

If anyone is interested in trying the beta version, please download this archive containing updated assembly files and a sample project showing how to load stencil shapes:
https://mindfusion.eu/_beta/wpfdiag33.zip

Any comments, questions and general feedback are welcome.
  
Back to top
 
IP Logged
 
Centron
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 24
Joined: Feb 11th, 2015
Re: Version 3.3 beta
Reply #1 - May 28th, 2015 at 3:52pm
Print Post  
I saved a stencil from Visio 2010 in the .vsx format. When I tried to load it, I got a null reference exception. Have I made a mistake somewhere?

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Version 3.3 beta
Reply #2 - May 28th, 2015 at 5:54pm
Print Post  
Please attach the .vsx file.
  
Back to top
 
IP Logged
 
Centron
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 24
Joined: Feb 11th, 2015
Re: Version 3.3 beta
Reply #3 - May 29th, 2015 at 6:49am
Print Post  
This is the file.
  

Favoriten.zip ( 14 KB | 258 Downloads )
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Version 3.3 beta
Reply #4 - May 29th, 2015 at 11:10am
Print Post  
This is the fix:
https://mindfusion.eu/_temp/vsx_fix.zip

Additionally, the masters here don't have a Name attribute specified, so you will need to call the VisioContent.Create(Stencil stencil, int index) overload to load them, instead of the one taking name used in our sample project.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Centron
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 24
Joined: Feb 11th, 2015
Re: Version 3.3 beta
Reply #5 - May 29th, 2015 at 3:50pm
Print Post  
Thanks, I can load the stencil now. However, when I create a VisioNode, set the content, and add the node to the diagram, the diagram shows a strange behaviour.

The whole diagram gets this dark gray background, and the hand cursor becomes visible over the whole area. When I click anywhere inside the diagram, a node becomes selected and I can drag it around, but nothing useful is shown. This happens no matter which content I load into a VisioNode.

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Version 3.3 beta
Reply #6 - Jun 1st, 2015 at 8:09am
Print Post  
This modification lets me drag and drop masters from your stencil to diagram in VisioStencils sample project:

Code
Select All
var myDiag = (MyDiagram)e.Source;
var index = myDiag.Stencil.Masters.IndexOf(master);
node.Content = VisioContent.Create(Stencil, index); 



Your screenshot shows the ShapeDesigner control, which can edit only Shape objects at this time. Are you trying to edit a VisioContent object there?

Stoyan
  
Back to top
 
IP Logged
 
Centron
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 24
Joined: Feb 11th, 2015
Re: Version 3.3 beta
Reply #7 - Jun 1st, 2015 at 8:24am
Print Post  
The right-most component is a Diagram, to the right of the ShapeDesigner.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Version 3.3 beta
Reply #8 - Jun 1st, 2015 at 3:49pm
Print Post  
It works both from code and via drag-and-drop in our sample project:

Code
Select All
public MainWindow()
{
	InitializeComponent();

	var stencilFolder = StencilFolder;
	if (!string.IsNullOrEmpty(stencilFolder))
		LoadStencil(System.IO.Path.Combine(stencilFolder, "Favoriten.vsx"));

	var content = VisioContent.Create(diagram.Stencil, 0);
	VisioNode node = new VisioNode(diagram);
	node.Content = content;
	diagram.Nodes.Add(node);
} 





Check if your application isn't replacing newly created VisioNode with a ShapeNode by some chance, e.g. passing through a chain of events including selection, ShapeDesigner import with null Shape, and designer's ShapeChanged event... Alternatively check if there isn't some custom-drawing event handler that works only for ShapeNodes. If you can't find anything like that, please attach your saved diagram file and our developer will investigate.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Centron
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 24
Joined: Feb 11th, 2015
Re: Version 3.3 beta
Reply #9 - Jun 1st, 2015 at 4:14pm
Print Post  
To be safe, I have taken the sample project provided by you, replaced the references with the fixed DLLs provided to me, and made the same changes in code. It still gives me the same result:



Only the 4th stencil, the yellow star, gives a different behaviour: That one shows nothing at all if I drag & drop it into the diagram. All others give the same result as pictured.

I attached the diagram save text with the first icon dropped.

If it helps to find the root for the behaviour, if it lies on my machine, I would welcome you to have a look at my machine over TeamViewer or similar tool.
  

diagram_003.txt ( 10 KB | 165 Downloads )
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Version 3.3 beta
Reply #10 - Jun 2nd, 2015 at 10:41am
Print Post  
Apparently the control does not convert stencil's LineWidth attribute correctly to a number when running with DE regional settings, and the gray area you are seeing consists of some very thick border lines. For time being you can work around that by switching temporarily to invariant culture:

Code
Select All
//Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("de");

var culture = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

var stencilFolder = StencilFolder;
if (!string.IsNullOrEmpty(stencilFolder))
	LoadStencil(System.IO.Path.Combine(stencilFolder, "Favoriten.vsx"));

Thread.CurrentThread.CurrentCulture = culture; 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Centron
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 24
Joined: Feb 11th, 2015
Re: Version 3.3 beta
Reply #11 - Jun 2nd, 2015 at 1:35pm
Print Post  
Now the diagram looks like this:

http://i.imgur.com/2cV6BRH.png
  

diagram_004.txt ( 10 KB | 171 Downloads )
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Version 3.3 beta
Reply #12 - Jun 3rd, 2015 at 11:15am
Print Post  
The problem actually happens during runtime evaluation of Visio formulas, so you should see correct shapes if you don't restore thread's culture (Thread.CurrentThread.CurrentCulture = culture;  line) after loading. Our developer will try to fix it in next few days.
  
Back to top
 
IP Logged
 
Centron
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 24
Joined: Feb 11th, 2015
Re: Version 3.3 beta
Reply #13 - Jun 3rd, 2015 at 3:30pm
Print Post  
Thanks, that helps, now it looks the same as on your end. As you can see on your end, the third and fourth icon look quite different from the stencil, and the first one (the folder icon) is missing a detail when made into a ShapeNode, is that a fundamental problem or will the compatibility be increased in future releases?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Version 3.3 beta
Reply #14 - Jun 8th, 2015 at 9:09am
Print Post  
This build should load stencils correctly when using DE culture:
https://mindfusion.eu/_temp/vsx_fix.zip

Our developer will investigate the missing details - they might be coming from conditional visibility of primitives, which Visio uses to customize shapes via attributes you toggle in context menu. We also do not support themes at this time, any reference to theme attributes will be replaced with cached value instead, but it's not always available.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint