DataValidationErrors
struct · ferroui-controls · v0.5.0
struct DataValidationErrors
A control which displays an error notifier when there is a data validation error. Provides attached properties to track errors on a control.
You will probably only want to create instances inside of control
templates. Pseudo-classes (on the control with the errors): :error.
An error is an untyped value: the error data of a data validation
error, or the error itself boxed as a BindingError.
Members
TYPEto_refPSEUDO_CLASSESerrors_propertyhas_errors_propertyerror_converter_propertyerror_template_propertyowner_propertyconstructnewownerset_ownererror_templateset_error_templateget_errorsset_errorsset_errorclear_errorsget_has_errorsget_error_converterset_error_converter
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<DataValidationErrors>
Returns a strong reference to this object.
PSEUDO_CLASSES
const PSEUDO_CLASSES: PseudoClassesAttribute
The pseudoclasses set by the class.
errors_property
fn errors_property() -> &'static AttachedProperty<Option<Vec<BoxedValue>>>
Defines the DataValidationErrors.Errors attached property.
has_errors_property
fn has_errors_property() -> &'static AttachedProperty<bool>
Defines the DataValidationErrors.HasErrors attached property.
error_converter_property
fn error_converter_property() -> &'static AttachedProperty<Option<ErrorConverter>>
Defines the DataValidationErrors.ErrorConverter attached
property.
error_template_property
fn error_template_property() -> &'static StyledProperty<Option<Rc<dyn IDataTemplate>>>
Defines the DataValidationErrors.ErrorTemplate property.
owner_property
fn owner_property() -> &'static DirectProperty<DataValidationErrors, Option<ElementRef<Control>>>
Defines the Owner property.
Deviation (DEVIATIONS.md, Data validation): the owner is the
control the errors are shown in, an ancestor of this control,
which this control does not own, so the value is an element
reference where the managed property holds the control. The themes make it the DataContext of a
part of the template (DataContext="{TemplateBinding Owner}"),
which holds the reference as it is.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Initializes a new instance of the DataValidationErrors class.
owner
fn owner(self: &Self) -> Option<Ref<Control>>
The control whose errors are displayed.
set_owner
fn set_owner(self: &Self, value: Option<Ref<Control>>)
error_template
fn error_template(self: &Self) -> Option<Rc<dyn IDataTemplate>>
The data template of the errors.
set_error_template
fn set_error_template(self: &Self, value: Option<Rc<dyn IDataTemplate>>)
get_errors
fn get_errors(control: &Control) -> Option<Vec<BoxedValue>>
Gets the errors of a control.
set_errors
fn set_errors(control: &Control, errors: Option<Vec<BoxedValue>>)
Sets the errors of a control.
set_error
fn set_error(control: &Control, error: Option<&BindingError>)
Sets the errors of a control from the error of a binding.
clear_errors
fn clear_errors(control: &Control)
Clears the errors of a control.
get_has_errors
fn get_has_errors(control: &Control) -> bool
Whether a control has errors.
get_error_converter
fn get_error_converter(control: &Control) -> Option<ErrorConverter>
Gets the error converter of a control.
set_error_converter
fn set_error_converter(control: &Control, converter: Option<ErrorConverter>)
Sets the error converter of a control.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeTemplatedControlImplExtContentControlImplExtControlImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<DataValidationErrors>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplVisualImplLayoutableImplInteractiveImplInputElementImplControlImplTemplatedControlImplContentControlImplFerroObjectImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.