Consolonia.Blazor 11.2.3-beta.841

This is a prerelease version of Consolonia.Blazor.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Consolonia.Blazor --version 11.2.3-beta.841                
NuGet\Install-Package Consolonia.Blazor -Version 11.2.3-beta.841                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Consolonia.Blazor" Version="11.2.3-beta.841" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Consolonia.Blazor --version 11.2.3-beta.841                
#r "nuget: Consolonia.Blazor, 11.2.3-beta.841"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Consolonia.Blazor as a Cake Addin
#addin nuget:?package=Consolonia.Blazor&version=11.2.3-beta.841&prerelease

// Install Consolonia.Blazor as a Cake Tool
#tool nuget:?package=Consolonia.Blazor&version=11.2.3-beta.841&prerelease                

Consolonia.Blazor

This package provides the ability to use Blazor .razor files to create Consolonia applications.

Background

Consolonia is a TUI (Text User Interface) (GUI Framework) implementation for Avalonia UI

Showcase (click picture to see video)

datagridpic

Example Razor file

Things to note:

  • Method binding to code behind
  • Conditional layout of elements
  • Full intellisense for renaming going to code behind autocomplete etc.
  • injection of INavigation so you can push and pop views off of the nav stack
  • injection of IClassicDesktopStyleApplicationLifetime so you can access Args and shutdown the app.
  • HOT RELOAD. simple save the file and your view gets rebuilt and rerendered!

blazor

@page "/"
@inject INavigation navigation
@inject IClassicDesktopStyleApplicationLifetime lifetime

@namespace Example.Blazor.Components

<Window Title="Blazor Bindings for Consolonia" Topmost="true">
     <StackPanel Orientation="Orientation.Vertical" VerticalAlignment="VerticalAlignment.Center">
        @if (showCounter)
        {
            <TextBlock HorizontalAlignment="HorizontalAlignment.Center">Counter: @CounterText</TextBlock>
        }
        <StackPanel Orientation="Orientation.Vertical" HorizontalAlignment="HorizontalAlignment.Center" Margin="@Thickness.Parse("4")">
            <Button OnClick="@OnIncrement">Increment counter support</Button>
            <Button OnClick="@OnToggleCounter">@ToggleText</Button>
            <Button OnClick="@OnMessageBox">Message Box</Button>
            <Button OnClick="@OnGotoSubPage">Go to SubPage</Button>
            <Button OnClick="@OnExit">Exit</Button>
        </StackPanel>
    </StackPanel> 
</Window>

@code {
    int counter = 0;
    bool showCounter = true;

    string CounterText => counter switch
    {
        0 => "Not clicked",
        1 => $"Clicked 1 time",
        _ => $"Clicked {counter} times"
    };

    string ToggleText => showCounter ? "Hide Counter" : "Show Counter";

    void OnIncrement()
        => counter++;

    void OnToggleCounter()
        => showCounter = !showCounter;

    void OnGotoSubPage()
        => navigation.PushAsync<SubPage>();

    async void OnMessageBox(RoutedEventArgs args)
    {
        await new MessageBox()
            .ShowDialogAsync((AC.Control)args.Source!, "Hello, Blazor!", "Blazor Bindings for Consolonia");
    }

    void OnExit()
       => lifetime.Shutdown();
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
11.2.3-beta.936 21 12 days ago
11.2.3-beta.920 36 13 days ago
11.2.3-beta.906 39 16 days ago
11.2.3-beta.902 40 18 days ago
11.2.3-beta.887 32 22 days ago
11.2.3-beta.883 27 22 days ago
11.2.3-beta.876 34 24 days ago
11.2.3-beta.874 30 24 days ago
11.2.3-beta.866 7 25 days ago
11.2.3-beta.862 5 a month ago
11.2.3-beta.860 26 a month ago
11.2.3-beta.849 29 a month ago
11.2.3-beta.845 26 a month ago
11.2.3-beta.841 31 a month ago
11.2.3-beta.838 32 a month ago
11.2.3-beta.826 32 a month ago
11.2.3-beta.819 30 a month ago
11.2.3-beta.802 29 a month ago
11.2.3-beta.798 28 a month ago
11.2.3-beta.793 26 a month ago
11.2.3-beta.789 33 a month ago
11.2.3-beta.784 32 a month ago
11.2.1-alpha-782 31 a month ago
11.2.1-alpha-770 32 a month ago
11.2.1-alpha-764 15 a month ago
11.2.1-alpha-756 7 a month ago
11.2.1-alpha-748 36 a month ago
11.2.1-alpha-713 45 a month ago
11.2.1-alpha-711 70 a month ago
11.2.1-alpha-709 68 a month ago
11.2.1-alpha-701 70 a month ago
11.2.1-alpha-698 67 2 months ago
11.2.1-alpha-678 67 2 months ago
11.2.1-alpha-668 43 2 months ago
11.2.1-alpha-664 39 2 months ago
11.2.1-alpha-661 44 2 months ago
11.2.1-alpha-652 45 2 months ago
11.2.1-alpha-648 42 2 months ago
11.2.1-alpha-646 42 2 months ago
11.2.1-alpha-631 47 2 months ago
11.2.1-alpha-626 42 2 months ago
11.2.1-alpha-614 39 2 months ago
11.2.1-alpha-606 48 2 months ago
11.2.1-alpha-604 57 2 months ago
11.2.1-alpha-598 53 2 months ago
11.2.1-alpha-595 50 2 months ago
11.2.1-alpha-593 44 2 months ago
11.2.1-alpha-579 58 2 months ago
11.2.1-alpha-577 54 2 months ago
11.2.1-alpha-574 49 2 months ago
11.2.1-alpha-568 51 2 months ago
11.2.1-alpha-559 52 2 months ago
11.2.1-alpha-547 54 2 months ago
11.2.1-alpha-545 47 2 months ago
11.2.1-alpha-540 49 2 months ago
11.2.1-alpha-538 49 2 months ago
11.2.1-alpha-523 55 2 months ago
11.2.1-alpha-517 50 2 months ago