-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Implement TopLevel.Launcher #14320
Implement TopLevel.Launcher #14320
Conversation
You can test this PR using the following package version. |
You can test this PR using the following package version. |
You can test this PR using the following package version. |
Great. |
@workgroupengineering no, probably not now. If anything - we should support OpenURI and OpenFILE - https://github.com/flatpak/xdg-desktop-portal/blob/main/data/org.freedesktop.portal.OpenURI.xml. |
Ok, thanks I had already seen it. My proposal is a simple way to give those who use custom Linux distributions with DRM or FrameBuffer support the possibility to customize the behavior. I was thinking of something like this: return AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.WithLaunchUriAsync( async uri=>
{
...
return await Task.FromResult(false);
}) |
I can't say I am a fan of that. If it had to be done you would be better off somehow providing a custom implementation of |
This is great! I'll plan to resurrect the HyperlinkButton control and open a PR in a few weeks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does the pull request do?
Adds TopLevel.Launcher service to allow launching Uri and IStorageItem.
See https://github.com/AvaloniaUI/Avalonia/pull/14320/files#diff-dedbbea0fc7e00cbdde2962c6eb7ba6edc52d0af3894b74608e742000321963a for the public API changes.
How was the solution implemented (if it's not obvious)?
For desktop: simple Process shell execute.
For browser:
window.open
(only links).For mobile: copy of essentials launcher with adjustments.
Both macOS and Windows platforms can be improved by using more specific APIs, like WinRT Launcher API on Windows. But I am going to leave it outside of this PR scope.
Checklist
Fixed issues
Contributes to #7640
Fixes #13640