Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic InvalidateVisual() on DiagramLink not working (Read 503 times)
Joel D.
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 40
Location: Seattle
Joined: Feb 6th, 2017
InvalidateVisual() on DiagramLink not working
Jun 19th, 2024 at 1:23am
Print Post  
I'm in the process of upgrading from 3.5 to 4.1.

I subscribe to PreviewKeyDown (now on the DiagramView, as opposed to my Diagram like before), and call InvalidateVisual() on the link currently being drawn (which I get by using diagram.Interaction?.CurrentItem). I'm also subscribed to my Diagram's DrawLink event.

When I'm in the middle of drawing a link and the mouse moves, the DrawLink event handler is called.  But if the mouse is stationary (with mouse still pressed down) and I tap a key, my PreviewKeyDown event handler runs, but after InvalidateVisual() is called, the DrawLink event handler does not run.

Any ideas as to why DrawLink is not running?

Also, I've noticed the tooltips when mousing over a DiagramNode show up with no delay, while in 3.5, there was the typical system delay. Is there a global way on the Diagram to set the delay back to normal? Or do I need to set the delay on each Node when it has been created?

Thanks!
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3244
Joined: Oct 19th, 2005
Re: InvalidateVisual() on DiagramLink not working
Reply #1 - Jun 19th, 2024 at 7:09am
Print Post  
If you have moved to DiagramView, items are not placed directly inside its visual tree, so InvalidateVisual method of base UIElement has no effect. Call link.Repaint instead, to invalidate the link presenter object that is actually added as a child to the view. We'll be dropping UIElement base for next major release along with support for using Diagram directly as a control, but will be keeping that in 4* versions for users that can't migrate that fast Wink

We'll have in mind a TooltipDelay property for next small release. At this time you could try showing a delayed tooltip from CreateToolTipControl event handler.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3244
Joined: Oct 19th, 2005
Re: InvalidateVisual() on DiagramLink not working
Reply #2 - Jun 20th, 2024 at 8:31am
Print Post  
This build adds ToolTipDelay property to DiagramView:

https://mindfusion.eu/_beta/wpfdiag411.zip

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Joel D.
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 40
Location: Seattle
Joined: Feb 6th, 2017
Re: InvalidateVisual() on DiagramLink not working
Reply #3 - Jun 20th, 2024 at 5:40pm
Print Post  
Cool, thanks! I'll give it a try.

Calling Repaint() worked; so thanks for that, as well.
  
Back to top
 
IP Logged
 
Joel D.
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 40
Location: Seattle
Joined: Feb 6th, 2017
Re: InvalidateVisual() on DiagramLink not working
Reply #4 - Aug 12th, 2024 at 11:07pm
Print Post  
Hello Slavcho.

On the topic of tooltips again, they get stuck open for me if the mouse leaves the diagram without first hovering over a blank part of the diagram first. As in, if the DiagramView's scrollbars are visible, and I've scrolled so that a node is partly out of view, I can mouse over the visible part of the node to get the tooltip to appear, and then if I move the mouse off the diagram without going to a blank part first, the tooltip flashes and appears wherever I stopped moving the mouse on another part of my application.  And then the tooltip is stuck open until move the mouse back onto the diagram.

Are you seeing this behaviour as well?

Thanks,
Joel.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3244
Joined: Oct 19th, 2005
Re: InvalidateVisual() on DiagramLink not working
Reply #5 - Aug 13th, 2024 at 10:21am
Print Post  
Hi Joel,

New build here closes the tooltip from MouseLeave event -

https://mindfusion.eu/_beta/wpfdiag412.zip

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Joel D.
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 40
Location: Seattle
Joined: Feb 6th, 2017
Re: InvalidateVisual() on DiagramLink not working
Reply #6 - Aug 13th, 2024 at 7:41pm
Print Post  
Unfortunately that doesn't seem to have fixed it. I uninstalled the MindFusion NuGet package, made sure all references were gone, then I copied in the DLLs from the zip and added them as references. So hopefully I did that part right. But I'm still getting the issue with the tooltips getting stuck on.

I will upload an animated GIF of what's happening. I'm only showing a small portion of the application, but you can see the diagram with a TemplatedNode (the blue box that says Output and has a speaker icon), and when I move the mouse outside of the diagram, the tooltip reappears. Even if I move the mouse off the TemplatedNode before the tooltip appears, it still appears. Like as if the timer for the initial delay isn't getting turned off when the mouse leaves the node or the diagram.
« Last Edit: Aug 14th, 2024 at 10:49pm by Joel D. »  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3244
Joined: Oct 19th, 2005
Re: InvalidateVisual() on DiagramLink not working
Reply #7 - Aug 14th, 2024 at 10:51am
Print Post  
  
Back to top
 
IP Logged
 
Joel D.
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 40
Location: Seattle
Joined: Feb 6th, 2017
Re: InvalidateVisual() on DiagramLink not working
Reply #8 - Aug 14th, 2024 at 10:49pm
Print Post  
Works now.  Thanks!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint