Interface IMenuService
Interface for a menu service that manages menu views and interactions.
Namespace: Serenity.Menu.Application.Interfaces.Services
Assembly: Serenity.Menu.Application.dll
Syntax
public interface IMenuService : IService, IFoundationSettings
Methods
DeactivateMenuContext()
Deactivates the current menu context, hiding the active menu view and cleaning up any resources.
Declaration
void DeactivateMenuContext()
GetCurrentView()
Gets the current active view in the menu service.
Declaration
IViewBase GetCurrentView()
Returns
| Type | Description |
|---|---|
| IViewBase | The current active view. |
InitializeService(Dictionary<string, IViewBase>, IViewBrowserService, string)
Initializes the menu service with the provided menu views.
Declaration
void InitializeService(Dictionary<string, IViewBase> menuViews, IViewBrowserService viewBrowserService, string initMenuId)
Parameters
| Type | Name | Description |
|---|---|---|
| Dictionary<string, IViewBase> | menuViews | A dictionary of menu views to initialize the service with. |
| IViewBrowserService | viewBrowserService | The view browser service for navigation. |
| string | initMenuId | The ID of the initial menu to show when ShowInitialMenu is called. |
SetGameModeService(IGameModeService)
Sets the GameMode service used to coordinate the application mode when the initial menu is shown.
Intended to be invoked by the composition root once the GameMode service has been constructed.
Declaration
void SetGameModeService(IGameModeService gameModeService)
Parameters
| Type | Name | Description |
|---|---|---|
| IGameModeService | gameModeService | The GameMode service implementation to coordinate with. |
ShowInitialMenu()
Shows the initial menu configured during initialization. This is the menu that should be displayed at startup or when returning from gameplay.
Declaration
void ShowInitialMenu()
ShowMenu(string)
Shows the menu with the specified ID.
Declaration
void ShowMenu(string menuId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | menuId | The ID of the menu to show. |