awesome-inc / FontAwesome.Sharp

A library for using Font Awesome in WPF & Windows Forms applications
Apache License 2.0
376 stars 87 forks source link

Separate `FontAwesome.Sharp` into core and Enums. #77

Closed jhm-ciberman closed 2 years ago

jhm-ciberman commented 2 years ago

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

In my WPF app, I have two main layers, the "core" layer (Models, Services, ViewModels) and the WPF layer (Views) separated in two packages. My core layer targets netstandard, and my WPF layer targets net5-windows. I use the enums of fontawesome to describe which icons to use in each viewmodel (as described in the FAQ). Nuget complains with NU1701 saying that the package is not fully compatible with netstandard. That is true, but I only want to use the enums from the package. I currently made a nasty hack to supress the warning:

<PackageReference Include="FontAwesome.Sharp" Version="5.15.3" NoWarn="NU1701" />

Describe the solution you'd like

It would be nice to have FontAwesome.Sharp.Enums or FontAwesome.Sharp.Data or something like that in a separate package so you could easily use in a platform independent way.

Describe alternatives you've considered

My current solution is to suppress NU1701 for that package. It's not a big deal, but it would be nice to have the "data" and "implementation" part separated. I wouldn't get mad if you consider this as a no. 😅

mkoertgen commented 2 years ago

Hi @jhm-ciberman ,

I see. Yes, it maybe worthwhile to reuse the enums in a standard way. I wonder if there would be a use case to think where the core-package could be used in netstandard-project. Maybe a generator could use the enums to generate WPF apps?

jhm-ciberman commented 2 years ago

Now you mention it, yeah, it doesn't make much sense to have the core package as a Net standard project. I only did it as a way to enforce not leaking any WPF or view related class into the ViewModel layer and to have the concerns separated.

I think I should change the target of my core package to net5 and stop worrying.

Btw, thanks for such amazing library. The app we are developing looks beautiful thanks to FontAwesome.Sharp ♥️