Class NavigationOptions
- Namespace
- GroupeIsa.Neos.Designer.UIAbstractions
- Assembly
- GroupeIsa.Neos.Designer.UIAbstractions.dll
Represents the navigation options.
[ExcludeFromCodeCoverage]
[SuppressMessage("Minor Code Smell", "S2325:Methods and properties that don't access instance data should be static", Justification = "Stubs for transpilation.")]
public class NavigationOptions
- Inheritance
-
NavigationOptions
- Inherited Members
Constructors
NavigationOptions(RemoteId, string)
Initializes a new instance of the NavigationOptions class.
public NavigationOptions(RemoteId remoteId, string uiViewName)
Parameters
NavigationOptions(UIViewId)
Initializes a new instance of the NavigationOptions class.
public NavigationOptions(UIViewId uiViewId)
Parameters
uiViewIdUIViewIdUI view id.
NavigationOptions(string)
Initializes a new instance of the NavigationOptions class.
public NavigationOptions(string uiViewName)
Parameters
uiViewNamestringUI view name.
Properties
Callback
Gets or sets the callback function called when the UI view is closed.
public Action<NavigationResult> Callback { get; set; }
Property Value
Closeable
Gets or sets a value indicating whether the view is closeable by the user.
public bool? Closeable { get; set; }
Property Value
- bool?
ContainerId
Gets or sets the container identifier.
public string? ContainerId { get; set; }
Property Value
Datasource
Gets or sets the shared data source.
public IDatasource<IUIView>? Datasource { get; set; }
Property Value
Filter
Gets the filter.
public Filter? Filter { get; }
Property Value
FrameId
Gets or sets the frame identifier.
public string? FrameId { get; set; }
Property Value
Icon
Gets or sets the icon.
public string Icon { get; set; }
Property Value
IconId
Gets the icon id.
public ImageId? IconId { get; }
Property Value
Parameters
Gets the parameters.
public NavigationParameters Parameters { get; }
Property Value
PopupPosition
Gets or sets the popup position.
public PopupPosition PopupPosition { get; set; }
Property Value
PopupSize
Gets or sets the popup size.
public PopupSize PopupSize { get; set; }
Property Value
Position
Gets or sets the position of the shared data source at the opening.
public int? Position { get; set; }
Property Value
- int?
RemoteId
Gets the remote id.
public RemoteId RemoteId { get; }
Property Value
Target
Gets or sets the type of target where the navigation will occur (e.g. NewFrame, NestedFrame, SameFrame, Popup, etc.).
public NavigationTarget Target { get; set; }
Property Value
Title
Gets or sets the title.
public string? Title { get; set; }
Property Value
Remarks
ℹ️ Prefer leaving this value undefined when the title can come from the menu caption or the UI View metadata.
UIViewId
Gets the UI view id.
public UIViewId UIViewId { get; }
Property Value
UIViewName
Gets or sets the UI view name.
public string UIViewName { get; set; }
Property Value
UrlParameters
Gets the URL parameters.
public ReadOnlyDictionary<string, string> UrlParameters { get; }
Property Value
Methods
OnTarget(NavigationTarget)
Sets the type of target where the navigation will occur (e.g. NewFrame, NestedFrame, SameFrame, Popup, etc.).
public NavigationOptions OnTarget(NavigationTarget target)
Parameters
targetNavigationTargetType of target where the navigation will occur (e.g. NewFrame, NestedFrame, SameFrame, Popup, etc.).
Returns
- NavigationOptions
The navigation options.
WithCallback(Action<NavigationResult>)
Sets the callback function called when the UI view is closed.
public NavigationOptions WithCallback(Action<NavigationResult> callback)
Parameters
callbackAction<NavigationResult>The callback action.
Returns
- NavigationOptions
The navigation options.
WithCallback<TValue>(Action<NavigationResult<TValue>>)
Sets the callback function called when the UI view is closed.
public NavigationOptions WithCallback<TValue>(Action<NavigationResult<TValue>> callback)
Parameters
callbackAction<NavigationResult<TValue>>The callback action.
Returns
- NavigationOptions
The navigation options.
Type Parameters
TValueType of the result value.
WithCloseable(bool?)
Sets the value indicating whether the view is closeable by the user.
public NavigationOptions WithCloseable(bool? closeable)
Parameters
closeablebool?Value indicating whether the view is closeable by the user.
Returns
- NavigationOptions
The navigation options.
WithCloseableOnClickOutside(bool?)
Sets the value indicating whether the view is closeable by the user on click outside.
public NavigationOptions WithCloseableOnClickOutside(bool? closeableOnClickOutside)
Parameters
closeableOnClickOutsidebool?Value indicating whether the view is closeable by the user on click outside.
Returns
- NavigationOptions
The navigation options.
WithContainerId(string?)
Sets the container identifier.
public NavigationOptions WithContainerId(string? containerId)
Parameters
containerIdstringContainer identifier.
Returns
- NavigationOptions
The navigation options.
WithCreationMode(bool?, object?)
Adds the creation mode parameter.
public NavigationOptions WithCreationMode(bool? creationMode, object? creationData = null)
Parameters
creationModebool?A value indicating whether the UI view is opened in creation mode.
creationDataobjectObject that contains data used to set initialize value in the opened UI view. The names of the object properties must match the names of the UI view properties using PascalCase.
Returns
- NavigationOptions
The navigation options.
WithDataSharing<TUIView>(IDatasource<TUIView>?, int?)
Sets the data source to share with the view to open and the position at the opening.
public NavigationOptions WithDataSharing<TUIView>(IDatasource<TUIView>? datasource, int? position) where TUIView : class, IUIView
Parameters
datasourceIDatasource<TUIView>Shared datasource.
positionint?Position at the opening.
Returns
- NavigationOptions
The navigation options.
Type Parameters
TUIViewUI view type.
WithFilter(Filter?)
Sets the filter.
public NavigationOptions WithFilter(Filter? filter)
Parameters
filterFilterFilter.
Returns
- NavigationOptions
The navigation options.
WithFrameId(string?)
Sets the tab identifier.
public NavigationOptions WithFrameId(string? frameId)
Parameters
frameIdstringFrame identifier.
Returns
- NavigationOptions
The navigation options.
WithIcon(string?)
Sets the icon.
[Obsolete("Using string literals for image name is error-prone. Use WithIconId(Images.MyImage) to benefit from compile-time safety.", false)]
public NavigationOptions WithIcon(string? icon)
Parameters
iconstringIcon.
Returns
- NavigationOptions
The navigation options.
WithIconId(ImageId?)
Sets the icon.
public NavigationOptions WithIconId(ImageId? icon)
Parameters
iconImageIdIcon.
Returns
- NavigationOptions
The navigation options.
WithId(Dictionary<string, object>?)
Adds the identifier parameter.
public NavigationOptions WithId(Dictionary<string, object>? id)
Parameters
idDictionary<string, object>Identifier.
Returns
- NavigationOptions
The navigation options.
WithNewParameters()
Disables the view context inheritance and resets the parameters.
public NavigationOptions WithNewParameters()
Returns
- NavigationOptions
The navigation options.
WithNewParameters(NavigationParameters)
Disables the view context inheritance and sets the new parameters.
public NavigationOptions WithNewParameters(NavigationParameters parameters)
Parameters
parametersNavigationParametersParameters.
Returns
- NavigationOptions
The navigation options.
Remarks
ℹ️ If the browser window is refreshed, those parameters will be lost. Therefore, if the UI view needs the parameter(s) even after a browser refresh, consider using WithUrlParameter(string, string) (or WithUrlParameters(Dictionary<string, string>)) instead.
WithNewUrlParameters()
Resets the frame's URL parameters.
public NavigationOptions WithNewUrlParameters()
Returns
- NavigationOptions
The navigation options.
WithNewUrlParameters(Dictionary<string, string>)
Resets the frame URL parameters and adds new URL parameters for the next frame (and that frame only).
public NavigationOptions WithNewUrlParameters(Dictionary<string, string> extraParameters)
Parameters
extraParametersDictionary<string, string>Extra parameters for the frame.
Returns
- NavigationOptions
The navigation options.
Remarks
ℹ️ When being written to and read from the URL, this parameter will be prefixed with 'f_' to be differentiated from global URL parameters.
WithPageNumber(int?)
Adds the page number parameter.
public NavigationOptions WithPageNumber(int? pageNumber)
Parameters
pageNumberint?Page number.
Returns
- NavigationOptions
The navigation options.
WithParameter(string, object?)
Adds a parameter.
public NavigationOptions WithParameter(string key, object? value)
Parameters
Returns
- NavigationOptions
The navigation options.
Remarks
ℹ️ If the browser window is refreshed, those parameters will be lost. Therefore, if the UI view requires the parameter(s) even after a browser refresh, consider using WithUrlParameter(string, string) (or WithUrlParameters(Dictionary<string, string>)) instead.
WithParameters(Dictionary<string, object>)
Adds parameters to the navigation options. They are merged with the existing parameters, if any. In case of conflicts, the new parameters take precedence over the existing ones.
public NavigationOptions WithParameters(Dictionary<string, object> parameters)
Parameters
parametersDictionary<string, object>Parameters.
Returns
- NavigationOptions
The navigation options.
Remarks
ℹ️ If the browser window is refreshed, those parameters will be lost. Therefore, if the UI view requires the parameter(s) even after a browser refresh, consider using WithUrlParameter(string, string) (or WithUrlParameters(Dictionary<string, string>)) instead.
WithPopupMaximizable(bool)
Sets the popup maximizable.
public NavigationOptions WithPopupMaximizable(bool popupMaximizable)
Parameters
popupMaximizableboolThe popup maximizable.
Returns
- NavigationOptions
The navigation options.
WithPopupPosition(PopupPosition)
Sets the popup position.
public NavigationOptions WithPopupPosition(PopupPosition popupPosition)
Parameters
popupPositionPopupPositionThe popup position.
Returns
- NavigationOptions
The navigation options.
WithPopupSize(PopupSize)
Sets the popup size.
public NavigationOptions WithPopupSize(PopupSize popupSize)
Parameters
popupSizePopupSizeThe popup size.
Returns
- NavigationOptions
The navigation options.
WithRecordsByPage(int?)
Adds the records by page parameter.
public NavigationOptions WithRecordsByPage(int? recordsByPage)
Parameters
recordsByPageint?Records by page.
Returns
- NavigationOptions
The navigation options.
WithTitle(string?)
Sets the title.
public NavigationOptions WithTitle(string? title)
Parameters
titlestringTitle.
Returns
- NavigationOptions
The navigation options.
WithUIViewId(UIViewId)
Sets the destination of the navigation event.
public NavigationOptions WithUIViewId(UIViewId id)
Parameters
idUIViewIdId of the UIView.
Returns
- NavigationOptions
The navigation options.
WithUIViewName(string)
Sets the destination of the navigation event.
[Obsolete("Using string literals or nameof(...) for UI view name is error-prone. Use WithUIViewId(UIViews.MyView) to benefit from compile-time safety.", false)]
public NavigationOptions WithUIViewName(string id)
Parameters
idstringName of the UIView.
Returns
- NavigationOptions
The navigation options.
WithUrlParameter(string, string)
Adds one URL parameter for the next frame (and that frame only). The parameter is merged with the existing ones, if any. In case of conflicts, the new parameter takes precedence over the existing ones.
public NavigationOptions WithUrlParameter(string key, string value)
Parameters
keystringThe name of the extra parameter for the frame.
valuestringString parameter value. Cannot be null.
Returns
- NavigationOptions
The navigation options.
Remarks
ℹ️ When being written to and read from the URL, this parameter will be prefixed with 'f_' to be differentiated from global URL parameters.
WithUrlParameters(Dictionary<string, string>)
Adds URL parameters for the next frame (and that frame only). The parameters are merged with the existing ones, if any. In case of conflicts, the new parameters take precedence over the existing ones.
public NavigationOptions WithUrlParameters(Dictionary<string, string> extraParameters)
Parameters
extraParametersDictionary<string, string>Extra parameters for the frame.
Returns
- NavigationOptions
The navigation options.
Remarks
ℹ️ When being written to and read from the URL, this parameter will be prefixed with 'f_' to be differentiated from global URL parameters.
ℹ️ Unlike <xref href="GroupeIsa.Neos.Designer.UIAbstractions.NavigationOptions.WithNewUrlParameters" data-throw-if-not-resolved="false"></xref>, this method does not replace the existing
parameters but adds to them, allowing to keep previously set parameters while adding new
ones.