Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Window): Allow to persist content of Clipboard after App close #16778

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

workgroupengineering
Copy link
Contributor

@workgroupengineering workgroupengineering commented Aug 22, 2024

What does the pull request do?

Add FlushAsync method

What is the current behavior?

It is not supported by any platform

What is the updated/expected behavior with this PR?

Permanently adds data to the Clipboard on the Windows platform, does nothing on other platforms.

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Part of

#15411

@workgroupengineering workgroupengineering force-pushed the feature/Clip_SetDataObject_Persistence branch from fd72ec4 to 04b4e0c Compare August 23, 2024 07:35
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0051445-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@workgroupengineering workgroupengineering marked this pull request as ready for review August 23, 2024 08:02
/// <param name="data">A data object (an object that implements <see cref="IDataObject"/>) to place on the system Clipboard.</param>
/// <param name="copy"><c>true</c> to leave the data on the system Clipboard when the application exits; false to clear the data from the system Clipboard when the application exits.</param>
/// <exception cref="System.ArgumentNullException"><paramref name="data"/> is null.</exception>
Task SetDataObjectAsync(IDataObject data, bool copy);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think correct API would be Clipboard.FlushAsync() which can be more reliably supported on other platforms without unnecessary throwing an exception.

Especially since we can't guarantee actual copying (or even less - not copying dataobject) on all platforms.

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0052298-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants