- fix collapse menu
This commit is contained in:
Samuele Locatelli
2024-10-31 10:58:05 +01:00
parent 882c68ff27
commit 3e65a0dc7b
19 changed files with 383 additions and 137 deletions
+2 -35
View File
@@ -8,8 +8,8 @@
@implements IDisposable
<div class="page">
<div class="sidebar">
<NavMenu />
<div class="@sideClass">
<NavMenu EC_compressUpdated="@UpdateNavDisplay" />
</div>
<CascadingValue Name="ShowSearch" Value=@ShowSearch>
@@ -28,36 +28,3 @@
</div>
@code {
bool ShowSearch { get; set; } = false;
protected override void OnInitialized()
{
AppMService.EA_ShowSearch += OnShowSearch;
AppMService.EA_HideSearch += OnHideSearch;
}
public void OnShowSearch()
{
ShowSearch = true;
InvokeAsync(() =>
{
StateHasChanged();
});
}
public void OnHideSearch()
{
ShowSearch = false;
InvokeAsync(() =>
{
StateHasChanged();
});
}
public void Dispose()
{
AppMService.EA_ShowSearch -= OnShowSearch;
AppMService.EA_ShowSearch -= OnHideSearch;
}
}