Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Interoperability of two nodes in the diagram (Read 1460 times)
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Interoperability of two nodes in the diagram
Mar 30th, 2020 at 6:49am
Print Post  
Hey, Lyubo Smiley
Nice to wait for your answer!

private void RibbonButton_Click_1(object sender, RoutedEventArgs e)
{
double newValue;
double x = 0;
double y = 0;
if (double.TryParse(textBoxX.Text, out newValue))
x = newValue;
if (double.TryParse(textBoxY.Text, out newValue))
y = newValue;
var newBounds = new Rect(x, y, imageNode.Bounds.Right, imageNode.Bounds.Bottom);
imageNode.SetBounds(newBounds, true, true);
imageNode.InvalidateVisual();
}

I use this button click event to move the imageNode to the position of (-50, -50). Could it be that the overlayNode is contained in the imageNode? The moving is unsuccessful. How to solve it? Is there any sample code?
  

3_30.png ( 951 KB | 113 Downloads )
3_30.png
Back to top
 
IP Logged
 
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Re: Interoperability of two nodes in the diagram
Reply #1 - Mar 30th, 2020 at 7:49am
Print Post  
Added:
  

3_30_3.png ( 394 KB | 112 Downloads )
3_30_3.png
3_30_4.png ( 190 KB | 114 Downloads )
3_30_4.png
Back to top
 
IP Logged
 
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Re: Interoperability of two nodes in the diagram
Reply #2 - Mar 30th, 2020 at 7:54am
Print Post  
Added:
When the coordinates are changed from (-50, -50) to (-30, -30), the size of the imageNode changes undesirably, resulting in a large gap between the image of the imageNode and the imageNode. All I want is a change of position. What is wrong with my code and what changes do I need to make?
  

3_30_5.png ( 385 KB | 114 Downloads )
3_30_5.png
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Interoperability of two nodes in the diagram
Reply #3 - Mar 30th, 2020 at 8:57am
Print Post  
Hi,

The Rect constructor accepts x, y, width and height values as arguments. So your code here:
Code
Select All
new Rect(x, y, imageNode.Bounds.Right, imageNode.Bounds.Bottom); 

is wrong. You need to pass imageNode.Bounds.Width and imageNode.Bounds.Height if you want to preserve the size of the node.

You can see the method signature via intellisense when typing or when hovering over it.

Regards,
Lyubo
MindFusion
  
Back to top
 
IP Logged
 
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Re: Interoperability of two nodes in the diagram
Reply #4 - Mar 30th, 2020 at 9:05am
Print Post  
Hey, Lyubo, you're right! Thank you so much. Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint