BindingNotification Class

Summary

Represents a binding notification that can be a valid binding value, or a binding or data validation error.
Namespace
Avalonia.Data
Base Types
  • object
graph BT Type-->Base0["object"] Type["BindingNotification"] class Type type-node

Syntax

public class BindingNotification

Remarks

This class is very similar to BindingValue<T>, but where BindingValue<T> is used by typed bindings, this class is used to hold binding and data validation errors in untyped bindings. As Avalonia moves towards using typed bindings by default we may want to remove this class.

Constructors

Name Summary
BindingNotification(Exception, BindingErrorType) Initializes a new instance of the BindingNotification class.
BindingNotification(Exception, BindingErrorType, object) Initializes a new instance of the BindingNotification class.
BindingNotification(object) Initializes a new instance of the BindingNotification class.

Fields

Name Constant Value Summary
Null
A binding notification representing the null value.
static
UnsetValue
A binding notification representing UnsetValue.
static

Properties

Name Value Summary
Error Exception
Gets the error that occurred on the source, if any.
ErrorType BindingErrorType
Gets the type of error that Error represents, if any.
HasValue bool
Gets a value indicating whether Value should be pushed to the target.
Value object
Gets the value that should be passed to the target when HasValue is true.

Methods

Name Value Summary
AddError(Exception, BindingErrorType) void
Adds an error to the BindingNotification.
ClearValue() void
Removes the Value and makes HasValue return null.
Equals(BindingNotification) bool
Compares a value to an instance of BindingNotification for equality.
Equals(object) bool
Compares an object to an instance of BindingNotification for equality.
ExtractError(object) object
Gets an exception from an object that may be a BindingNotification.
static
ExtractValue(object) object
Gets a value from an object that may be a BindingNotification.
static
GetHashCode() int
Gets the hash code for this instance of BindingNotification.
SetValue(object) void
Sets the Value.
ToBindingValue() BindingValue<object>
ToString() string

Operators

Name Value Summary
operator !=(BindingNotification, BindingNotification) bool
operator ==(BindingNotification, BindingNotification) bool