Back to API Reference
Class
MediaInputBehavior
abstract
Inherits:InputBehavior
Base for handling received media — a clipboard paste, a drag-and-drop, or a picker selection. All three arrive the same way (check Source when it matters). The hook is subscribed here — subclass and override OnImage / OnFiles (or OnMedia for full control over every format) to do whatever the app needs: upload, insert an inline object, write to disk. Return from an override to consume; otherwise it falls through to the text channels.
Remarks
File copies (a video, gif, or any file) arrive as references through
OnFiles — read each with ReadFile. Inline image data arrives through OnImage. Reading can prompt the user on iOS / Android / web; the hook only fires on an actual paste / drop / pick, which is the consent the platforms expect.protected Task<byte[]> ReadFileAsync()Off-main-thread variant of ReadFile — read a dropped video or large file without blocking the frame (upload flows).
