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

ILauncher launch events and intercept #15673

Open
profix898 opened this issue May 10, 2024 · 0 comments
Open

ILauncher launch events and intercept #15673

profix898 opened this issue May 10, 2024 · 0 comments

Comments

@profix898
Copy link
Sponsor

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

It's great that we now have a cross-platform URI/file launcher (ILauncher) in Avalonia. However, I would like to add the ability

  1. to be notified by an event about the URI/file launch and
  2. to intercept the call and handle the URI/file myself

Use cases are situations where you want to either a) redirect an external Uri (e.g. to you app's website) to a view within your app or b) your app uses Uri-based navigation (to perform UI actions based on the user invoking a Uri path).
In principle, it would even allow rewriting the URI (before launching a platform browser).

Describe the solution you'd like

I would like to introduce a new event on ILauncher implementations that gets invoked when a Uri/file launch happens. The event arguments should carry information about the Uri/file and have a property to cancel the default invocation.

Describe alternatives you've considered

Previously I had a custom Hyperlink(button) and URI launcher implementation. Having the launcher in Avalonia directly means that there will be third-party controls using ILauncher. So it would be great to have some flexibility to intercept, rewrite or handle Uri/file launch calls.

Additional context

No response

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

No branches or pull requests

1 participant