Platform-specific APIs.
See original GitHub issueThere are various APIs which are specific to a platform (i.e. have no corresponding APIs on other platforms) but would still be useful to be accessed from Avalonia.
One example of this which recently came up is NSWindowLevel
on macOS: other platforms don’t have an equivalent so it doesn’t make sense as a general API, but still it’s really useful in certain situations to be able to set this for a window.
One way of providing these APIs might be as attached properties, for example one could set:
<Window MacOS.WindowLevel="FloatingWindow">
Such a property would only have effect when running on macOS.
The main question with regards to such APIs, is in which assembly should they live?
So, a few questions to start the ball rolling:
- Is it a good idea to provide such APIs?
- Which APIs might be good candidates?
- Is the attached property idea a good one?
- Where should the APIs live?
Issue Analytics
- State:
- Created 4 months ago
- Reactions:11
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Connect to platform-specific APIs | Kotlin Documentation
This works for most Kotlin declarations, such as functions, classes, interfaces, enumerations, properties, and annotations. Expect/actual ...
Read more >Writing custom platform-specific code
Flutter uses a flexible system that allows you to call platform-specific APIs in a language that works directly with those APIs: Kotlin or...
Read more >Summary of Chapter 9. Platform-specific API calls - Xamarin
In this article. Preprocessing in the Shared Asset Project; Parallel classes in the Shared Asset Project; DependencyService and the Portable ...
Read more >Best API Platforms in 2023
Top 10 API Platforms · IBM API Connect · Postman · Stoplight · MuleSoft Anypoint Platform · WSO2 API Manager · Azure API...
Read more >Platform API vs Service API | Hackney API Playbook
Platform APIs is to provide all available data for a given domain (i.e. transactions) in a generic format. Service APIs should consume the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The support code can live where it wants to live, but the API should still be accessible when targeting
netstandard2.0
with onlyAvalonia
package referenced.Unrelated to this issue.
And you already have it in the SDK - ExcludeFromCurrentConfiguration. It can be done with simple msbuild condition. Like this one - https://github.com/AvaloniaUI/Avalonia/pull/9613/files#diff-f187e1f8a2658efbbfc23efe2c18a51c40156749cf078645534481518139779eR80-R102
Note, “linux” and “browser” branches will not work…because there are no targets for these platforms. Yet?
For XAML support you would need to exclude AvaloniaXaml entries as well, I suppose.
While it would be nice to have built in, we just can’t because how .NET SDK works and what target frameworks we have on our hands.