on_pre_new

Function on_pre_new 

Source
pub fn on_pre_new(
    child: impl IntoUiNode,
    handler: Box<dyn FnMut(&CommandArgs) -> HandlerResult + Send>,
) -> UiNode
Expand description

P Preview on_new command.

§Preview

Preview event properties call the handler before the main event property and before the widget content, if you stop the propagation of a preview event the main event handler is not called.

§Async

You can use async event handlers with this property, note that only the code before the fist .await is preview, subsequent code runs in widget updates.

§Enabled

You can use the can_new context property to disable the command handle.