This is a migrated thread and some comments may be shown as answers.

Advice : Agnostic user diagram displaying a well known set of object

6 Answers 127 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Nicolas
Top achievements
Rank 1
Nicolas asked on 02 Mar 2012, 06:43 PM
First :
I'm working in a domain using well known objects ... let say, water distribution.
The objects are, most of the time, always the same.
  • Distribution pipes
  • Pumps
  • Captors
  • Motors
  • etc.

Most of the time, the first things to do is to layout all the objects and make connections between them. For instance, layout the water distribution of a city. It seams that I can do this in an easy way with the new (beta) diagram feature, using WPF and MVVM.

It seams really nice by the way!

Second :
Let's complicate the thing a little bit.
I would like my application to be modular. I discovered prims/unity. Searching your blogs/forums, it seams feasible to use rad controls in a prism environment.

I found some ways to use RadDocking with prism and also some examples on how to use the ribbon with prism. 
But founding no "Here is the way to do" solution, I known that it won't be as easy as the diagram part, but that's OK for me.

Third :
Here is the funny part.
Let's say there is an existing diagram for a city.
All the layout is done and I can have basic information when I'm selecting an element (the kind, a part number, the color, the placement, the links, etc.)

But after that, I would like to have a set of .dll files to add or remove from the application installation folder that will adapt the application so that it can be used by different people. But keep in mind that the diagram is always the same.

As an example, take the maintenance team and inventory team as 2 separate kinds of users.
By clicking on a water pump, I would like to have a new/expanded property view (and even ribbon tab, commands) that are designed by kind of user:
  • Maintenance : when was the last maintenance and who did it, when is the next one and who will do it, etc.
  • inventory team : do we have spare parts and how many. Where are the parts buy, what is the cost, etc.
I could also have new diagram element that can be added to the existing diagram.

The idea is that my data repository contains all the information for my domain object, but I want to be able to have a modular application displaying only the necessary part that could interest the user. In fact, it could be sold as 3 different applications if necessary.

My question is :
- It seems easy to build a diagram
- It seems feasible to build a diagram inside a modular application
=> It is possible to build a modular diagram application so that it fill the needs explained in the third part of this post?

Any advice or real experiences are welcomed.

Regards,

Nic

6 Answers, 1 is accepted

Sort by
0
Miro Miroslavov
Telerik team
answered on 05 Mar 2012, 09:10 AM
Hello Nikolas,

 Thank you for your interest and feedback about RadDiagram. Our main goal is to provide easy to use Diagramming framework so that you can build easily simple diagramming solutions and make it possible to build really complex solutions. It integrates well with Prism and you should not have any problems with modular applications. You can find the attached project that combines Prism and RadDiagram (it is Silverlight application, but will be the same for WPF). 
We are working closely with our diagramming partner - The Orbifold, that has plenty of real diagramming experience, so if you need any further help/assistance, please let us know. 
Hope this helps.

Kind regards,
Miro Miroslavov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Nicolas
Top achievements
Rank 1
answered on 18 Apr 2012, 01:01 PM
Hello Miro,

Having been around since about 3 years with the RadControl (and being very pleased with it) we were expecting a lot from RadDiagram.
We are really exited with it as it seem (it is for the part I explored) really powerfull ... except ... MVVM.

We fully embraced the MVVM approach in our project using the RadControl and would want to continue in our new project using RadDiagram. The problem is that, as stated in one of your Howto, "The MVVM mechanism is not bi-directional. That is, when you have a graph source set and alter the diagram at runtime it will not update the graph source. Changing the graph source does obviously alter the diagram.".

I understand that you have plan in Q2 (or Q3) to improve MVVM support, but my project is starting in a couple of weeks and I need to provide a kind of commitment about the technologies we will be using.

My question is : is there a way to Synchronize the graph source (the ViewModel) when altering the diagram at runtime?
I though about using event to synchronize the ViewModel, but I'm afraid there will not be events for all my needs.
Using events, I could have been filling the gap until a release that fully support MVVM.

Any advice are welcomed,

Best regards,

Nic
0
Alex Fidanov
Telerik team
answered on 18 Apr 2012, 02:46 PM
Hello Nic,

 Since the beta release, we have done some improvement on the support for MVVM. We are going to introduce a bi-directional MVVM support for Q2 2012.

This mechanism will represent an extended IGraphSource interface, which will include methods for creating, removing and adding items in the underlying items source.
These methods will be called by the diagram control when a new model is needed (CreateNode|Link) or when a model is added or removed (respectively AddNode|Link and RemoveNode|Link).
The parameters of these methods should provide you with enough information on what has happened in the diagram control so that you can update your underlying items source properly.

We are also working on a serializable graph source using the same approach.

Although we are still working on it, it would be great if you could give us your feedback on what we have so far and see if it would be the solution for your scenario. If you submit a private support ticket, I would be happy to send you an example demonstrating how the new approach works.

Greetings,
Alex Fidanov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Matt
Top achievements
Rank 1
answered on 24 May 2012, 08:52 PM
Alex,

I'm using the RadDiagram to represent a section of an XML configuration file for state modeling. My plan is to save one XML file for the data and another XML file for the diagram representation. The slightly tough part is reading both files and matching up my elements to shapes within the diagram file. I made a custom diagram shape class that derives from RadDiagramShape that contains extra properties for the matching and overrides Serialize/Deserialize to store/retrieve those extra properties. However, when I create my IGraphSource and assign it to the diagram control's GraphSource property, it creates everything using RadDiagramShape by default. Basically I have an ID type property that will link elements within my config file to shapes within the diagram file.

Would the improvements to IGraphSource you described in your previous reply give me the capability of creating shapes with my custom diagram shape class?

Is there any current workaround to interrupt the default serializer and substitute my custom diagram shape class for RadDiagramShape? I know that if I start with a blank diagram and draw shapes using my custom diagram shape class, the diagram control's Serialize/Deserialize functions works just fine. It's just that when I use the GraphSource property I have no control over how the diagram gets created.
0
Alex Fidanov
Telerik team
answered on 29 May 2012, 11:16 AM
Hi,

 I think that in your scenario the new improvement for the IGraphSource would help you achieve what you want. You would not need to create two XML files to save the metadata for the shapes and the metadata for the your business objects. The new graph source would provide you a way to save your custom data into the serialziation (xml) string of the diagram itself. Basically, each shape would keep the information for its properties and the ones of its viewmodel in the same xml. The diagram would create a shape of the type that has been saved. If you save a custom shape, then a custom shape will be created when deserializing.

Currently, there is a workaround for this. The RadDiagram control behaves just like the intrinsic items controls and exposes similar methods which can be overriden. If you subclass the RadDiagram, you can override the container generation methods, for example:
IsXItsOwnContainer, GetXContainer, PrepareXContainer, etc.

Kind regards,
Alex Fidanov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Olivier
Top achievements
Rank 1
answered on 29 May 2012, 02:02 PM
Hello Matt,

I'm currently experimenting the RadDiagram control and I think I had the same issue. You can look at the GetShapeContainerForItemOverride and GetConnectionContainerForItemOverride methods of the RadDiagram Class. Maybe this is what you need in your scenario. 

Olivier
Tags
Diagram
Asked by
Nicolas
Top achievements
Rank 1
Answers by
Miro Miroslavov
Telerik team
Nicolas
Top achievements
Rank 1
Alex Fidanov
Telerik team
Matt
Top achievements
Rank 1
Olivier
Top achievements
Rank 1
Share this question
or