<commit_before>Gu.Reactive
===========

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md)
[![NuGet](https://img.shields.io/nuget/v/Gu.Reactive.svg)](https://www.nuget.org/packages/Gu.Reactive/)
[![NuGet](https://img.shields.io/nuget/v/Gu.Wpf.Reactive.svg)](https://www.nuget.org/packages/Gu.Wpf.Reactive/)
[![Build status](https://ci.appveyor.com/api/projects/status/klrt8kctqbvt2j95?svg=true)](https://ci.appveyor.com/project/JohanLarsson/gu-reactive)
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/JohanLarsson/Gu.Reactive?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Helpers for using System.Reactive with `INotifyPropertyChanged`.

# Table of contents

- [Factory methods for creating observables.](#factory-methods-for-creating-observables)
  - [ObservePropertyChanged:](#observepropertychanged)
    - [SignalInitial](#signalinitial)
  - [ObservePropertyChangedSlim:](#observepropertychangedslim)
    - [SignalInitial](#signalinitial)
    - [ObservePropertyChangedWithValue](#observepropertychangedwithvalue)
  - [ObserveCollectionChanged:](#observecollectionchanged)
    - [SignalInitial](#signalinitial)
  - [ObservePropertyChangedSlim:](#observepropertychangedslim)
    - [SignalInitial](#signalinitial)
  - [ObserveItemPropertyChanged](#observeitempropertychanged)
- [Conditions:](#conditions)
  - [Condition](#condition)
    - [IsSatisfied](#issatisfied)
    - [Name](#name)
    - [History](#history)
    - [Negate()](#negate)
  - [OrCondition](#orcondition)
    - [IsSatisfied](#issatisfied)
  - [AndCondition](#andcondition)
    - [IsSatisfied](#issatisfied)
- [Collections](#collections)
  - [FilteredView<T>](#filteredview-t)
  - [MappingView<TSource, TResult>](#mappingview-tsource--tresult)
  - [ThrottledView<T>](#throttledview-t)
  - [DispatchingView<T>](#dispatchingview-t)
  - [ReadOnlySerialView<T>](#readonlyserialview-t)
  - [Commands](#commands)
    - [AsyncCommand](#asynccommand)
    - [ConditionRelayCommand](#conditionrelaycommand)
    - [ManualRelayCommand](#manualrelaycommand)
    - [ObservingRelayCommand](#observingrelaycommand)
    - [RelayCommand](#relaycommand)
  - [MarkupExtensions](#markupextensions)
    - [EnumValuesForExtension](#enumvaluesforextension)
    - [NinjaBinding](#ninjabinding)

# Assembly redirects.
When used from .Net 4.6 assembly redirects are needed.
https://github.com/Reactive-Extensions/Rx.NET/issues/299

```xml
<dependentAssembly>
  <assemblyIdentity name="System.Reactive.Core" publicKeyToken="<KEY>" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
</dependentAssembly>
<dependentAssembly>
  <assemblyIdentity name="System.Reactive.PlatformServices" publicKeyToken="<KEY>" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
</dependentAssembly>
<dependentAssembly>
  <assemblyIdentity name="System.Reactive.Linq" publicKeyToken="<KEY>" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
</dependentAssembly>
```
Nuget can generate redirects using PM> `Get-Project All | Add-BindingRedirect`

# Factory methods for creating observables.

## ObservePropertyChanged:

```c#
var subscription = fake.ObservePropertyChanged(x => x.Level1.Level2.Value)
					   .Subscribe(...);
```

1) Create an observable from the `PropertytChangedEvent` for fake.
2) Listens to nested changes. All steps in the property path must be INotifyPropertyChanged. Throws if not.
3) When PropertyChanged is raised with string.Empty or null the observable notifies.
4) Updates subscriptions for items in path and uses weak events.

### SignalInitial
Default true meaning that the observable will call OnNExt on Subscribe.
The sender will be tha last node in the path that has a value, in the example above it would be the value of the property `Level2` if it is not null, then `Level1` if not null if the entire path is null the root item `fake`is used as sender for the first notifixcation.
The eventags for the signal initial event is `string.Empty`

## ObservePropertyChangedSlim:

```c#<commit_msg>Fix broken links & badges<commit_after>Gu.Reactive
===========

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md)
[![Nuget](https://img.shields.io/nuget/v/Gu.Reactive.svg?label=Gu.Reactive)](https://www.nuget.org/packages/Gu.Reactive/)
[![Nuget](https://img.shields.io/nuget/v/Gu.Wpf.Reactive.svg?label=Gu.Wpf.Reactive)](https://www.nuget.org/packages/Gu.Wpf.Reactive/)
[![Build status](https://ci.appveyor.com/api/projects/status/klrt8kctqbvt2j95?svg=true)](https://ci.appveyor.com/project/JohanLarsson/gu-reactive)
[![Gitter](https://badges.gitter.im/JoinChat.svg)](https://gitter.im/JohanLarsson/Gu.Reactive?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Helpers for using System.Reactive with `INotifyPropertyChanged`.

# Table of contents

- [Factory methods for creating observables.](#factory-methods-for-creating-observables)
  - [ObservePropertyChanged:](#observepropertychanged)
    - [SignalInitial](#signalinitial)
  - [ObservePropertyChangedSlim:](#observepropertychangedslim)
    - [SignalInitial](#signalinitial)
    - [ObservePropertyChangedWithValue](#observepropertychangedwithvalue)
  - [ObserveCollectionChanged:](#observecollectionchanged)
    - [SignalInitial](#signalinitial)
  - [ObservePropertyChangedSlim:](#observepropertychangedslim)
    - [SignalInitial](#signalinitial)
  - [ObserveItemPropertyChanged](#observeitempropertychanged)
- [Conditions:](#conditions)
  - [Condition](#condition)
    - [IsSatisfied](#issatisfied)
    - [Name](#name)
    - [History](#history)
    - [Negate()](#negate)
  - [OrCondition](#orcondition)
    - [IsSatisfied](#issatisfied)
  - [AndCondition](#andcondition)
    - [IsSatisfied](#issatisfied)
- [Collections](#collections)
  - [ReadOnlyFilteredView](#readonlyfilteredview)
  - [MappingView](#mappingviewtsource-tresult)
  - [ReadOnlyThrottledView](#readonlythrottledview)
  - [ReadOnlyDispatchingView](#readonlydispatchingview)
  - [ReadOnlySerialView](#readonlyserialview)
  - [Commands](#commands)
    - [AsyncCommand](#asynccommand)
    - [ConditionRelayCommand](#conditionrelaycommand)
    - [ManualRelayCommand](#manualrelaycommand)
    - [ObservingRelayCommand](#observingrelaycommand)
    - [RelayCommand](#relaycommand)
  - [MarkupExtensions](#markupextensions)
    - [EnumValuesForExtension](#enumvaluesforextension)
    - [NinjaBinding](#ninjabinding)

# Assembly redirects.
When used from .Net 4.6 assembly redirects are needed.
https://github.com/Reactive-Extensions/Rx.NET/issues/299

```xml
<dependentAssembly>
  <assemblyIdentity name="System.Reactive.Core" publicKeyToken="<KEY>" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
</dependentAssembly>
<dependentAssembly>
  <assemblyIdentity name="System.Reactive.PlatformServices" publicKeyToken="<KEY>" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
</dependentAssembly>
<dependentAssembly>
  <assemblyIdentity name="System.Reactive.Linq" publicKeyToken="<KEY>" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
</dependentAssembly>
```
Nuget can generate redirects using PM> `Get-Project –All | Add-BindingRedirect`

# Factory methods for creating observables.

## ObservePropertyChanged:

```c#
var subscription = fake.ObservePropertyChanged(x => x.Level1.Level2.Value)
					   .Subscribe(...);
```

1) Create an observable from the `PropertytChangedEvent` for fake.
2) Listens to nested changes. All steps in the property path must be INotifyPropertyChanged. Throws if not.
3) When PropertyChanged is raised with string.Empty or null the observable notifies.
4) Updates subscriptions for items in path and uses weak events.

### SignalInitial
Default true meaning that the observable will call OnNExt on Subscribe.
The sender will be tha last node in the path that has a value, in the example above it would be the value of the property `Level2` if it is not null, then `Level1` if not null if the entire path is null the root item `fake`is used as sender for the first notifixcation.
The eventags for the signal initial event is `string.Empty`

## ObservePropertyChangedSlim:

```c#
{'fraction_non_alphanumeric': 0.1459227467811159, 'fraction_numerical': 0.01692894611349547, 'mean_word_length': 5.574451410658307, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 42, 'https://': 20, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2155762', 'n_tokens_mistral': 2847, 'n_tokens_neox': 2638, 'n_words': 490}