Aggiunto messaggio per completamento ispezione

This commit is contained in:
2026-03-02 13:00:35 +01:00
parent 63368748ab
commit 8fbeaf8637
3 changed files with 24 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
@using CommunityToolkit.Mvvm.Messaging
@using SteUp.Shared.Components.SingleElements.MessageBox
@using SteUp.Shared.Core.Messages.Ispezione
@using SteUp.Shared.Core.Messages.Scheda
@inject INetworkService NetworkService
@@ -39,7 +40,7 @@
{
<MudFabMenuItem Disabled="!NetworkService.IsNetworkAvailable()" OnClick="@NewScheda"
Label="Nuova scheda" Color="Color.Surface"/>
if (ShowCompleteInspection)
{
<MudFabMenuItem Disabled="!NetworkService.IsNetworkAvailable()" OnClick="@CompleteInspection"
@@ -56,6 +57,9 @@
</nav>
</div>
<ConfirmMessageBox @ref="_messageBox" NoText="No" YesText="Si" YesColor="Color.Primary"
Message="Completando l'ispezione non sarà più possibile editarla o aggiungere ulteriori segnalazioni. Procedere?"/>
@code
{
private bool IsVisible { get; set; } = true;
@@ -63,6 +67,8 @@
private bool ShowCompleteInspection { get; set; }
private bool SchedaVisible { get; set; }
private ConfirmMessageBox _messageBox = null!;
protected override Task OnInitializedAsync()
{
NavigationManager.LocationChanged += (_, args) =>
@@ -96,8 +102,13 @@
}
}
private void CompleteInspection() =>
Messenger.Send(new CompleteInspectionMessage());
private async Task CompleteInspection()
{
var result = await _messageBox.ShowAsync();
if (result is true)
Messenger.Send(new CompleteInspectionMessage());
}
private async Task NewScheda()
{