Posts

Showing posts from March, 2019

Xamarin Forms, with F# - Part 2, ReactiveUI

Next, I want to add ReactiveUI.Copy ProjectI am making a copy of my project folder and calling it FXamRx. I also open up Visual Studio, the solution, projects, and all namespaces to FXamRx.
Then build and run everything, to make sure that nothing has been broken. I have been using Reactive Extensions for a couple of months, and I have next to zero experience with F#. These are both experiments for me, so I have no idea if I am doing this the "Right Way". If anyone sees a better way anything can be done, please let me know. The main purpose of this is for me to explore and learn. ReactiveUI is an MVVM framework, based on Reactive Extensions.Add ReactiveUIRight click on the solution and select Manage NuGet Packages for Solution, Search for ReactiveUI.XamForms and add it to both projects.Create a ViewModelIn the Xamarin.Forms project create a code file called MyReactiveViewModel.fsOur ViewModel needs to inherit from ReactiveObject and IRoutableViewModel. It needs an IScre…

Xamarin Forms, with F#

xam-fsharp-01I wanted to give F# a “go” in a Xamarin project, but Visual Studio (at least on Windows) does not have a Xamarin Forms template for F#. This means that I will need to create it myself.
I am sure it will be possible, and I will use a C# project as a guide.I am in no way proficient in F#, but that is also because I have never really used it in a “real” project, and I would like to give it a good try.In this post, I am going to attempt to create just the outline of the project.Create a new projectIn Visual Studio, I am creating an F#, .Net Standard Class Library. This will become my Xamarin Forms library (called PCL before .Net Standard). I am naming my project Jon.FXam.I then want to add Xamarin.Forms from NuGet.Now I need to create my App “Class”, I can’t find any XAML for F#, so I will just have to try my best at coding it.Rename Library.fs to App.fs and set its content to:namespace Jon.FXam open Xamarin.Forms typeApp()=inheritApplication()It builds.Add an Android proje…