AvaloniaUI / avalonia-dotnet-templates

Avalonia Templates for `dotnet new`

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Avalonia xPlat Library template

workgroupengineering opened this issue · comments

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

Guidelines for developing an Avalonia xPlat library that supports trimming and calls the native platforms library.

Describe the solution you'd like

Create simple template project

Describe alternatives you've considered

No response

Additional context

No response

That's a normal .NET library with Avalonia reference.
To add extra platforms, you either keep everything the same and PInvoke native APIs, or add a native platform target, like "net6.0-android". Not sure what can be/should be done here in templates.

I would like to try porting CameraView from Xamarin.CommunityToolkit to Avalonia.

I'd like a guideline of how to do this to avoid future brecking changes with Avalonia.

For example you could use a library with tagrt framework netstandard or a multi targets library.

If there was a template there would be no such doubts.