I have mocked up a quick example based on various part projects I've seen on the forum, but I've merged it with the my data objects (simplified versions) I have in my main project. I have two problems, which I think are related.
1) When I add an item to the diagram through adding a new object into my collection: the object is added and appears on the diagram canvas, but can't be interacted with
2) When I drag from the stencil there is no trigger of the "ItemAdded" event I've seen in the examples
I've uploaded the example and your help would be appreciated.
Reported issue |
Response | |
When I add an item to the diagram through adding a new object into my collection: the object is added and appears on the diagram canvas but can't be interacted with. |
We can reproduce the reported issue. The root cause of the reported issue is implementing the INotifyPropertyChanged for the UIControl class. It restricts the property changed notifications of its base class “NodeViewModel” . So, the interaction with node is dis abled.
Solution:
Please remove the INotifyProperyChanged from the UIControl class.
Additional Information Required:
Could you please confirm us whether your requirement is to implement custom property changed notification in UIControl? | |
When I drag from the stencil there is no trigger of the "ItemAdded" event I've seen in the examples |
We can reproduce this reported issue. This is the sample side issue. Please don’t use or set NodeViewModel as content of the Symbol/NodeViewModel. Since, we are using serialization and deserialization approach for drag and drop the element from stencil.
We can host the NodeViewModel as symbol instead of ISymbol to the stencil. Based on that , we have modified the sample.
Sample Changes:
We have created a custom class named as UIControlContent and assigned this as content of the NodeViewModel.
Also, Content and ContentTemplate cannot be serialized while drag and drop. So, we have achieved this(content) by using custom property ContentName and initialized the ContentTemplate in the ItemAddedEvent.
We have set UnitWidth and UnitHeight for UIControl in its constructor.
Additional Information:
We need to add DataContract and DataMember attributes for new serializable custom class and its properties.
|