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 On new command.

Receives NEW_CMD command events scoped on the widget. The command parameter can be the new item type identifier.

§Command

This property will subscribe to the NEW_CMD command scoped on the widget. If set on the Window! root widget it will also subscribe to the command scoped on the window.

The command handle is enabled by default and can be disabled using the contextual property can_new .

§Route

This event property uses the preview route, that is, the handler is called before the children widget handlers and before the $pn_ident handlers.