New to Telerik UI for WinForms? Start a free 30-day trial

Wraps a value so it can participate in property-change-aware binding. Assigning Value raises PropertyChanged, even when the assigned value is unchanged.

Definition

Namespace:Telerik.WinControls.UI.Data

Assembly:Telerik.WinControls.UI.dll

Type Parameters:

T

The type of value stored by the wrapper.

Syntax:

C#
public class ValueItem<T> : INotifyPropertyChanged

Inheritance: objectValueItem<T>

Implements: INotifyPropertyChanged

Constructors

Creates a wrapper whose value is default for T.

C#
public ValueItem()

Creates a wrapper initialized with the specified value.

C#
public ValueItem(T item)
Parameters:itemT

The value to wrap.

Properties

Gets or sets the wrapped value. Every assignment raises PropertyChanged for Value.

C#
public T Value { get; set; }

Methods

Raises PropertyChanged with the specified property name.

C#
protected virtual void OnPropertyChanged(string propertyName)
Parameters:propertyNamestring

The name of the property that changed.

Events

Occurs whenever Value is assigned, including when the new value equals the current value.

C#
public event PropertyChangedEventHandler PropertyChanged

Implements: INotifyPropertyChanged.PropertyChanged

Operators

Extracts the wrapped value.

C#
public static explicit operator T(ValueItem<T> value)
Parameters:valueValueItem<T>

The wrapper to convert.

Returns:

T

The value stored by value.

Wraps a value in a new ValueItem<T>.

C#
public static implicit operator ValueItem<T>(T value)
Parameters:valueT

The value to wrap.

Returns:

ValueItem<T>

A new wrapper containing value.