I have been trying to implement RadDiagram in an MVVM way, using Caliburn.Micro and I'm coming to the conclusion that this just doesn't fit well with the Telerik controls architecture. I would love it if someone can prove me wrong.
I've looked at every sample app from these forums and Telerik's help, often confused at the reams of <style> code I have to wade through to make sense of anything, and I've still not found a simple answer to my issues.
The following are my goals:
- Use UserControls, not Styles, to implement my shapes
- I like that the UserControls can easily be designed in Blend or Visual Studio
- I like that the visual implementation is modular within each UserControl
- unless someone can propose an elegant, organized solution using styles/ResourceDictionaries
- Use MVVM architecture and Caliburn.Micro to locate views for the viewmodels (viewmodel-first approach)
- All the examples of MVVM implementation I've seen seem clunky, but maybe I'm just not seeing the forest through the trees.
- Have multiple custom shapes on a RadDiagram
- Unless I'm missing something, it appears that you must override the Template for type:RadDiagramShape to show your custom control visual. I don't like having this xaml mixed in with the main RadDiagram xaml. I'd like to separate it into the custom shape xaml for clarity.
- it also appears that I need to create a custom RadDiagram control and override IsItemItsOwnShapeContainerOverride (etc),
instantiating each custom shape depending on the type of the object passed in.
At this point, I'm so confused by the myriad of examples of ways to implement things, that I'm looking for a very simple example of complete view/viewmodel separation (no code behind, unless just to set the viewmodel, if not using an MVVM framework), multiple custom shapes support, well-organized xaml/code into meaningful, logical files that can be designed in VS or Blend.
I'm also willing to admit that maybe I'm just missing something that brings everything together nicely. I hope someone can point me in the right direction.