Microsoft Setup Ui Framework

Cross-platform .NET is all the rage now. You can do console apps in C# and F#, web with ASP.NET Core, mobile with Xamarin. But can you do desktop UI apps?

Microsoft Setup Ui FrameworkMicrosoft Setup Ui Framework

.NET Core by itself does not provide any UI framework, and Microsoft does not seem to bother with this.They are mostly trying to appeal to web developers, and this is understandable: web apps are much more popular.

Web ui frameworks

With Mono you could at least use Windows Forms, but Mono is old stuff.

Microsoft Setup Ui Framework

Turns out there is Avalonia UI project, and it is pretty decent!

Microsoft Setup Ui.framework Mac Crack

  • WPF-inspired, so existing XAML experience translates easily (though there are some differences)
  • Supports .NET Core
  • Works on Windows, Linux, macOS, and even Android/iOS with Mono

So I’ve decided to try it out. And to make things interesting, let’s do an old-school DOS demoscene inspired falling snow effect!

Modern Desktop app UI made easy. Guna framework helps you build and deploy your apps in less time. You can be the first to reach the market. Microsoft Visual.

  1. This package provides backward-compatible versions of Windows UI features including UWP XAML controls, dense control styles, and Fluent styles and materials. It is part of the Windows UI Library.
  2. Starting with the SharePoint Framework Yeoman generator version 1.3.4, the default project (web parts and extensions) templates come setup with the new @microsoft/sp-office-ui-fabric-core package and consume core styles from the package instead of using global CSS styles.
  3. WinUI offers a state-of-the-art UI framework for all Windows apps across both Win32 and UWP. It provides a way to gradually migrate existing apps written in familiar technologies like MFC, WinForms, and WPF, allowing you to move these applications forward at your own pace.

First, install Visual Studio Extension.Create a project with the installed project template. It is a bit outdated, so we’ll have to change <TargetFrameworks>netcoreapp1.1;net461</TargetFrameworks> to <TargetFramework>netcoreapp2.0</TargetFramework> in the csproj file.

We are presented with regular WPF files: App.xaml, MainWindow.xaml, and their code-behind.XAML Designer did not work for me, but who uses it, anyway?

Framework

On the screenshot above you can see the animation itself and some controls: button, sliders, and a ListBox for colors.Everything is pretty standard, ItemsControl with DataTemplate works as you would expect, I did not encounter any difficulties.

MVVM and bindings are also very similar to WPF.I’ve encountered a bug with two-way Slider value binding and had to switch to the nightly build.

In XAML there is an <Image Source='{Binding Bitmap}' />, and SnowViewModel.Bitmap is aWriteableBitmap, a concept well-known from WPF. You can even write to it from any thread, which simplifies rendering.

InvalidateVisual has to be called on the Image control in order to refresh the contents afterunderlying WriteableBitmap has been updated.

Drawing is achieved like this:

Tested on Windows, Linux, and macOS:

  • Install .NET Core SDK
  • git clone https://github.com/ptupitsyn/let-it-snow.git
  • cd let-it-snow/AvaloniaCoreSnow
  • dotnet run

Even though Avalonia is still in alpha, it worked pretty well for me right away,and with prior WPF experience I could easily achieve the desired result. Impressive!

Alternatives?

  • Qt (a bit more complicated)
  • Java (lacks pointers)
  • Electron (oh god)

Microsoft Setup Ui Framework 4.8

UI in this demo is quite simple, but it uses a number of essential features:

  • Layout (Grid, StackPanel)
  • Bindings, MVVM
  • ItemsControl
  • WriteableBitmap

Microsoft Setup Ui.framework Mac Download

This is already enough to build an UI of any complexity.

Office 2016 Microsoft Setup Ui.framework

  • Source code: https://github.com/ptupitsyn/let-it-snow
  • This article in Russian: Кроссплатформенная новогодняя демка на .NET Core и Avalonia
  • Reddit comments: https://www.reddit.com/r/programming/comments/7r1yz9/crossplatform_desktop_ui_with_net_core_and/

Comments are closed.