Show / Hide Table of Contents

Class ObservableWrap<T, TCollection>

Base class for observable collection wrappers.

Inheritance
object
NotifyPropertyChangeBase
NotifyPropertyChanged
ObservableWrapBase
ObservableWrap<T, TCollection>
ObservableCollectionWrap<T>
ObservableDictionaryWrap<TKey, TValue>
ObservableListWrap<T>
Implements
INotifyPropertyChangeBase
IRefreshable
INotifyPropertyChanged
INotifyCollectionChanged
ICollection<T>
IEnumerable<T>
IEnumerable
Inherited Members
ObservableWrapBase.CollectionChanged
ObservableWrapBase.RaiseCollectionChanged(NotifyCollectionChangedEventArgs)
ObservableWrapBase.IndexOf(object)
ObservableWrapBase.RefreshItem(object)
ObservableWrapBase.Contains(object)
NotifyPropertyChanged.PropertyChanged
NotifyPropertyChanged.Notify(params string[])
NotifyPropertyChanged.Notify(string)
NotifyPropertyChanged.RaisePropertyChangeEvent(in string, in PropertyChangeNotificationType)
NotifyPropertyChanged.OnDoChange<T>(ref T, T, string)
NotifyPropertyChangeBase.OnInitialize(NotifyPropertyChangeBase.IPropertyBroadcastSetup)
NotifyPropertyChangeBase.Subscribe(PropertyInfo, PropertyChangeObserver)
NotifyPropertyChangeBase.Subscribe(PropertyChangeObserver)
NotifyPropertyChangeBase.Subscribe(Expression<Func<object>>, PropertyChangeObserver)
NotifyPropertyChangeBase.Unsubscribe(PropertyChangeObserver)
NotifyPropertyChangeBase.Unsubscribe(PropertyInfo)
NotifyPropertyChangeBase.Unsubscribe(Expression<Func<object>>)
NotifyPropertyChangeBase.Change<T>(ref T, T, string)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Types.Base
Assembly: MCART.Mvvm.dll
Syntax
public abstract class ObservableWrap<T, TCollection> : ObservableWrapBase, INotifyPropertyChangeBase, IRefreshable, INotifyPropertyChanged, INotifyCollectionChanged, ICollection<T>, IEnumerable<T>, IEnumerable where TCollection : ICollection<T>
Type Parameters
Name Description
T

Type of elements in the collection.

TCollection

Type of the collection.

Constructors

| Edit this page View Source

ObservableWrap()

Initializes a new instance of the ObservableWrap<T, TCollection> class.

Declaration
protected ObservableWrap()
| Edit this page View Source

ObservableWrap(TCollection)

Initializes a new instance of the ObservableWrap<T, TCollection> class.

Declaration
protected ObservableWrap(TCollection collection)
Parameters
Type Name Description
TCollection collection

Initial underlying collection.

Properties

| Edit this page View Source

Count

Gets the number of elements contained in the collection.

Declaration
public int Count { get; }
Property Value
Type Description
int
| Edit this page View Source

IsReadOnly

Gets a value indicating whether the collection is read-only.

Declaration
public bool IsReadOnly { get; }
Property Value
Type Description
bool
| Edit this page View Source

UnderlyingCollection

Gets direct access to the underlying collection wrapped by this ObservableWrap<T, TCollection>.

Declaration
public TCollection? UnderlyingCollection { get; }
Property Value
Type Description
TCollection

Methods

| Edit this page View Source

Add(T)

Adds a new item to the end of the collection.

Declaration
public void Add(T item)
Parameters
Type Name Description
T item

Item to add.

| Edit this page View Source

Clear()

Clears the collection.

Declaration
public void Clear()
| Edit this page View Source

Contains(T)

Determines whether the underlying sequence contains the specified item.

Declaration
public virtual bool Contains(T item)
Parameters
Type Name Description
T item

Item to locate in the sequence.

Returns
Type Description
bool

true if the sequence contains the specified item; otherwise, false.

| Edit this page View Source

CopyTo(T[], int)

Copies the elements of this collection to an array.

Declaration
public void CopyTo(T[] array, int arrayIndex)
Parameters
Type Name Description
T[] array

Destination array.

int arrayIndex

Index in the destination at which copying begins.

| Edit this page View Source

GetEnumerator()

Gets an enumerator that iterates through the collection.

Declaration
public IEnumerator<T> GetEnumerator()
Returns
Type Description
IEnumerator<T>

An enumerator that can be used to iterate over the collection.

| Edit this page View Source

OnGetEnumerator()

Gets an enumerator that iterates through the collection.

Declaration
protected override IEnumerator OnGetEnumerator()
Returns
Type Description
IEnumerator

An enumerator that can be used to iterate over the collection.

Overrides
ObservableWrapBase.OnGetEnumerator()
| Edit this page View Source

Refresh()

Forces a notification that the collection has changed.

Declaration
public override void Refresh()
Overrides
NotifyPropertyChangeBase.Refresh()
| Edit this page View Source

Remove(T)

Removes an item from the collection.

Declaration
public bool Remove(T item)
Parameters
Type Name Description
T item

Item to remove.

Returns
Type Description
bool

true if the item was successfully removed from the collection; false otherwise. Also returns false if the item did not exist in the original ICollection<T>.

| Edit this page View Source

Replace(TCollection)

Removes all items from the underlying collection and replaces them with the items from the specified collection.

Declaration
public void Replace(TCollection newCollection)
Parameters
Type Name Description
TCollection newCollection

Collection whose items will be added to the underlying collection.

| Edit this page View Source

Substitute(TCollection?)

Replaces the underlying collection with a new one.

Declaration
public void Substitute(TCollection? newCollection)
Parameters
Type Name Description
TCollection newCollection

The collection to set as the underlying collection.

Implements

INotifyPropertyChangeBase
IRefreshable
INotifyPropertyChanged
INotifyCollectionChanged
ICollection<T>
IEnumerable<T>
IEnumerable

Extension Methods

CollectionExtensions.AddRangeAsync<T>(ICollection<T>, IAsyncEnumerable<T>)
CollectionExtensions.AddRange<T>(ICollection<T>, IEnumerable<T>)
CollectionExtensions.PopFirst<T>(ICollection<T>)
CollectionExtensions.Pop<T>(ICollection<T>)
CollectionExtensions.Push<TItem, TCollection>(ICollection<TCollection>)
CollectionExtensions.Push<TItem, TCollection>(ICollection<TCollection>, TItem)
CollectionExtensions.RemoveAll<T>(ICollection<T>)
CollectionExtensions.RemoveAll<T>(ICollection<T>, in Action<T>)
CollectionExtensions.RemoveAll<T>(ICollection<T>, in Predicate<T>)
CollectionExtensions.RemoveAll<T>(ICollection<T>, in Predicate<T>?, in Action<T>?)
CollectionExtensions.RemoveOf<TItem, TRemove>(ICollection<TItem>)
MvvmCollectionExtensions.ToObservable<T>(ICollection<T>)
CollectionHelpers.WithIndex<T>(IEnumerable<T>)
EnumerableExtensions.AreAllEqual<T>(IEnumerable<T>)
EnumerableExtensions.AreAllEqual<T, TProp>(IEnumerable<T>, Func<T, TProp>)
EnumerableExtensions.Copy<T>(IEnumerable<T>)
EnumerableExtensions.ExceptFor<T>(IEnumerable<T>, params T[])
EnumerableExtensions.FindIndexOf<T>(IEnumerable<T>, T)
EnumerableExtensions.FirstOf<T>(IEnumerable<T>, Type)
EnumerableExtensions.Interleave<T>(IEnumerable<T>, IEnumerable<T>)
EnumerableExtensions.IsPropertyEqual<T>(IEnumerable<T>, Func<T, object>)
EnumerableExtensions.IsQuorum<T>(IEnumerable<T>, int, out T)
EnumerableExtensions.NonDefaults<T>(IEnumerable<T?>)
EnumerableExtensions.OfType<T>(IEnumerable<T>, Type)
EnumerableExtensions.OrNull<T>(IEnumerable<T>)
EnumerableExtensions.PickAsync<T>(IEnumerable<T>)
EnumerableExtensions.Pick<T>(IEnumerable<T>)
EnumerableExtensions.Pick<T>(IEnumerable<T>, in Random)
EnumerableExtensions.Quorum<T>(IEnumerable<T>, int)
EnumerableExtensions.Range<T>(IEnumerable<T>, int, int)
EnumerableExtensions.Rotate<T>(IEnumerable<T>, int)
EnumerableExtensions.SelectAsync<TIn, TOut>(IEnumerable<TIn>, Func<TIn, Task<TOut>>)
EnumerableExtensions.Shift<T>(IEnumerable<T>, int)
EnumerableExtensions.Shuffled<T>(IEnumerable<T>)
EnumerableExtensions.Shuffled<T>(IEnumerable<T>, in int)
EnumerableExtensions.Shuffled<T>(IEnumerable<T>, in int, in int)
EnumerableExtensions.Shuffled<T>(IEnumerable<T>, in int, in int, in int, in Random)
EnumerableExtensions.Slice<T>(IEnumerable<T>, int)
EnumerableExtensions.ToExtendedListAsync<T>(IEnumerable<T>)
EnumerableExtensions.ToExtendedList<T>(IEnumerable<T>)
EnumerableExtensions.ToListAsync<T>(IEnumerable<T>)
EnumerableExtensions.YieldAsync<T>(IEnumerable<T>, Func<T, Task>)
CollectionHelpers.ToTypes(IEnumerable)
EnumerableExtensions.Contains(IEnumerable, object?)
EnumerableExtensions.ContainsAll(IEnumerable, IEnumerable)
EnumerableExtensions.ContainsAll(IEnumerable, params object?[])
EnumerableExtensions.ContainsAny(IEnumerable, IEnumerable)
EnumerableExtensions.ContainsAny(IEnumerable, params object?[])
EnumerableExtensions.Count(IEnumerable)
EnumerableExtensions.FirstOf<T>(IEnumerable)
EnumerableExtensions.GroupByType(IEnumerable)
EnumerableExtensions.IsAnyOf(IEnumerable, Type)
EnumerableExtensions.IsAnyOf<T>(IEnumerable)
EnumerableExtensions.ItemsEqual(IEnumerable, IEnumerable)
EnumerableExtensions.NotNull(IEnumerable?)
EnumerableExtensions.NullCount(IEnumerable)
EnumerableExtensions.ToGeneric(IEnumerable)
Objects.ShallowCopyTo(object, object, Type)
ObjectExtensions.FieldsOf<T>(object)
ObjectExtensions.GetAttribute<T>(object)
ObjectExtensions.GetAttributes<T>(object)
ObjectExtensions.HasAttrValue<TAttribute, TValue>(object, out TValue)
ObjectExtensions.HasAttribute<T>(object)
ObjectExtensions.HasAttribute<T>(object, out T?)
ObjectExtensions.HasAttributes<T>(object, out IEnumerable<T>?)
ObjectExtensions.Is(object?, object?)
ObjectExtensions.IsEither(object, IEnumerable)
ObjectExtensions.IsEither(object, params object[])
ObjectExtensions.IsNeither(object, IEnumerable)
ObjectExtensions.IsNeither(object, params object[])
ObjectExtensions.IsNot(object?, object?)
ObjectExtensions.PropertiesOf<T>(object)
ObjectExtensions.WhichAre(object, IEnumerable<object>)
ObjectExtensions.WhichAre(object, params object[])
Common.IfNotNull<T>(T?, Action<T>)
Objects.Itself<T>(T)
Objects.ShallowCopyTo<T>(T, T)
ObservingCommandBuilder.Create<T>(T, Action)
ObservingCommandBuilder.Create<T>(T, Action<object?>)
ObservingCommandBuilder.Create<T>(T, Func<object?, Task>)
ObservingCommandBuilder.Create<T>(T, Func<Task>)
ObservingCommandBuilder.Create<T, TParam>(T, Action<TParam>)
ObservingCommandBuilder.Create<T, TParam>(T, Func<TParam, Task>)
CollectionExtensions.PushInto<TItem, TCollection>(TItem, ICollection<TCollection>)
DictionaryExtensions.PushInto<TKey, TValue>(TValue, TKey, IDictionary<TKey, TValue>)
EnumerableExtensions.Locked<T>(T, Action<T>)
EnumerableExtensions.Locked<T, TResult>(T, Func<T, TResult>)
NotifyPropertyChangeBaseExtensions.Subscribe<T>(T, Expression<Func<T, object?>>, PropertyChangeObserver)
NotifyPropertyChangeBaseExtensions.Unsubscribe<T>(T, Expression<Func<T, object?>>)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX