Blazor.Winbox 0.2.11

There is a newer version of this package available.
See the version list below for details.
dotnet add package Blazor.Winbox --version 0.2.11
NuGet\Install-Package Blazor.Winbox -Version 0.2.11
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="Blazor.Winbox" Version="0.2.11" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blazor.Winbox --version 0.2.11
#r "nuget: Blazor.Winbox, 0.2.11"
#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 Blazor.Winbox as a Cake Addin
#addin nuget:?package=Blazor.Winbox&version=0.2.11

// Install Blazor.Winbox as a Cake Tool
#tool nuget:?package=Blazor.Winbox&version=0.2.11

Blazor Winbox

Multiple Windows Library that wraps WinBox.js in Blazor Components.

Windows management and rendering processes were inspired by MudBlazor dialogs

GitHub repository

Compatibility

Only Blazor WASM (client-side) applications are currently supported. This library is not tested on Blazor Server applications.

Getting Started

Installation:

The Nuget package page can be found here

To install Blazor.Winbox from Nuget Gallery simply search for its name and install the latest version

Or using Package Manager run the following command
Install-Package Blazor.Winbox
Or using .NET CLI run the following command
dotnet add package Blazor.Winbox

Configurations:

  • Import Blazor.Winbox by adding the following in _Imports.razor
@using Blazor.Winbox
  • Register Blazor.Winbox Service in Program Class:
public static async Task Main(string[] args)
{
   //...omitted for brief
   builder.Services.AddBlazorWinbox();
}
  • Add script references to index.html after Blazor script
<script src="_content/Blazor.Winbox/winbox.bundle.min.js"></script>
<script src="_content/Blazor.Winbox/BlazorWinbox.min.js"></script>
  • Add the following component to your MainLayout.razor
<WindowProvider />

Open a window

Create a window component. Let's use Counter template as example:

<Window>

    <h1>Counter</h1>

    <p role="status">Current count: @currentCount</p>

    <button class="btn btn-primary" @onclick="IncrementCount">Click me</button>

</Window>

@code {

    private int currentCount = 0;

    private void IncrementCount()
    {
        currentCount++;
    }
}

Note that whole window content should be surrounded with <Window> Tag

To open a window, inject IWindowManager service and use Open<TComponent>() method:

//Use in razor
@inject IWindowManager windowManager
//OR in C# 
[Inject] public IWindowManager WindowManager { get; set; }

//Open a window
void OpenCounter(){
    IWindowReference windowReference = WindowManager.Open<Counter>();
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
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
0.2.13 429 9/29/2022
0.2.12 404 9/27/2022
0.2.11 365 9/4/2022
0.2.1 358 9/4/2022

Partial support of all winbox.js important functionalities