Class ObservableClass
Class ObservableClass. Implements the IObservableClass
Inheritance
Implements
Namespace: ISynergy.Framework.Core.Base
Assembly: ISynergy.Framework.Core.dll
Syntax
public abstract class ObservableClass : object, IObservableClass, IBindable
Constructors
View SourceObservableClass(Boolean)
Initializes a new instance of the ObservableClass class.
Declaration
protected ObservableClass(bool automaticValidationTrigger = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | automaticValidationTrigger | The validation. |
Properties
View SourceAutomaticValidationTrigger
Automatic validation trigger.
Declaration
public bool AutomaticValidationTrigger { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Error
Declaration
public string Error { get; }
Property Value
Type | Description |
---|---|
System.String |
Errors
Declaration
public ObservableCollection<KeyValuePair<string, string>> Errors { get; }
Property Value
Type | Description |
---|---|
ObservableCollection<KeyValuePair<System.String, System.String>> |
HasErrors
Declaration
public bool HasErrors { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsDirty
Gets a value indicating whether this instance is dirty.
Declaration
public bool IsDirty { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsValid
Returns true if ... is valid.
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Item[String]
Declaration
public string this[string propertyName] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName |
Property Value
Type | Description |
---|---|
System.String |
Properties
Gets the properties.
Declaration
public Dictionary<string, IProperty> Properties { get; }
Property Value
Type | Description |
---|---|
Dictionary<System.String, IProperty> | The properties. |
Validator
Gets or sets the validator.
Declaration
public Action<IObservableClass> Validator { get; set; }
Property Value
Type | Description |
---|---|
Action<IObservableClass> | The validator. |
Methods
View SourceAddValidationError(String, String)
Declaration
public void AddValidationError(string propertyName, string errorMessage)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | |
System.String | errorMessage |
ClearErrors()
Clears the errors.
Declaration
public bool ClearErrors()
Returns
Type | Description |
---|---|
System.Boolean |
|
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(Boolean)
Releases unmanaged and - optionally - managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
|
Equals(Object)
Checks if both objects are the same based on common identity property.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetErrors(String)
Declaration
public IEnumerable GetErrors(string propertyName)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName |
Returns
Type | Description |
---|---|
IEnumerable |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
GetValue<T>(String)
Gets the value.
Declaration
protected T GetValue<T>(string propertyName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | Name of the property. |
Returns
Type | Description |
---|---|
T | T. |
Type Parameters
Name | Description |
---|---|
T |
MarkAsClean()
Marks as clean.
Declaration
public void MarkAsClean()
OnErrorsChanged(String)
Declaration
public virtual void OnErrorsChanged(string propertyName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName |
OnPropertyChanged(String)
Called when [property changed].
Declaration
public virtual void OnPropertyChanged(string propertyName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | Name of the property. |
Revert()
Reverts this instance.
Declaration
public void Revert()
SetValue<T>(T, String)
Sets the value.
Declaration
protected void SetValue<T>(T value, string propertyName = null)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value. |
System.String | propertyName | Name of the property. |
Type Parameters
Name | Description |
---|---|
T |
SetValue<T>(ref T, T, String)
Sets the value.
Declaration
protected void SetValue<T>(ref T field, T value, string propertyName = null)
Parameters
Type | Name | Description |
---|---|---|
T | field | The field. |
T | value | The value. |
System.String | propertyName | Name of the property. |
Type Parameters
Name | Description |
---|---|
T |
Validate(Boolean)
Validates this instance.
Declaration
public bool Validate(bool validateUnderlayingProperties = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | validateUnderlayingProperties |
Returns
Type | Description |
---|---|
System.Boolean |
|
Events
View SourceErrorsChanged
Declaration
public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged
Event Type
Type | Description |
---|---|
EventHandler<DataErrorsChangedEventArgs> |
PropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
PropertyChangedEventHandler |