Cross-platform .NET UI toolkit release AvaloniaUI 0.8

    The next beta release of AvaloniaUI .



    The release includes a large number of bug fixes, performance optimizations and a number of new features. What's new, you can find out under the cut.


    X11 backend for Linux


    Previously, we used GTK2 and then GTK3 to draw windows under Linux. Unfortunately, GTK had more problems than good, and the graphics output generally had to be done through XPutImage from a separate connection to the X server.
    In # 2011 , a backend working directly with libX11 was implemented, which, in addition to fixing a number of bugs and simplifying windows, made it possible to implement support for per-monitor DPI , which, for ideological reasons, GTK for X11 does not do is ideally superior (it is in Qt for X11).


    File dialogs still depend on GTK3, but the work with them is organized in such a way that in the future it will be possible to use the same dialogs from Qt and through the portal APIs .


    AvaloniaResource


    Previously, we used EmbeddedResource for resources, which led to resource names of the form `resm: YourAssembly.Dir1.Dir2.file.xaml". Now we have implemented an MSBuild task that allows you to refer to resources by normal Url as in WPF / UWP, as well the same relative paths relative to the current XAML file, for example:



    To migrate old projects, you need to replace EmbeddedResourcewith AvaloniaResource, for example:


    Designer

    To associate XAML markup with codebehind, the resource name in EmbeddedResource was previously mapped with namespace and class name, which caused a number of inconveniences when the markup file location did not match the namespace and namespace of the class. Now the attribute is used for this x:Class, as in all XAML frameworks of a healthy person:




    Dark theme


    The # 2078 added a feature that all have been waiting, dark theme.



    Note: the tabs on the left are stylized NOT by the theme and are not included in it.


    Better platform-specific options


    Some refactoring of the configuration of platform-specific options has been carried out . Previously, I had to write such a terrible footcloth:


    public static AppBuilder BuildAvaloniaApp()
    {
        var builder = AppBuilder.Configure();
        if(RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
             builder.UseX11(new X11PlatformOptions() {UseGpu = false});
        else if(RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
             builder.UseAvaloniaNative(anopts => 
             {
                  anopts.UseGpu = false;
                  anopts.MacOptions.ShowInDock = 0;
             });
        else if(RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
              builder.UseWin32(false, true);
        return builder;
    }

    Now everything is brief and beautiful


    public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure()
         .UsePlatformDetect()
         .With(new X11PlatformOptions { UseGpu = false })
         .With(new AvaloniaNativePlatformOptions { UseGpu = false })
         .With(new MacOSPlatformOptions { ShowInDock = false })
         .With(new Win32PlatformOptions { UseDeferredRendering = false });

    Updated plugin preview for Visual Studio


    The preview has been rewritten to use image transfer over TCP. Previously, we had a set of crutches with the creation of an off-screen window and shoving it into the studio through user32! SetParent. The problem with this approach was that it did not always work, and when it worked, it was not always as it should. Now the preview behaves much more stable.


    Also in the updated plugin were introduced intelligence improvements


    Viewbox


    The # 2066 has been added to part of the requested control of the WPF and the UWP: ViewBox.


    DropDown renamed ComboBox


    Despite the fact that he is still a dropdown, not a combo box, we renamed it to be like everyone else (WPF / UWP). The old name is still available, but will be removed in a couple of releases.


    DataGrid


    The DataGrid is now considered conditionally ready for use (well, simply because it is already actively used), transferred to the main repository and published in the Avalonia.Controls.DataGrid package .


    To use, when configuring the application, you need to call UseDataGrid:


    public static AppBuilder BuildAvaloniaApp()
         => AppBuilder.Configure()
              .UsePlatformDetect()
              .UseDataGrid();

    and write its default topic in App.xaml:



    Multiselect in TreeView


    In # 2347 , a multi select has been added to TreeView. It was the 2019th year.


    Improved ReactiveUI Support


    A control was added in # 2294
    RoutedViewHost .


    System Fonts API


    Now you can get a list of all available APIs in the system. The 2019th year continued.


    Many bugs fixed


    A list of (almost) all changes can be found here .


    Breaking changes


    Since we have 0 major version number, according to SemVer we can make breaking changes in minor releases. And we do them all the same, that's why it is still “beta”. A list of migration information can be found here .


    How to start using


    Проще всего установить расширение для Visual Studio и использовать поставляемые с ним шаблоны, либо воспользоваться шаблонами для dotnet new. Примеры работы с тулкитом можно посмотреть
    здесь.


    Про документацию мы пока традиционно можем сказать, у нас примерно как в WPF, что не как в WPF расписано на сайте, а если случилось что-то совсем не понятное, то стучитесь в Gitter-чат/


    А этим вообще кто-то пользуется?


    За всех не скажем, скажем за тех, кто рассказал нам про себя в чатах:


    Кроссплатформенный вариант ILSpy


    WasabiWallet — ZeroLink-совместимый Bitcoin-кошелёк


    PokemonBattleEngine — симулятор боёв покемонов



    egram.tel — клиент Telegram


    SparkSDR - Software-defined Radio for amateur (?) Radio stations.



    RoslynPad is an open source analog of LinqPad.


    Core2D - chart editor


    AvalonStudio - IDE for embedded development


    Well, for development in C # with Avalonia:


    To replenish this list in your power.


    Also popular now: