Class ViewSerializedParam
The root parameter type that all Param must inherit from. By default all views have this parameter type.
Custom types can be provided for by marking a IModelView with a ViewDescriptorEnumerator which specifies the parameter type for each ViewDescriptorInstance it returns
They can also be specified using the ViewSerializedParamAttribute which a ViewDescriptorEnumerator can use, such as with the IBaseGrid<T> enumerator which looks for this attribute to create custom parameters for the view descriptor instanceInheritance
Inherited Members
Namespace: LemonEdge.Client.Core.Views.Core
Assembly: ClientCore.dll
Syntax
[DataContract]
public class ViewSerializedParam : SerializedParam, ICloneable, ICloneable<ViewSerializedParam>
Properties
IsVisible
Returns if this view is currently visible by ensuring it passes the Visible, VisibleOnlyToRoles and VisibleFormula (from the last EvaluateVisibilityFormula(DisplayableItemDescriptor, ModelLayoutDisplayerController, IModelView, IBaseEntity) call)
Declaration
public bool IsVisible { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
ViewIcon
The default icon for this view
This is *not* serializable it is used as a temporary variable when the user edits these settings in the UI, and updates the actual ViewDescriptorInstance
Declaration
public Guid ViewIcon { get; set; }
Property Value
Type | Description |
---|---|
System.Guid |
ViewName
The user friendly name of this view
This is *not* serializable it is used as a temporary variable when the user edits these settings in the UI, and updates the actual ViewDescriptorInstance
Declaration
public string ViewName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Visible
Indicates if the view should be visible or not. Setting this to false overrides all other visibility settings. The default is true
Declaration
public bool Visible { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
VisibleFormula
A custom formula that works with the FormulaFunctionsWithViewContext to evaluate at runtime if this view should be visible or not
Declaration
public string VisibleFormula { get; set; }
Property Value
Type | Description |
---|---|
System.String |
VisibleOnlyToRoles
Contains a list of roles that this view is visible for
Declaration
public IEnumerable<Guid> VisibleOnlyToRoles { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Guid> |
Methods
AddVisibleOnlyToRole(Guid)
Adds the globally unique id of the role that this view should be visible for
Declaration
public void AddVisibleOnlyToRole(Guid roleID)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | roleID | The id of a role that this view should be visible for |
Clone()
Declaration
public ViewSerializedParam Clone()
Returns
Type | Description |
---|---|
ViewSerializedParam |
CopyFromParam(SerializedParam)
Declaration
protected override void CopyFromParam(SerializedParam source)
Parameters
Type | Name | Description |
---|---|---|
SerializedParam | source |
Overrides
CopyFromSource(ViewSerializedParam)
Declaration
public void CopyFromSource(ViewSerializedParam source)
Parameters
Type | Name | Description |
---|---|---|
ViewSerializedParam | source |
CreateNewParam()
Declaration
protected override SerializedParam CreateNewParam()
Returns
Type | Description |
---|---|
SerializedParam |
Overrides
EvaluateVisibilityFormula(DisplayableItemDescriptor, ModelLayoutDisplayerController, IModelView, IBaseEntity)
Evaluates the VisibleFormula to determine if this view should be visible or not. Stores the result locally so the next call to IsVisible returns the correct result
Declaration
public Task EvaluateVisibilityFormula(DisplayableItemDescriptor displayedItem, ModelLayoutDisplayerController controller, IModelView view, IBaseEntity viewItem)
Parameters
Type | Name | Description |
---|---|---|
DisplayableItemDescriptor | displayedItem | The current root item displayed against the layout this view resides within |
ModelLayoutDisplayerController | controller | The controller for the view this formula is being evaluated against |
IModelView | view | The view this formula is being evaluated against |
IBaseEntity | viewItem | The item this view is displaying |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operation |
RemoveVisibleOnlyToRole(Guid)
Ensures the specified role does not see this view by default
Declaration
public void RemoveVisibleOnlyToRole(Guid roleID)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | roleID | The id of the role that this view should not be visible for |