fabulous-dev / Fabulous

Declarative UI framework for cross-platform mobile & desktop apps, using MVU and F# functional programming
https://fabulous.dev
Apache License 2.0
1.15k stars 122 forks source link

Default UWP project doesn't build due to 'internal' modifier #773

Closed zakaluka closed 4 years ago

zakaluka commented 4 years ago

The default WPF project does not build because, in App.xaml.cs, the class is declared as follows:

  internal sealed partial class App : Application

This doesn't match the App declaration in the 'shared' project:

type App() as app =
  inherit Application()

Adding 'internal' to the F# type didn't work as it is being accessed from elsewhere and needs to be public. I was able to work around this by removing the internal modifier from the C# class. However, I'm not sure if that was the right thing to do.

TimLariviere commented 4 years ago

Did you create a C# WPF project and then added a Fabulous project?

The WPF project shouldn't extend the App class declared in the Fabulous project. In the WPF project, you only need to create an application class inheriting from System.Windows.Application that will bootstrap Xamarin.Forms and load the App class of the Fabulous project. All the rest is then handled in the Fabulous project.

See this example: https://github.com/fsprojects/Fabulous/blob/master/Fabulous.XamarinForms/samples/CounterApp/WPF/App.fs

(Note: You can have an F# project for WPF too through the templates: https://fsprojects.github.io/Fabulous/Fabulous.XamarinForms/index.html#getting-started)

zakaluka commented 4 years ago

@TimLariviere thank you for responding. Sorry for all the confusion (which I will elaborate below):

In short - I can't re-create it. As such, I'm closing this bug report.