8

Distributed Memory: F# and OpenSilver -- first steps

 3 years ago
source link: https://stevegilham.blogspot.com/2021/03/f-and-opensilver-first-steps.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

F# and OpenSilver -- first steps

This set of lab notes turned into a series of 3 posts.

Many years ago, I made a series of posts experimenting with F# (then still in preview) and Silverlight

F# CTP and Silverlight 2F# CTP and Silverlight 2 and XAML F# October CTP and Silverlight 3.0 F# and Silverlight 3 addendum

documenting some of the hacks required to get it to work. Now, more than a decade later, WASM is the new in-browser hotness, with many approaches to getting your non-JS code to run in browser.

One of these is OpenSilver, which is intended as a near as possible drop-in replacement for Silverlight. Like the original, it assumes C# and XAML with code-behind first, but let's see what we can do about that...

Assuming you have OpenSilver set up, then the equivalent of the first post above is relatively simple. Make a new OpenSilver application solution, then replace the actual application project with a new netstandard2.0 F# library (in the solution and as a project reference in the two helper projects). Add OpenSilver as a nuget package to the F# project, then paste in the code from the same first working example to replace the initial stub code. In the .Browser project, fix the type of the App class -- new SilverLightFSharp.MyApp(); -- and then run whichever helper.

It should look like this :--

in the simulator after you click the button.

Next -- Adding XAML, initial attempts


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK