Skip to main content

ICompositionCustomVisualHandler

Trait ICompositionCustomVisualHandler 

Source
pub trait ICompositionCustomVisualHandler: 'static {
    // Required methods
    fn handler_base(&self) -> &CompositionCustomVisualHandler;
    fn on_render(&self, drawing_context: &mut ImmediateDrawingContext<'_>);

    // Provided methods
    fn on_message(&self, _message: Arc<dyn Any + Send + Sync>) { ... }
    fn on_animation_frame_update(&self) { ... }
    fn get_render_bounds(&self) -> Rect { ... }
}
Expand description

The overridable members of a custom visual handler. A handler class embeds a CompositionCustomVisualHandler and implements this trait.

Required Methods§

Source

fn handler_base(&self) -> &CompositionCustomVisualHandler

The embedded handler state.

Source

fn on_render(&self, drawing_context: &mut ImmediateDrawingContext<'_>)

Provided Methods§

Source

fn on_message(&self, _message: Arc<dyn Any + Send + Sync>)

A message sent with CompositionCustomVisual::send_handler_message.

Source

fn on_animation_frame_update(&self)

Source

fn get_render_bounds(&self) -> Rect

The bounds of what the handler draws; the effective size of the visual by default.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§