Refresh problem

Hi,

I have a problem when I try to add a link that is connected to a LabelNode(Black Links). The problem is that sometimes(not all the time) when I add the link it looks like the layout does not refresh and the link does not appear(Picture 1), but when I move something in the diagram the link is displayed(Picture 2). It's like a refresh is not done.
Picture 1
Picture 2
Thank you

The first thing I always ask is whether you have made all model changes within a transaction?

Yes, all model changes are done within transactions. What seems curious is when we change the size of the StreamNode to 15x15px, the bug doesn’t appears, but if the StreamNode size is 1x1px up to 4x4px, the bug appears.

Forget this part of my last message:

"What seems curious is when we change the size of the StreamNode to 15x15px, the bug doesn't appears, but if the StreamNode size is 1x1px up to 4x4px, the bug appears."
It's not true. It was for another bug. Sorry.

You could try explicitly calling Remeasure() on the Nodes corresponding to your StreamNodes.

That doesn’t seem to work, the black link still doesn’t appear. This problem must be somehow related to a refresh that isn’t done because when I move anything or click something in the diagram the link appears.

Nodes might not appear also because their Location/Position is (NaN,NaN).
But a transaction will make sure that all nodes have positions.
Links might not appear if one or both of the nodes that they connect do not have positions.

<SPAN =“hps” closure_uid_4itimy=“4006”>I forgot to <SPAN =“hps” closure_uid_4itimy=“4007”>mention something <SPAN =“hps” closure_uid_4itimy=“4008”>very important, <SPAN =“hps” closure_uid_4itimy=“4010”>the layout <SPAN =“hps” closure_uid_4itimy=“4011”>I use now <SPAN =“hps” closure_uid_4itimy=“4012”>is one that <SPAN =“hps” closure_uid_4itimy=“4013”>has been coded <SPAN =“hps” closure_uid_4itimy=“4014”>by me <SPAN =“hps” closure_uid_4itimy=“4015”>by inheriting <SPAN =“hps” closure_uid_4itimy=“4016”>LayeredDigraphLayout. <SPAN =“hps” closure_uid_4itimy=“4018”>I have <SPAN =“hps” closure_uid_4itimy=“4019”>completely redefined <SPAN =“hps” closure_uid_4itimy=“4020”>the method <SPAN =“hps” closure_uid_4itimy=“4021”>DoLayout <SPAN =“hps” closure_uid_4itimy=“4022”>and <SPAN =“hps” closure_uid_4itimy=“4023”>I place <SPAN =“hps” closure_uid_4itimy=“4024”>the <SPAN =“hps” closure_uid_4itimy=“4025”>nodes myself <SPAN =“hps” closure_uid_4itimy=“4026”>except the <SPAN =“hps” closure_uid_4itimy=“4027”>nodes <SPAN =“hps” closure_uid_4itimy=“4028”>in the <SPAN =“hps” closure_uid_4itimy=“4029”>labelnode <SPAN =“hps” closure_uid_4itimy=“4030”>links. <SPAN =“hps” closure_uid_4itimy=“4032”>The latter <SPAN =“hps” closure_uid_4itimy=“4033”>I <SPAN =“hps” closure_uid_4itimy=“4034”>do not touch it. <SPAN =“hps” closure_uid_4itimy=“4036”>This bug <SPAN =“hps” closure_uid_4itimy=“4037”>happens <SPAN =“hps” closure_uid_4itimy=“4038”>only <SPAN =“hps” closure_uid_4itimy=“4039”>some <SPAN =“hps” closure_uid_4itimy=“4040”>times. The route used is also defined by me.

<SPAN =“hps” closure_uid_4itimy=“4042”>Should <SPAN =“hps” closure_uid_4itimy=“4043”>I still try to position the labelnodes? What makes me confused is that the black links connected to the label nodes sometimes work and sometimes don`t.

When I use only the LayeredDigraphLayout, it seems to work perfectly. Is there something I have forgotten to do when I coded my dolayouy method?

It’s hard for me to say what you might have forgotten.
I would recommend inheriting from DiagramLayout – that might reduce the chances that existing LayeredDigraphLayout stuff might be interfering somehow.
(Although I can’t think of how it might be right now.)

I have another problem related to links disappearing. I think it isn’t related at all to my last problem. This time, I know that when I set the node width to higher than 4 everything works fine, but when I try to set the nodes width at 0.1 or 1 some links start to disappear. These links are not linked to a labelnode like the black ones.

Pic 1
Pic 2

That’s very odd – I’ve never heard of anything like that. I’m sorry, but I don’t know how to help you debug this.
Are there any warnings or error messages in the trace listener output? (The Output window in Visual Studio.)

You might want to look at the FrameworkElements in the debugger.
What is the Visibility of a Link that has disappeared? What are its Part.Bounds?
Are all of the nodes actually visible – especially those that are connected by disappearing links?
Are their Part.Bounds correct?