add ability to dynamically set module title and visible from components
This commit is contained in:
@ -24,6 +24,9 @@ namespace Oqtane.Modules
|
||||
[Inject]
|
||||
protected IJSRuntime JSRuntime { get; set; }
|
||||
|
||||
[Inject]
|
||||
protected SiteState SiteState { get; set; }
|
||||
|
||||
[CascadingParameter]
|
||||
protected PageState PageState { get; set; }
|
||||
|
||||
@ -198,7 +201,7 @@ namespace Oqtane.Modules
|
||||
return urlParameters;
|
||||
}
|
||||
|
||||
// user feedback methods
|
||||
// UI methods
|
||||
public void AddModuleMessage(string message, MessageType type)
|
||||
{
|
||||
ModuleInstance.AddModuleMessage(message, type);
|
||||
@ -219,6 +222,18 @@ namespace Oqtane.Modules
|
||||
ModuleInstance.HideProgressIndicator();
|
||||
}
|
||||
|
||||
public void SetModuleTitle(string title)
|
||||
{
|
||||
var obj = new { PageModuleId = ModuleState.PageModuleId, Title = title };
|
||||
SiteState.Properties.ModuleTitle = obj;
|
||||
}
|
||||
|
||||
public void SetModuleVisibility(bool visible)
|
||||
{
|
||||
var obj = new { PageModuleId = ModuleState.PageModuleId, Visible = visible };
|
||||
SiteState.Properties.ModuleVisibility = obj;
|
||||
}
|
||||
|
||||
// logging methods
|
||||
public async Task Log(Alias alias, LogLevel level, string function, Exception exception, string message, params object[] args)
|
||||
{
|
||||
|
Reference in New Issue
Block a user