This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
“System.Windows.ResourceReferenceKeyNotFoundException”类型的未经处理的异常出现在 PresentationFramework.dll 中。 其他信息: 未找到“[DiagramShape Rectangle]”资源。 |
|
|
Hello Please try merging the DiagramShapes resource dictionary into the main resource dictionary used by your application. For example, try adding the following code to Window.Resources in your main window. See the samples (such as QuickStart) provided with WPF Diagrams for some examples.
Let me know how it goes. -Jason Fauchelle |
|
|
Hi Jason According to your suggestion, I have solved this problem. Thank you very much! |
|
|
Excellent, good to hear you got it working. Let me know if you have any other questions as you explore WPF Diagrams. -Jason Fauchelle |
|
|
Hi Jason Thank you for your help last time! Now I have another question to consult you.
When I open a xml file, there is a problem. As shown below: "The specified parameter is beyond the range of valid values." As this point, I use the .net framework 4 When I use .net framework 3.5, There is no this problem. Is this software only support .net framework 3.5? Thank you! |
|
|
Hello Thanks for pointing this out. There are no known issues with using WPF Diagrams in .Net framework 4, it should just work. I have not been able to reproduce this problem yet. Could you please send me the xml file that you are loading the diagram from. If you have custom diagram implementations or/and custom styles, it would be best if you could send your whole project so far - or a simplified version if it contains sensitive information. -Jason Fauchelle |
|
|
Hello Jason The xml file is simple. I use VS2010 and the project "QuickStart.sln" in the Mindscape Samples. When I switch between .net framework and .net framework 4, the problem will happen.
|
|
|
Hello Thanks for the description. I have tried this exact same thing, including the same VS version, but still have not been able to reproduce this. The most likely cause of this is if you have not got the latest version of WPF Diagrams. For WPF Diagrams we provide nightly builds which include bug fixes and new features beyond the version 3 release. It is possible this bug was fixed in a nightly build. Please download and install the latest nightly build from here: http://www.mindscapehq.com/products/wpfdiagrams/nightly-builds and let me know if it solves the problem. -Jason Fauchelle |
|
|
Hello Jason Currently, I am using the WPF Diagram 2, it should be the version caused the problem before. Now I have another quesion to consult you, I want to package my own modules, but I meet a problem, I can't find the related properties, I don't konw how to display the name of the module in the rectangle ? thank you Jason. |
|
|
Hello To do this, you will not be able to use the StepNodeTool extension (for flow diagrams), or ShapeTool extension (for general shape diagrams) as shown in the demos. Instead, you will need to set all the properties of the DiagramNodeTool manually to specify exactly what you want. There are 3 main things you need to set: In the direct content of the DiagramNodeTool - between the tags, you can define the visuals that appear in the tool box. In your case you'll probably just want a Border containing a TextBlock. You'll want to set the CursorVisual property to define the visuals as the toolbox item is being dragged to the DiagramSurface. This is generally exactly the same as what you specified as the toolbox visuals, but with the Opacity set to something like 0.6 to make it semi-transparent. This visual can be whatever you want though. For example, you may not want to display the text in the dragging visual - only the toolbox item. Last of all, you'll need to set the Builder property to specify what type of node this tool box item is going to build once it has been dragged onto the DiagramSurface. If you want to use our built-in nodes, you could use the FlowDiagramNodeBuilder, or ShapeNode builder depending on your type of diagram. Both of these allow you to set the Shape which will be the rectangle by default. Or, if you want the toolbox item to build one of your own nodes, you can set it to be one of your custom IDiagramNodeBuilder implementations. Then you can optionally set the ToolTip property, and possibly the Width and Height to set exactly the amount of space in the tool box you want the item to occupy. Examples of creating custom tool box items can be found in the ActivityDiagrams demo in ActivityDiagramToolBoxItems.xaml. These examples use custom node builders. Let me know if you have questions about any of this. -Jason Fauchelle |
|