OverlayServiceConfig

The OverlayServiceConfig is used to configure an Overlay Component controlled by the OverlayService.

Actions

Dictionary used to pass actions (function) from the Component (or a Page) who create the Overlay to the Component within the Overlay himself.

The Action Dictionary will be accessible by the Overlay Content (ModalSample:Overlayable) through Overlayable inheritance.

Animation

Property containing all 'animation' properties for this configuration.

TypeDefault Value
NVOverlayAnimationnew NVOverlayAnimation()

Code

private void InitializeConfirm()
{
  NVOverlayServiceConfig overlayConfig = new NVOverlayServiceConfig(NVOverlayServiceConfig.MODAL, "confirm-test", typeof(ConfirmSample),new { MaxWidth = "500px" });
  overlayConfig.Animation.Name = NVOverlayServiceConfig.CONFIRM;
  OverlayService.Initialize(overlayConfig);
}

Name

Unique key used by the OverlayService to identify the Overlay to display.

This name is also used by the overlay component for the 'data-name' dom attributes.

Overlay

Property containing all properties 'overlay' for this configuration.

TypeDefault Value
NVOverlayPropsnew NVOverlayProps()

Code

private void InitializeConfirm()
{
  NVOverlayServiceConfig overlayConfig = new NVOverlayServiceConfig(NVNVOverlayServiceConfig.MODAL, "modal-sample", typeof(ModalSample), new { MaxWidth = "90vw" });
  overlayConfig.AddAction("OnSave", OnSaveModal);
  OverlayService.Initialize(overlayConfig);
}

AddAction

Will add at key actionName an action in the Actions Dictionary.

Parameter NameType
actionNamestring
actionAction<object>
Return type

void

Code

private void InitializeModal()
{
  NSOverlayServiceConfig overlayConfig = new NSOverlayServiceConfig(
    NVOverlayServiceConfig.MODAL, 
    "modal", 
    typeof(ModalSample), 
    new {MaxWidth = "90vw"}
  );
  overlayConfig.AddAction("OnSave", OnSaveModal);
      
  OverlayService.Initialize(oc);
}
        
void OnSaveModal(object data) {
  // do something with data
}