namespace Terminal.Gui.App;
///
/// Provides data for events that allow modification or cancellation of a property change in the Cancellable Work Pattern (CWP).
///
///
///
/// Used in pre-change events raised by to allow handlers to
/// modify the proposed value or cancel the change, such as for or
/// .
///
///
/// The type of the property value, which may be a nullable reference type (e.g., ?).
///
///
public class ValueChangingEventArgs
{
///
/// Gets the current value before the change.
///
public T CurrentValue { get; }
///
/// Gets or sets the proposed new value, which can be modified by event handlers.
///
public T NewValue { get; set; }
///
/// Gets or sets a value indicating whether the change has been handled. If true, the change is cancelled.
///
public bool Handled { get; set; }
///
/// Initializes a new instance of the class.
///
/// The current value before the change, which may be null for nullable types.
/// The proposed new value, which may be null for nullable types.
public ValueChangingEventArgs (T currentValue, T newValue)
{
CurrentValue = currentValue;
NewValue = newValue;
}
}