GC.Blazor 0.0.2

dotnet add package GC.Blazor --version 0.0.2
NuGet\Install-Package GC.Blazor -Version 0.0.2
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="GC.Blazor" Version="0.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GC.Blazor --version 0.0.2
#r "nuget: GC.Blazor, 0.0.2"
#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 GC.Blazor as a Cake Addin
#addin nuget:?package=GC.Blazor&version=0.0.2

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

GC.Blazor

The library provides a set of services and utility components to ease Blazor development.

Usage

Add the services to the DI:

builder.Services.AddGCBlazorServices();

DisposableHandle

The type allows to narrow the type of an object implementing IDisposable/IAsyncDisposable in order to create simple disposable handles without leaking unwanted access.

var hdl = new DisposableHandle((IDisposable)new Timer(p => {}, null, 1000, 1000));

//...

hdl.Dispose();

DisposableScope

Component to help with the disposal of disposable item at the end of a component lifecycle.

<DisposableScope>
  <MyComp />
</DisposableScope>

Then in <MyComp>

@code{
  [CascadingParameter]
  public DisposableScope Scope { get; set; }

  protected override void OnInitialized()
  {
    Scope.AddDisposable(...);
  }
}

TimerService

Service mimicking setInterval and setTimeout Web Apis.

TimedScope

Component which provides a scope for a timer in order to produce synchronized rerenders or notifications.

<TimedScope Period="@TimeSpan.FromSeconds(1)">
  <CurrentTime Now="@DateTime.Now" />
</TimedScope>

FullscreenService

Service which allows to request fullscreen for the document or for a given css selector.

DownloadFileService

Service which allows to cause a download of a Stream as a file.

DocumentEventService

Service which allows to subscribe to event of the document object.

ClipboardService

Service which allows to copy text to clipboard.

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. 
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.0.2 72 4/8/2024
0.0.1 70 4/5/2024
0.0.1-g5c8e95b867 59 4/4/2024