Show / Hide Table of Contents

Class RoutedPropertyChangingEventArgs<T>

Provides event data for various routed events that track property values changing. Typically the events denote a cancellable action.

Inheritance
System.Object
System.EventArgs
RoutedEventArgs
RoutedPropertyChangingEventArgs<T>
Inherited Members
RoutedEventArgs.OriginalSource
System.EventArgs.Empty
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Controls
Assembly: OpenSilver.Controls.dll
Syntax
public class RoutedPropertyChangingEventArgs<T> : RoutedEventArgs
Type Parameters
Name Description
T

The type of the value for the dependency property that is changing.

Constructors

| Improve this Doc View Source

RoutedPropertyChangingEventArgs(DependencyProperty, T, T, Boolean)

Initializes a new instance of the RoutedPropertyChangingEventArgs<T> class.

Declaration
public RoutedPropertyChangingEventArgs(DependencyProperty property, T oldValue, T newValue, bool isCancelable)
Parameters
Type Name Description
DependencyProperty property

The DependencyProperty identifier for the property that is changing.

T oldValue

The previous value of the property.

T newValue

The new value of the property, assuming that the property change is not cancelled.

System.Boolean isCancelable

True if the property change is cancellable by setting Cancel to true in event handling. false if the property change is not cancellable.

Properties

| Improve this Doc View Source

Cancel

Gets or sets a value indicating whether the property change that originated the RoutedPropertyChanging event should be cancelled.

Declaration
public bool Cancel { get; set; }
Property Value
Type Description
System.Boolean

True to cancel the property change; this resets the property to OldValue. false to not cancel the property change; the value changes to NewValue.

Exceptions
Type Condition
System.InvalidOperationException

Attempted to cancel in an instance where IsCancelable is false.

| Improve this Doc View Source

InCoercion

Gets or sets a value indicating whether internal value coercion is acting on the property change that originated the RoutedPropertyChanging event.

Declaration
public bool InCoercion { get; set; }
Property Value
Type Description
System.Boolean

True if coercion is active. false if coercion is not active.

Remarks

This is a total hack to work around the class hierarchy for Value coercion in NumericUpDown.

| Improve this Doc View Source

IsCancelable

Gets a value indicating whether the property change that originated the RoutedPropertyChanging event is cancellable.

Declaration
public bool IsCancelable { get; }
Property Value
Type Description
System.Boolean

True if the property change is cancellable. false if the property change is not cancellable.

| Improve this Doc View Source

NewValue

Gets or sets a value that reports the new value of the changing property, assuming that the property change is not cancelled.

Declaration
public T NewValue { get; set; }
Property Value
Type Description
T

The new value of the changing property.

| Improve this Doc View Source

OldValue

Gets a value that reports the previous value of the changing property.

Declaration
public T OldValue { get; }
Property Value
Type Description
T

The previous value of the changing property.

| Improve this Doc View Source

Property

Gets the DependencyProperty identifier for the property that is changing.

Declaration
public DependencyProperty Property { get; }
Property Value
Type Description
DependencyProperty

The DependencyProperty identifier for the property that is changing.

  • Improve this Doc
  • View Source