Class RoutedPropertyChangingEventArgs<T>
Provides event data for various routed events that track property values changing. Typically the events denote a cancellable action.
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.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 SourceRoutedPropertyChangingEventArgs(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 SourceCancel
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. |
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.
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. |
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. |
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. |
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. |