Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Synchronisation between views. (Read 342 times)
DamianKey
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 2
Joined: Dec 17th, 2025
Synchronisation between views.
Dec 18th, 2025 at 9:03am
Print Post  
I have a simple application which has two tabs and same one model bound to both tabs.
In model there are two ShapeNodes, one DiagramLink and all that put to the DiagramView. One instance of model is bound to two DiagramView per each tab one. 
Problem: When I drag Node 2 on the Tab1 and switch to Tab2 it does not get updated. Namely, line gets updated but nodes remain in its origin position, until the moment I slightly scroll the view.
I tried to call DiagramView.InvalidateVisual() but no change. Can you provide some idea how to tackle this problem? In prior version of MindFusion (3.9.5) view was updated automatically.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: Synchronisation between views.
Reply #1 - Dec 18th, 2025 at 10:07am
Print Post  
We have reproduced. During mouse move handling the control calls an immediate Arrange on node's presenter for smoother update, but apparently that's ignored on inactive tabs (our developer guesses for any UIElement whose IsVisible returns false). So we'll add some checks for that to Invalidate instead of arrange immediately. For time being try this to work around the problem:

Code
Select All
void TabCtrl_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    var selectedTab = (TabItem)tabCtrl.SelectedItem;
    var selectedView = (DiagramView)selectedTab.Content;

    var presenter = selectedView.Template
        .FindName("PART_Presenter", selectedView) as DiagramPresenter;
    if (presenter != null)
    {
        foreach (UIElement child in presenter.Children)
            child.InvalidateMeasure();
    }
} 



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


I Love MindFusion!

Posts: 2
Joined: Dec 17th, 2025
Re: Synchronisation between views.
Reply #2 - Dec 19th, 2025 at 10:21am
Print Post  
Thank You.
I just checked the proposed solution and works well.
Thanks for a quick response.
Regards, Damian
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3435
Joined: Oct 19th, 2005
Re: Synchronisation between views.
Reply #3 - Dec 19th, 2025 at 11:15am
Print Post  
New build here should handle that scenario correctly -

https://www.nuget.org/packages/MindFusion.Diagramming.Wpf/4.2.2-beta3

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint