Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

📑 Here, I talk about reactive programming in C# and .NET framework using the Rx.NET library.

NotificationsYou must be signed in to change notification settings

Parsakarami/RxSamples

Repository files navigation

Here, we will talk about reactive programming in C# and .NET framework using the Rx.NET library. Reactive programming is widely in use in desktop and mobile applications nowadays.

ReactiveUI

For this sample, I used ReactiveUI to implement MVVM in the project. However, the ReactiveUI gives us a model-view-ViewModel framework for all .NET platforms. I chose a WPF application to implement the samples. For more information about the ReactiveUI and how to implement the MVVM, you can check the following links:

https://www.reactiveui.net/
https://github.com/reactiveui/reactiveui

Observables

In all the samples, we widely use Observables. If you are not familiar with the observer design pattern, visit the following links:

https://learn.microsoft.com/en-us/dotnet/standard/events/observer-design-pattern
https://learn.microsoft.com/en-us/dotnet/api/system.iobservable-1?view=net-7.0
https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged?view=net-7.0

Marble Diagram

The best way to show the execution pipeline of the observables sequence is using marble diagrams. Hence, I use it in this repo and my blog as well. In the following figure, execution of the observables sequence is represented by a marble diagram.

Rx Operations

The following examples show some of the main Rx operations using a marble diagram.

Take

TheTake(int count) operation is used to take a specific number of elements from an observable sequence.

Delay

TheDelay(TimeSpan dueTime) operation is used to receive the values of an observable sequence by delay after the subscription.

Where

TheWhere(Func<TSource, bool> predicate) operation is used to filter out the values of an observable sequence.

Step Interval

https://parsakarami.com/Blog/Main/Post/Receiving_buffered_items_with_wait_time_intervals_in_RxNET

Languages


[8]ページ先頭

©2009-2025 Movatter.jp