From slack discussion with @charlesroddie and @mydogisbox
The pre-release of Xamarin.WPF is just out. It seems to be usable with glitches here or there as you would expect. It has all the stock controls in Xamarin.Forms. There is almost no support in 3rd party controls at the moment. (edited)
Let's add a sample under https://github.com/fsprojects/Elmish.XamarinForms/tree/master/Samples/CounterApp
I'd like to also see WinForms and Mac nodes under there.
Here's a sample from @mydogisbox:
type CounterApp () as app =
inherit Application ()
let program = Program.mkProgram App.init App.update App.view
let runner =
program
|> Program.withConsoleTrace
|> Program.withDynamicView app
|> Program.run
type MainWindow() as this =
inherit FormsApplicationPage()
do Forms.Init()
do this.LoadApplication(new CounterApp())
[<STAThread>]
[<EntryPoint>]
do (new System.Windows.Application()).Run(MainWindow()) |> ignore
I was able to get a WPF sample working, but to do this, we have to upgrade Xamarin.Forms in all projects to last stable release 3.0.482510, what do you think about this?
The Android projects with last release work well.
I was able to get a WPF sample working, but to do this, we have to upgrade Xamarin.Forms in all projects to last stable release 3.0.482510, what do you think about this?
Seems sensible to me. We upgraded all the templates (apart from F#, I didn't have the time 馃槥 ) to XF 3.0
And with WinForms I haven't notice before, but the Aosoft's library has no Nuget package, we would have to do it another way. :cry:
I was able to get a WPF sample working, but to do this, we have to upgrade Xamarin.Forms in all projects to last stable release 3.0.482510, what do you think about this? The Android projects with last release work well.
Do you need to update the Xamarin.Forms.Core in the "neutral" group? That's the one we build Elmish.XamarinForms.dll against. I would prefer that keeps the lowest dependency possible, e.g. to allow us to use it with as many 3rd party components as possible. The Android, iOS and WPF projects (e.g. anroidapp group in pakt.dependencies) can all run with XF latest.
My understanding is that XF is binary compat, so this approach should work?
I was able to get a WPF sample working, but to do this, we have to upgrade Xamarin.Forms in all projects to last stable release 3.0.482510, what do you think about this? The Android projects with last release work well.
Could you send a PR for this so I can take a look? Thanks!
There it is: #56
But, if there is 2 versions of Xamarin.Forms in the same solution there is even a message warning about this in the build.
I added WPF to the AllControls sample without any material changes to other parts of the sample (including upgrading Xamarin.Forms in other projects). Some of the other projects don't build on my machine but considering I didn't change any of them I assume they continue to work.
I just added a MacOS version of the Elmish.Calculator. The code is almost identical to the iOS version.

Could we target UWP also? I know I'd have use for it.
Oh, I traced the trail of breadcrumbs to https://github.com/dotnet/corert/issues/5780, and can see that question might be premature.
Please add that @bugQ . Getting this running is easy, except release to store which is in testing.
You can add a UWP project, min Windows version FCU. Put xmlns:forms="using:Xamarin.Forms.Platform.UWP" inside <Page> tags in MainPage.xaml. Put Xamarin.Forms.Forms.Init(e); after the rootFrame instructions in App.xaml.cs. Installing the relevant nuget packages. Put LoadApplication(new AppName.App()); after this.InitializeComponent(); in MainPage.xaml.cs, after adding the appropriate project reference.
You can also copy over from a C# Xamarin.Forms template if you prefer.
You can then run in debug mode, and test in release mode using the instructions in the thread you linked.
You'll need to do this for each of the samples.
Thanks for the encouragement and instructions, @charlesroddie. After referencing sample Xamarin.UWP projects and figuring out that there was one missing step (changing the class of the <Page> element to <forms:WindowsPage>), I was able to get something working, although it occasionally throws an exception on the Xamarin.Forms.Forms.Init(e); line, saying "More data is available." It sounds like this is a Xamarin.UWP bug, probably a failure to loop and read all available data somewhere. I'll track that down and perhaps file a report later, but it doesn't seem to have anything to do with this project.
So, basically, everything is set for UWP, too, at least for local testing. I'll submit a PR shortly.
Thanks @charlesroddie, @bugQ. It works
oh, I actually completely spaced this one. thank @TimLariviere 馃槄
But what about integration with UWP Frame? Can it be used with Fabulous to switch pages?
@xperiandri Do you mean navigating from page to page inside the app, or embedding a page in another one?
If it's the first, then NavigationPage does it.
If it's the second, I don't think Xamarin.Forms provides a control which uses Frame behind the scenes, it's not a concept that can be found on other platforms.
If you specifically need to use UWP's Frame control in Fabulous, then you can always implement your own Fabulous extension.
https://fsprojects.github.io/Fabulous/views-extending.html
Most helpful comment
Thanks for the encouragement and instructions, @charlesroddie. After referencing sample Xamarin.UWP projects and figuring out that there was one missing step (changing the class of the
<Page>element to<forms:WindowsPage>), I was able to get something working, although it occasionally throws an exception on theXamarin.Forms.Forms.Init(e);line, saying "More data is available." It sounds like this is a Xamarin.UWP bug, probably a failure to loop and read all available data somewhere. I'll track that down and perhaps file a report later, but it doesn't seem to have anything to do with this project.So, basically, everything is set for UWP, too, at least for local testing. I'll submit a PR shortly.