AvaloniaUI / avalonia-dotnet-templates

Avalonia Templates for `dotnet new`
MIT License
488 stars 84 forks source link

Avalonia xPlat Library template #227

Open workgroupengineering opened 1 year ago

workgroupengineering commented 1 year ago

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

maxkatz6 commented 1 year ago

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.

workgroupengineering commented 1 year ago

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.