ViewRegistryCreateViewT Method (Object, Type)

Spotfire 14.3 API Reference
Creates and binds a view object of type T to the specified model object. The specified modelType is used to determine the type of the specified model object when the view type is looked up.

Namespace:  Spotfire.Dxp.Framework.ApplicationModel
Assembly:  Spotfire.Dxp.Framework (in Spotfire.Dxp.Framework.dll) Version: 65.0.19510.3242 (65.0.19510.3242)
Syntax

C#
public T CreateView<T>(
	Object model,
	Type modelType
)
where T : class

Parameters

model
Type: SystemObject
The model object to be bound to the returned View. It will be supplied as the argument to the view's constructor. The model object must be assignable to the speficied modelType.
modelType
Type: SystemType
The model object type used as key when looking up the view type.

Type Parameters

T
The view base or interface type to search for. The type to cast the returned view to.

Return Value

Type: T
A view bound to model, or null if none is found or if the created view cannot be casted to T (it will be created anyway, if possible). The returned view's type will be assignable to T
Exceptions

ExceptionCondition
InvalidOperationExceptionIf the required constructor cannot be found.
ExceptionIf the view's constructor throws an Exception that exception will be re-thrown. If the view cannot be constructed for other reasons.
Remarks

The view found in the register must have a public constructor taking one argument of type modelType.
Version Information

Supported in: 14.3, 14.2, 14.1, 14.0, 12.5, 12.4, 12.3, 12.2, 12.1, 12.0, 11.8
See Also

Reference