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§
Sourcefn handler_base(&self) -> &CompositionCustomVisualHandler
fn handler_base(&self) -> &CompositionCustomVisualHandler
The embedded handler state.
fn on_render(&self, drawing_context: &mut ImmediateDrawingContext<'_>)
Provided Methods§
Sourcefn on_message(&self, _message: Arc<dyn Any + Send + Sync>)
fn on_message(&self, _message: Arc<dyn Any + Send + Sync>)
A message sent with CompositionCustomVisual::send_handler_message.
fn on_animation_frame_update(&self)
Sourcefn get_render_bounds(&self) -> Rect
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".