Output from a method or event - C # / WPF

2

I am using a return to be able to exit the textEstado_Validate event. The problem is that when it exits this event, it enters textEstado_KeyDown . How can I prevent it from going into any other methods and events?

private void textEstado_Validate(object sender, ValidationEventArgs e)
{
    Ação...

    return;
}

private void textEstado_KeyDown(object sender, KeyEventArgs e)
{
    Ação...
}

Is there a command for this?

Text is a TextEdit, component of DevExpress

    
asked by anonymous 03.02.2016 / 19:43

1 answer

1

You can use the Handled property of ValidationEventArgs .

This will cause the event to stop propagating.

private void textEstado_Validate(object sender, ValidationEventArgs e)
{
    //Ação...

    e.Handled = true;
    return;
}

See the DevExpress % co documentation for DevExpress

    
03.02.2016 / 20:04