Nothing in the Northwoods.GoXam.Model namespace is a DependencyObject, so you cannot bind any of their property values.
We did think about defining DataProvider-like classes, but because most people should want to specify the particular model node data type (and link data type if GraphLinksModel) and because one cannot instantiate generic classes in XAML, we decided not to.
But, when I code the command feature in DiagramEnv, I’d like to know what are the selected node for example…
Then I haven’t find a way in my environnement to reach this information.
Well, I can’t separate design and model.
Before I change my code, could you tell me if I miss something.
As you have already discovered, models don’t really know anything about FrameworkElements such as Parts, so they can’t know about Part.IsSelected. This is particularly true when there might be multiple views (i.e. Diagrams) for a single model – if the notion of selection were in the model, everything would be confused.
That doesn’t mean you couldn’t put the concept of being selected in your model. But I would highly recommend against it.
All of the predefined commands are implemented by the CommandHandler class, which is part of a Diagram, not part of a model. If you are implementing your own commands, they really belong to your view or user-interface layer, not to your model and data. Your commands can be implemented in classes other than CommandHandler, but they do need to refer to Diagram and Part state.
Regarding the main topic, I think we can add Diagram.NodesSource and LinksSource dependency properties that will do what you originally asked for. (Of course, setting/binding the LinksSource property has no effect if the Diagram.Model isn’t an ILinksModel.)
Typically one will still create the model in code and assign it to the Diagram.Model property. If you define your own model class or use a predefined model class like UniversalGraphLinksModel, you will be able to assign the model in XAML. So that won’t change from v1.0.
And you have always been able to bind the Diagram.Model property, so that won’t change either.