Thanks for your reply,
[quote]First, the model type should probably be GraphLinksModel, since port identifiers are best handled as strings.[/quote]
Does that mean that long is not supported? What means best handled? I've changed the type to string and Model is still not bound properly to the Diagram.
[quote]Second, you might as well be more specific about the type of your view model's Model property, to be GraphLinksModel instead of the more general IDiagramModel.[/quote]
According to documentation Model property type of the Diagram is IDiagramModel so, as I understand, the only gain here is to simplify using Diagram on the vm side. It doesn't affect Model binding, which fails even if I change the type.
[quote]Third, in that Model setter you should check whether the value has actually changed before deciding to call OnPropertyChanged. You aren't passing the property name either, I notice.[/quote]
I probably should be more specific on this one so here is base implementation:
[code] protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
var handler = PropertyChanged;
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
Still - even if getter is fired diagram property doesn't change and has its default value. What about OneWayToSourceBinding firing setter with null value I mentioned?
[quote]Fourth, I think there is a conflict between your binding both Diagram.NodesSource and Diagram.Model.[/quote]
Because of Model binding fail binding to NodesSource and LinksSource is my only option so far to get diagram to show anything at all. I've tried to remove binding to both sources leaving only Model binding and it still fails.
My last try was:
public class LogicDiagram : Diagram
PartManager = new LogicDiagramPartManager();
Model = new LogicDiagramModel();
and using this class in xaml with Model binding to vm. Although Diagram having Model property set the binding still fails firing vm setter with null value.
Please do share any more suggestions you might have especially on the Model dependancy property and why might its setter fail.