Mindfire.Binding
1.1.0
dotnet add package Mindfire.Binding --version 1.1.0
NuGet\Install-Package Mindfire.Binding -Version 1.1.0
<PackageReference Include="Mindfire.Binding" Version="1.1.0" />
paket add Mindfire.Binding --version 1.1.0
#r "nuget: Mindfire.Binding, 1.1.0"
// Install Mindfire.Binding as a Cake Addin #addin nuget:?package=Mindfire.Binding&version=1.1.0 // Install Mindfire.Binding as a Cake Tool #tool nuget:?package=Mindfire.Binding&version=1.1.0
Mindfire.Binding
This package is a collection of tools to make binding and validation easier. It borrows from the blog by David Britch on validating Xamarin Forms, but has been slightly extended. This can also be used in platforms other than Xamarin Forms. The original code can be found here: https://github.com/dotnet-architecture/eShopOnContainers/blob/1b7200791931f33c94206822a69644ca820bb0dc/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Validations/ValidatableObject.cs. This package includes the following:
ValidatableObject<T>
An object used to hold a value and validation rules. It supports INotifyPropertyChanged, and so will update the UI or allow devs to be notified when any of its properties are updated.
Value
: The value that should be stored in the object. This is what is used against validations.IsValid
: Whether or not the object passes all validation rulesIsInvalid
: The opposite of IsValidErrors
: IEnumerable<string> that contains all messages from the collection of errorsAllErrors
: The result of running string.Join on the Errors propertyValidations
: ICollection<IValidationRule<T>>. Collection of rules that should be used to validate the object's valueValidate()
: Method to manually cause the object to validate the current value
IValidationRule<T>
An interface that is used to run validations.
ValidationMessage
: This property should be set to whatever you want shown when a validation fails. This is what is returned in theErrors
property of the ValidatableObject.Check(T value)
: The method used to check a given value. This returns a boolean that indicates validity. Use this to run whatever code you need to check validity (e.g. for email addresses, credit cards, etc.).
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Added IsInvalid and AllErrors properties to the ValidationObject