NotificationCenterNetFramework 1.0.0

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

// Install NotificationCenterNetFramework as a Cake Tool
#tool nuget:?package=NotificationCenterNetFramework&version=1.0.0                

NotificationCenter

A communication path between all classes of a project using the notification center. Transferring data between observers at high speed and completely asynchronously. Implemented similarly to "NotificationCenter" in Swift.

Dependencies

Nuget

Usage

The class that is going to be an observer of the notifications must implement the "Notifiable" interface:

public class Observer: Notifiable
{

	public void OnNotification(Notification notification)
	{
		Console.WriteLine(notification.ToString());
	}
}

A class must be a member of the Notification Center observers to receive notifications:

private NotificationName notifName;

public Observer()
{
	notifName = new NotificationName("DefaultName");
	NotificationCenter.Default.AddObserver(this, notifName);
}

A class can be an observer of different names. Each notification name is a separate list of observers. It means that a class receives a notification when another class sends a notification with the same name.

To post a notification:

NotificationCenter.Default.Post(sender: this, name: notifName, obj: "Hey there!", userInfo: null);

The main notification data has two parts:

  • Object: which can carry any type of data
  • UserInfo: includes a dictionary of keys and desired values
Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 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
1.0.0 637 2/10/2023

First Release