I have a diagram that is part of a larger application. Data can be displayed on multiple views simultaneously. Selecting the data in one view should select it in all views. Thus there’s an external selection manager component that handles all of this notification.
What this means for my diagram is that I need some way of having the diagram both react to this external selection as well as publish it’s selection changes out to the selection manager. One approach would be to shove this information into my model classes (I’m deriving from GraphLinksModelNodeData and GraphLinksModelLinksData) and then simply bind Part.IsSelected up to the model. But this leads to a few questions:
-
How can I make this binding in XAML? For example, I see that I can make my own PartManager, override MakeLinkForData, and then create a binding in code at that point. However, I’d really prefer to have all my bindings in XAML. Is this possible through the LinkDataTemplate? Do I need to derive from Link (not clear how I’d create the binding in XAML)?
-
Is it a bad idea to store this information in the model? For example, I see that the ClickSelectingTool notes that it does not edit the model, but I’d be changing those tool semantics. I don’t know if this is an issue.
-
Is there a better way to approach this problem in GoXam? I don’t have a need to store the selection data in the model, it just seemed like a convenient place to which I could later data bind. However, this piece of data is not something which I need to serialize/deserialize. If I were to react to external selection events and not store this information, it’s not clear to me how I could easily go from a unique NodeKey value to a particular Part.