Introducing OpenSilver 2.1: F# Meets XAML for Advanced Web App Development

OpenSilver 2.1 Logo

February 6, 2024

Dear .NET community,

Today, we’re thrilled to announce the release of OpenSilver 2.1!

This latest version represents a significant update to the OpenSilver platform, introducing support for F#. This development combines the strengths of functional programming with the power of XAML, enhancing the creation of rich and complex web applications.

But OpenSilver 2.1 isn’t just about adding F# support.

We’re also pleased to report the successful migration of the original “Silverlight Toolkit Samples” app by Microsoft with almost no changes to the code. You can now experience it live in your browser—NO PLUGIN REQUIRED—at: https://opensilver.net/gallery/

Image

As highlighted in the screenshot above, OpenSilver now supports theming, offering 12 themes to choose from. These themes, ported from the Silverlight toolkit, are fully customizable:

The enhanced Gallery page features:

  • An expanded Showcase, now boasting over 100 small F# samples,
  • An open-source sample CRM, serving as a perfect starting point for the development of your line-of-business apps,
  • And a preview of a 3D and VR/AR web app created with OpenSilver (via XR#), utilizing .NET and XAML:

We’ve implemented numerous smaller enhancements as well, including:

  • A revamped animation system that mirrors Silverlight’s capabilities,
  • A host of new controls,
  • The ability for UIElement.Clip to use any Geometry,
  • Enhanced performance,
  • And more.

The full changelog is available at the end of this page.

Why F#?

The integration of F# in OpenSilver 2.1 bridges the gap between functional programming and the development of rich, interactive web UIs. This unique combination allows developers to enjoy the benefits of both worlds: the expressive and concise syntax of F#, and the powerful, declarative nature of XAML for UI design.

This step forward redefines the construction of web applications, introducing a new paradigm that emphasizes code readability, maintainability, and efficiency.

Tight Integration

Developers can seamlessly use XAML files, such as “App.xaml” and “MainPage.xaml”, alongside F# code-behind files, like “App.xaml.fs” and “MainPage.xaml.fs”, within a single project.

The development experience mirrors that of Silverlight, WPF, MAUI, and other XAML-based technologies, with the significant advantage that the resulting applications are cross-platform and cross-browser compatible.

Code Once, Run Everywhere

OpenSilver applications are compatible across all modern browsers, including Edge, Chrome, Firefox, and Safari, without the need for any plugins. Additionally, these applications can be packaged as executables for deployment outside the browser and for submission to app stores.

This aligns with Microsoft Silverlight’s original goal: to facilitate the swift creation of enterprise-grade applications that are both cross-platform and cross-browser.

Getting Started

The first step is to download and install the Visual Studio Extension (VSIX), which features the new Project Templates for Visual Studio 2022: Download Link

Next, open the “New Project” dialog in Visual Studio to create a new F#/XAML-based OpenSilver project:

Here’s an overview of the new solution structure:

The project ending with the “.Browser” suffix is designed for running your application in the browser. Internally, it’s configured as an “ASP.NET Blazor WebAssembly” project, simplifying deployment significantly. Optionally, you can utilize the “Publish to folder” feature of Visual Studio to generate static files (HTML, WASM, JS, CSS) that can be deployed effortlessly to any hosting environment.

The project labeled with the “.Simulator” suffix enables you to debug your F#+XAML application within the .NET Framework or .NET Core context. This allows you to leverage the same powerful debugging capabilities typical of desktop applications, such as shifting execution to a different line, executing commands in the immediate window, employing profilers, and even integrating third-party tools like DotMemory for efficient detection of memory leaks in your application.

Learning: Explore the F# / XAML Showcase

We have curated an extensive “OpenSilver Showcase,” comprising about 100 small samples that demonstrate the practical use of F# in conjunction with XAML in OpenSilver projects.

Discover this collection on the Gallery page.

Each sample is presented with an online demo, offering a real-time glimpse into its functionality, accompanied by a “view source” feature. This allows for a straightforward understanding of the associated F# and XAML source code.

For each XAML example, you’ll find code-behind in C#, VB.NET, and F#. Make sure to click on the .fs file to explore the F# sample:

If you’re interested, you can also access the entire source code of the Showcase app using Visual Studio 2022 and run it directly from the code. To do this, clone the Showcase repo on GitHub, open the .SLN file, unload the C# and VB.NET projects (reopening the solution if necessary), and start the project “OpenSilver.Samples.Showcase” found under the F# solution folder.

For additional learning materials, consult the OpenSilver documentation and the original Microsoft Silverlight documentation.

Looking Ahead: What’s Next for OpenSilver?

Our journey doesn’t stop with version 2.1. The roadmap for OpenSilver is filled with exciting developments.

In the near term, we’re focusing on introducing a WYSIWYG XAML designer with drag-and-drop functionality, simplifying UI creation and making it more accessible. We’re also planning to extend support for additional WPF features, integrate XAML Hot Reload, and incorporate LightSwitch support.

Integration with .NET MAUI is on the horizon, which will broaden the scope for creating hybrid applications that utilize native platform APIs and simplify the deployment of applications across various platforms.

We are also committed to enhancing the developer support ecosystem, with new documentation on the way and expanded development support for macOS, VSCode, and Rider. Additionally, we’re reviving the beloved Silverlight PivotViewer control and venturing into support for the development of 3D and Mixed Reality applications (see XR#), opening up a new universe of possibilities for developers.

Most of these upcoming features will be compatible with F#.

Join Our Growing Community

The release of OpenSilver 2.1 with F# support is a significant step forward, but it’s just the beginning. We’re excited about the future and invite you to join our growing community of developers, designers, and technology enthusiasts. Together, we can explore new possibilities, share ideas, and create amazing web applications that push the envelope of what’s possible on the web.

Stay tuned for more updates, and thank you for being a part of our journey.

Warm Regards,

The OpenSilver Team

Play Video

Previous release: OpenSilver 2.0

If you missed the announcement for our previous release (version 2.0), you can catch up through the links provided below:

Previous release: OpenSilver 2.0

If you missed the announcement for our previous release (version 2.0), you can catch up through the links provided below:

Change Log of OpenSilver 2.1

Here is what's new since version 2.0:

  • F# Support
  • 100% Compatibility with the 'Silverlight Toolkit', and the Microsoft Samples app has now been successfully migrated.
  • Introduction of themes to customize the appearance of applications.
  • Full Reimplementation of Animations:
    - Implemented all animations types supported by Silverlight, including DoubleAnimation, DoubleAnimationUsingKeyFrames, ColorAnimation, ColorAnimationUsingKeyFrames, PointAnimation, PointAnimationUsingKeyFrames, and ObjectAnimationUsingKeyFrames.
    -  Implemented all easing functions supported by Silverlight.
    - Implemented all key frames supported by Silverlight (Discrete, Linear, Easing and Spline key frames).
  • Implemented UIElement.Clip Property: Now supports more than just RectangleGeometry.
  • Added support for LinearGradientBrush in foreground brushes.
  • Implemented the CompositionTarget class
  • Implemented SystemColors class
  • Rewritten TabControl and TabItem (and their styles) using the original toolkit implementation
  • Implemented many controls, including Rating, RatingItem, DomainUpDown, GlobalCalendar, and more.
  • Implemented easier Drag & Drop: Introduction of DragDropTarget and specific variants (PanelDragDropTarget, ListBoxDragDropTarget, TreeViewDragDropTarget, DataPointSeriesDragDropTarget, DataGridDragDropTarget) for intuitive drag-and-drop functionality.
  • Reimplemented Components that Display Text: Including TextBlock, RichTextBlock, TextBox, PasswordBox, and the TextElement derived types.
  • Font-related properties (FontSize, FontFamily, FontWeigth etc...) and other text-related properties (CharacterSpacing, Foreground etc.) are now properly inherited through the visual tree.
  • Implemented DependencyObject.GetAnimationBaseValue method for animation value manipulation.
  • Improved HtmlPresenter: Enhanced Measure and Arrange functions, added property to control scrolling behavior inside HTML presenter, and more.
  • Many Low-Level Enhancements and Improved Performance: Optimizations across the framework for a smoother runtime and a more efficient development experience.
  • The detailed changelog is available on GitHub 

Get Started Today!

Join us on this exciting journey. Download the OpenSilver 2.1 SDK today and start shaping the future of web development. Your innovative creations inspire us, and we can't wait to see the amazing applications you'll build with OpenSilver.

 

Press Kit

For media inquiries, please send an email to: Vasil Buraliev Media Relations at Userware vasil.buraliev@userware.
onmicrosoft.com

Press Release:

High resolution logo (PNG with Alpha):