Skip to content

},System.Nullable{System.TimeSpan},System.Nullable{System.TimeSpan},System.Reactive.Concurrency.IScheduler)} },System.Linq.Expressions.Expression{System.Func{--0,--1}},System.Nullable{System.TimeSpan},System.Nullable{System.TimeSpan},System.Reactive.Concurrency.IScheduler)}

ObservableListEx.AutoRefresh(IObservable>, TimeSpan?, TimeSpan?, IScheduler?) method

Defined in

Type: ObservableListEx Namespace: DynamicData Assembly: DynamicData.dll

Applies to

net10.0, netstandard2.0

Overloads

  1. public static IObservable<IChangeSet<TObject>> AutoRefresh<TObject>(this IObservable<IChangeSet<TObject>> source, TimeSpan? changeSetBuffer = null, TimeSpan? propertyChangeThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged

  2. public static IObservable<IChangeSet<TObject>> AutoRefresh<TObject, TProperty>(this IObservable<IChangeSet<TObject>> source, Expression<Func<TObject, TProperty>> propertyAccessor, TimeSpan? changeSetBuffer = null, TimeSpan? propertyChangeThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged

1. Overload

public static IObservable<IChangeSet<TObject>> AutoRefresh<TObject>(this IObservable<IChangeSet<TObject>> source, TimeSpan? changeSetBuffer = null, TimeSpan? propertyChangeThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged

View source

Summary: Monitors all properties on each item (via INotifyPropertyChanged) and emits Refresh changes when any property changes, causing downstream operators to re-evaluate.

Type parameters

NameDescription
TObjectThe type of items, which must implement INotifyPropertyChanged.

Parameters

NameTypeDescription
sourceIObservable>The source IObservable&lt;IChangeSet&lt;TObject&gt;&gt; to monitor for property-driven refresh signals.
changeSetBuffer = nullTimeSpan?An optional TimeSpan buffer duration to batch multiple refresh signals into a single changeset.
propertyChangeThrottle = nullTimeSpan?An optional TimeSpan throttle applied to each item's property change notifications.
scheduler = null[IScheduler?](#The scheduler for throttle and buffer timing. Defaults to DefaultScheduler.

Returns: IObservable> -- A list changeset stream with additional Refresh changes injected when properties change.

Remarks

Wraps AutoRefreshOnObservable using WhenAnyPropertyChanged() as the re-evaluator. Pair with Filter or [Sort][M:DynamicData.ObservableListEx.Sort--1(System.IObservable{DynamicData.IChangeSet{--0}},System.Collections.Generic.IComparer{--0},DynamicData.SortOptions,System.IObservable{System.Reactive.Unit},System.IObservable{System.Collections.Generic.IComparer{--0}},System.Int32)] to get reactive re-evaluation on property changes.

EventBehavior
Add/AddRangeSubscribes to PropertyChanged on each new item. The original change is forwarded.
ReplaceUnsubscribes from the old item, subscribes to the new. The original change is forwarded.
Remove/RemoveRange/ClearUnsubscribes from removed items. The original change is forwarded.
Moved/RefreshForwarded unchanged.
Property changesA Refresh change is emitted for the item whose property changed.

Worth noting: Each item generates a subscription. For large lists with frequent property changes, use changeSetBuffer and propertyChangeThrottle to reduce churn.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.

See also

2. Overload

public static IObservable<IChangeSet<TObject>> AutoRefresh<TObject, TProperty>(this IObservable<IChangeSet<TObject>> source, Expression<Func<TObject, TProperty>> propertyAccessor, TimeSpan? changeSetBuffer = null, TimeSpan? propertyChangeThrottle = null, IScheduler? scheduler = null) where TObject : INotifyPropertyChanged

:material-source-branch: View source

Inherited documentation

These docs were inherited from ObservableListEx. The member doesn't override them on this type.

Summary: Monitors a single property (selected by propertyAccessor) on each item via INotifyPropertyChanged and emits Refresh changes when that property changes, causing downstream operators to re-evaluate. More efficient than the all-properties overload when only one property (of type TProperty) affects downstream behavior.

Type parameters

NameDescription
TObjectThe type of items, which must implement INotifyPropertyChanged.
TProperty--

Parameters

NameTypeDescription
sourceIObservable>The source IObservable&lt;IChangeSet&lt;TObject&gt;&gt; to monitor for property-driven refresh signals.
propertyAccessorExpression>--
changeSetBuffer = nullTimeSpan?An optional TimeSpan buffer duration to batch multiple refresh signals into a single changeset.
propertyChangeThrottle = nullTimeSpan?An optional TimeSpan throttle applied to each item's property change notifications.
scheduler = null[IScheduler?](#The scheduler for throttle and buffer timing. Defaults to DefaultScheduler.

Returns: IObservable> -- A list changeset stream with additional Refresh changes injected when properties change.

Remarks

Wraps AutoRefreshOnObservable using WhenAnyPropertyChanged() as the re-evaluator. Pair with Filter or [Sort][M:DynamicData.ObservableListEx.Sort--1(System.IObservable{DynamicData.IChangeSet{--0}},System.Collections.Generic.IComparer{--0},DynamicData.SortOptions,System.IObservable{System.Reactive.Unit},System.IObservable{System.Collections.Generic.IComparer{--0}},System.Int32)] to get reactive re-evaluation on property changes.

EventBehavior
Add/AddRangeSubscribes to PropertyChanged on each new item. The original change is forwarded.
ReplaceUnsubscribes from the old item, subscribes to the new. The original change is forwarded.
Remove/RemoveRange/ClearUnsubscribes from removed items. The original change is forwarded.
Moved/RefreshForwarded unchanged.
Property changesA Refresh change is emitted for the item whose property changed.

Worth noting: Each item generates a subscription. For large lists with frequent property changes, use changeSetBuffer and propertyChangeThrottle to reduce churn.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.

See also