.NET Core UI Framework Avalonia

Official website:http://avaloniaui.net/

.NET Core UI framework Avalonia, Avalonia is a cross-platform UI framework based on WPF XAML and supports multiple operating systems: Windows (.NET Framework, .NET Core), Linux (GTK), MacOS, Android and iOS.

Avalonia is currently in beta.

GitHub:https://github.com/AvaloniaUI/Avalonia

Development preparation

VS 2017 installation extension https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaforVisualStudio

Then you can develop the project

By selecting Avalonia Application, you can create a project. By default, two will create two frameworks, .NET Framework 4.6.1 and .NET Core 2.0.

Can be created in the projectWindow andUserControl。

Sample UI project

Create a new base project myapp, add a few buttons to MainWindow.xaml, which is the syntax of WPF XAML, which can directly achieve the corresponding layout.

<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="myapp">
    <Grid Width="800" Height="600">
      <StackPanel Margin="20">

        <Button Content="Button1" Name="btn1"/>

        <Button Content="Button2"/>

        <Button Content="Button3"/>
        <TextBox Text="LineZero" Name="myText"></TextBox>

      </StackPanel>
    </Grid>
  </Window>

 

Background corresponding code

public class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
#if DEBUG
            this.AttachDevTools();
#endif
        }

        private void InitializeComponent()
        {
            AvaloniaXamlLoader.Load(this);
            this.FindControl<Button>("btn1").Click += Btn1_Click;
        }

        private void Btn1_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)
        {
            var txt = this.FindControl<TextBox>("myText");
            txt.FontFamily = "Microsoft Yahei";
                         txt.Text = "LineZero button 1";
        }
    }

Running program

By default, the Chinese display is a bit problematic, and the font can be set.

Support for installation of different systems: https://github.com/AvaloniaUI/Avalonia/wiki/Platform-support

 

AvalonStudio

A more mature program in Avalonia.

GitHub: https://github.com/VitalElement/AvalonStudio

At present, the official introduction has corresponding functions, and the actual operation is somewhat lacking.

AvaloniaEdit.Demo is also a good example.

GitHub: https://github.com/AvaloniaUI/AvaloniaEdit

You can check out the official documentation: http://avaloniaui.net/guides/ .NET Core is even better in the future.

Intelligent Recommendation

Surging based on .NET CORE framework

1 Introduction surgingHigh performance is used internallyRPCRemote service call, if usedjson.netSerialization is definitely not optimal in performance, so it will be expanded laterprotobuf,messagepack...

[.Net Development] Entity Framework Core

Preface: The following content comes from official Microsoft documents. Entity Framework (EF) Core is a lightweight, extensible, open source and cross-platform version of commonly used Entity Framewor...

.NET CORE micro-service framework

The micro service framework can be integrated .NET Core + Swagger + Consul + Polly + Oceloy + IdentityServer4 + Exceptionless + Apollo   Consul: Service Discovery and Configuration of Distributed...

# Create a simple .NET Core framework

Create a simple .NET Core framework program Recently, the project is relatively nervous, and take the time to study how the frame is built. The relatively fragmented learning is more fragmented. It is...

Integrated Identity framework in .NET CORE

Installation dependency package Define MyUser, Myrole, MyDBCONTEXT Inject in program Migration database migrate About user registration and password resetting, etc....

More Recommendation

.NET FrameWork to .NET Core encountered problems

Disclaimer: The notes here are not universal, for personal reference First, when using ConfigurationHelper ConfigurationHelper.AppSettings(“key”,false) Preconditions: 1. Add DotNet.Utiliti...

Measuring the workload of the .net framework to migrate to the .net core

2019 Unicorn Enterprise Heavy Gold Recruitment Python Engineer Standard >>> Migrating the existing .net framework program to the .net core is a very complicated task, especially if some APIs ...

.net core and .net framework program must not be mixed!

.net core and .net framework program must not be mixed! Today, when I was learning C # winform application form, in the solution of the original console .net core framework of the project A's joined t...

The difference between .Net Framework and .Net Core .Net5

The difference between .Net Framework and .Net Core .Net5 .NET Framework Framework for Windows developed by Microsoft .NET Core The Framework for Windows, Linux, and macOS is designed for cross-platfo...

How to port .NET Framework project to .NET Core?

The company's projects have always used the .NET framework to develop Web projects. At present, the basic class libraries are all .NET Framework version 4.6.2. Caching, Logging, DependencyInjection, C...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top