Visual.Reactive.WinForms 1.0.0

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

// Install Visual.Reactive.WinForms as a Cake Tool
#tool nuget:?package=Visual.Reactive.WinForms&version=1.0.0                

N|Solid

What is Visual Reactive ??

Visual Reactive is a Library for .NET platform (Currently Winforms), that is inspired by functional reactive programming React JS. Reactive programming is a paradigm that allows you to express the idea around a feature in one readable place, abstract mutable state away from your user interfaces and improve the testability of your application.

N|Solid

The project was started this by KimTooFlex and is now at its Beta Version and Mature enough to to be implemented. The framework is used by Bunifu Technologies to Build its Awesome resposive Interfaces.

New Features!

  • Named States
  • Global State Management
  • Fire / Subscribe & Forget
  • All Data types Support
  • Generic Support <>
  • Method Binding
  • Property Binding
  • Event binding
  • Timer Events
  • Extremely Easy
  • Light Weight
  • Lightning Fast

Why VisualReactive ?

N|Solid

Most modern programming today is basically imperative, meaning it models the traditional fetch-execute cycle of a CPU. Perform an instruction, fetch the next one. Perform that one, and so on. For decades, programmers have had to mould their brains to fit the paradigm of the CPU. It's been like this since the early 1980s.

VisualReactive is inspired by the paradigm of Functional Reactive Programming, which allows you to model user input as a function that changes over time. This is super cool because it allows you to abstract mutable state away from your user interfaces and express the idea around a feature in one readable place whilst improving application testability. Reactive programming can look scary and complex at first glance, but the best way to describe reactive programming is to think of a spreadsheet:

Tech

  • [Net Framework] - .Net Framework 2.0 and up
  • [Visual Studio] - Any Version

Installation

Get the dll from VisualReactive Website

  • Launch Visual studio
  • Create a Winform Project
  • got to Reference , right click and click on Add reference
  • select the downlaoded VisualReactiveWinForms.dll and import

Acessing VSReactive

Namespace


using KimtToo.VisualReactive;

Class (Static with Generic Type)


VSReactive<string>.
VSReactive<int>.
VSReactive<Image>.
VSReactive<T>.

Function/Method Reference

Summary of usefull Methods in Visualreacctive library

METHOD README
.SetState(statename,stateValue) Sets the global state state.
.GetState(stateName) Gets the global state state Current Value Retuns <T>.
.Subscribe(stateName,callback(newState)) Subscribes to the specified state and invokes the callback when the state changes.
.Broadcast(SourceControl,propertyName,stateName) Broadcasts the specified source control property value to the State when the property changes.
.BroadSub(SourceControl,propertyName,stateName,callBack(newState)) Broadcast to a state & Subscribes at the same time.
.SubscribeMthod(stateName,method(<T>)) Subscribes a method with the specified name.
.UnSubscribeMethod(stateName) unSubscribes a method with the specified name.
.BindEvent(stateName, Value); Binds the event returns EventHandler.
.SetInterval(stateName,stateInterval,callBack(newState)) Sets the global state state.
.Dispose(stateName); Disposes the specified state and all its Data.
.MuteBroadcast(stateName) Mute Subscribers Listenig to state.
.InvokeMethod(stateName,param) Invokes the specified method name.
.SetState(statename,stateValue) Sets the global state state.

SetState

VSReactive<string>.SetState("phone","Hellow world");
VSReactive<int>.SetState("age",1);
VSReactive<double>.SetState("amount",199.233);
VSReactive<Image>.SetState("photo",Image1));
VSReactive<DataTable>.SetState("data",Datatable1);

getState

string phone = VSReactive<string>.GetState("phone");
int age = VSReactive<int>.GetState("age");
double amount = VSReactive<double>.GetState("amount");
Image photo = VSReactive<Image>.GetState("photo");
DataTable data = VSReactive<DataTable>.GetState("data"); 

Subscribe

//method 1
 VSReactive<string>.Subscribe("phone", (phone) => MessageBox.Show(phone));
 
 //method 2
VSReactive<string>.Subscribe("phone",(phone)=> {
  //phone state changed
    MessageBox.Show(phone);
 });

Broadcast

 VSReactive<string>.Broadcast(textBox1, "Text", "phone");
 VSReactive<int>.Broadcast(textBox1, "Text", "phone");
Example 1 - Subscribe/Broadcast
VSReactive<string>.Broadcast(textBox1, "Text", "phone");
 VSReactive<string>.Subscribe("phone",(phone)=> {
  //phone state changed
    MessageBox.Show(phone);
 });
Example 2 - Subscribe/Broadcast (BroadSub)
 VSReactive<string>.BroadSub(textBox1, "Text", "phone", (phone) =>
 {
  MessageBox.Show("Phone changed");
 });
Subscribe Method & Invoke Method
   //register a method
 VSReactive<string>.SubscribeMethod("msg",
  (message) =>
  {
    MessageBox.Show(message);
   });
    
  //call the method (Globally accessible)
   VSReactive<string>.InvokeMethod("msg","Visual Reactive is Awesome");
Event Binding
   //sets the phone state to  072255454545 when clicked
   button1.Click += VSReactive<string>.BindEvent("phone", "072255454545");
         
Timer
 //runs the timer with initial interval - paused when interval state is at 0
 VSReactive<string>.SetInterval("interval", 1000, 
  (interval) =>
  {
    MessageBox.Show("Timer tick");
  });
         

Timer Usecase

N|Solid

Free Software, Hell Yeah for first 10k users!

Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

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 5,212 2/11/2019

Initial Release.