Click or drag to resize

ViewModel Class

Base class recommended to use for view models across the application. Encapsulates implementations of INotifyPropertyChanged and INotifyDataErrorInfo.
Inheritance Hierarchy
System.Object
  BionicCode.Utilities.Net.Standard.ViewModel.ViewModel
    More...

Namespace:  BionicCode.Utilities.Net.Standard.ViewModel
Assembly:  BionicCode.Utilities.Net.Standard (in BionicCode.Utilities.Net.Standard.dll) Version: 1.0.4
Syntax
public abstract class ViewModel : IViewModel, 
	INotifyPropertyChanged, INotifyDataErrorInfo

The ViewModel type exposes the following members.

Constructors
  NameDescription
Protected methodViewModel
Default constructor
Top
Properties
  NameDescription
Public propertyHasErrors
Gets a value that indicates whether the entity has validation errors.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetErrors
Gets all error messages of the specified property. If the propertyName is null all error messages will be returned.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetPropertyErrors
Gets all error messages of the specified property. If the propertyName is null all error messages will be returned.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodIsValueValid<TValue>
Can be used to check whether a value is valid.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnErrorsChanged
Raised when the validation state of the view model has changed (e.g. error added or removed).
Protected methodOnPropertyChanged
Method called to fire a PropertyChanged event. Also raises the PropertyChanged event to support binding.
Public methodPropertyHasError
Checks whether the specified property has errors or is valid.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodTrySetValue<TValue>(TValue, TValue, String)
Generic property setter. Sets the value of any property of the extending view model by passing in a the corresponding property backing field. Automatically raises the PropertyChanged event for this property.
Protected methodTrySetValue<TValue>(TValue, Func<TValue, ValueTuple<Boolean, IEnumerable<String>>>, TValue, Boolean, Boolean, String)
Sets the value of the referenced property and executes a validation delegate.
Protected methodTrySetValueSilent<TValue>(TValue, TValue, String)
Generic property setter. Silently sets the value of any property of the extending view model by passing in a the corresponding property backing field. Suppresses a PropertyChanged event for this property.
Protected methodTrySetValueSilent<TValue>(TValue, Func<TValue, ValueTuple<Boolean, IEnumerable<String>>>, TValue, Boolean, Boolean, String)
Silently sets the value of the referenced property without raising PropertyChanged and executes a validation delegate.
Top
Events
  NameDescription
Public eventErrorsChanged
Occurs when the validation errors have changed for a property or for the entire entity.
Public eventPropertyChanged
Event fired whenever a child property changes its value.
Public eventPropertyValueChanged
PropertyChanged implementation that sends old value and new value of the change and raises the INotifyPropertyChanged event.
Top
Extension Methods
See Also
Inheritance Hierarchy
https://github.com/BionicCode/BionicCode.Net/blob/master/README.md