Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Modifying selected items issue (Read 1125 times)
Patryk
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 25
Joined: Jun 13th, 2025
Modifying selected items issue
Aug 1st, 2025 at 7:00am
Print Post  
Hi,

There is a virtual method which I am overriding:

protected override void OnNodeModifying(NodeValidationEventArgs e){}

How to make it available if only one item is selected? I agree it works for more than one item selected.


Of course I am updating the selection class and the active item but still I cant get this event to be raised once moving a single element. More than one is needed.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3520
Joined: Oct 19th, 2005
Re: Modifying selected items issue
Reply #1 - Aug 1st, 2025 at 7:43am
Print Post  
Hi,

That's called for a single node too in my test:

Code
Select All
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();

        diagramView.Diagram = new DiagramEx();
    }
}

class DiagramEx : Diagram
{
    protected override void OnNodeModifying(NodeValidationEventArgs e)
    {
        Debug.WriteLine("OnNodeModifying");
        base.OnNodeModifying(e);
    }
} 



The method's purpose is to raise validation event, and the control might not call it if operation already considered rejected due to other factors (e.g. NodeConstraints property values, or previous rejected validations, say from container/child -related events).

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


tech.support

Posts: 3520
Joined: Oct 19th, 2005
Re: Modifying selected items issue
Reply #2 - Aug 1st, 2025 at 8:04am
Print Post  
If your application subclasses DiagramNode and overrides its AllowModify method, make sure it also calls base method for the event to be raised.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint