Refresh programmatically

Hi,

We made a custom Copy/Paste functionality for ours flowsheet.

1- We select these nodes and links from the tab A.

2- We copy /paste them into the same tab.

(Lets say we change the Y)

3- They stay on the same location so we don’t see any changes.

4- Now we go to the Tab B and come back to the tab A, we can see the flowsheet refreshed.

How can we call this refresh method programmatically?

Thanks you!

What custom copy and paste functionality did you implement?
Is there are reason you couldn’t use the standard CommandHandler.Copy and .Paste?

Also, are you using a standard TabControl or some other control?
If the latter, have you set Diagram.UnloadingClearsPartManager to false?

Hi,

pstjean posted for us because my account was not activated yet.

We overrided CanCopy/CanPaste and Copy/Paste methods in a class which is inherited from CommandHandler.

For the TabControl, it’s a TabControl which has its ItemSource bound to ObservableCollection because we are using WPF and MVVM.

I tried Diagram.UnloadingClearsPartManager to false and it doesn’t work.

That’s why we want to call a refresh method programmatically.

Does your overridden CommandHandler.Paste() method start and commit a transaction? If it doesn’t, it really should.

Yes it does, but the flowsheet has still no update.

That’s very odd. I don’t understand what is different about your Paste method that is causing the diagram not to update automatically.

I guess you are not using a Diagram.ClipboardPasted event to shift the copied (i.e. the selected) nodes?

Thank you, it works now.