Skip to content

Add ClipboardChanged event #21992

Description

@amwx

Is your feature request related to a problem? Please describe.

Avalonia's clipboard API currently does not have a way to detect when changes to the clipboard occur, thus refreshing things like Commands requires alternative ways to refresh them or hooking the system clipboard yourself.

Describe the solution you'd like

public interface IClipboard
{
+    event EventHandler ClipboardChanged;
{

Describe alternatives you've considered

No response

Additional context

At least on Windows it's easy to get notifications. Register for clipboard format changes via AddClipboardFormatListener(HWND) then listen for WM_CLIPBOARDUPDATE. Not sure about other platforms.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions