PropertyBagBase..::..GetDefault<(Of <(<'T>)>)> Method

Fetches a value, using the default value it if it doesn't exist.

Namespace:  Tortuga.Anchor.Modeling.Internals
Assembly:  Tortuga.Anchor (in Tortuga.Anchor.dll)

Syntax


public T GetDefault<T>(
	T defaultValue,
	string propertyName
)
Public Function GetDefault(Of T) ( _
	defaultValue As T, _
	propertyName As String _
) As T

Type Parameters

T
Expected type

Parameters

defaultValue
Type: T
Default value to use
propertyName
Type: String
Case-sensitive property name

Return Value

Exceptions


ExceptionCondition
[ArgumentNullException]propertyName;propertyName is null
[ArgumentException]propertyName is empty;propertyName
[InvalidOperationException]Property + propertyName + contains a null

Remarks


Storing the default value will trigger validation but not a property-changed event.