13d5400104
Il tasto al centro perde l'etichetta: non ne ha una sola, perche' quello che fa lo decide la schermata sotto. Dentro un'ispezione apre le sue azioni (nuova scheda, concludi, elimina); altrove apre una nuova ispezione. Il glifo resta lo stesso e resta nello stesso punto: quello che cambia e' cosa c'e' dietro, non dove mettere il dito. Le azioni dell'ispezione lasciano quindi la testata, dove stavano dietro un menu a tre punti, e tornano sotto il pollice. Il collegamento passa da PageActionsService: la pagina si registra finche' e' a video e si sfila uscendo, cosi' la barra non tiene in vita schermate che non ci sono piu'. Chi non registra niente lascia al comando il suo significato di default — un'ispezione conclusa non registra, e il tasto non resta li' a non fare nulla. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
93 lines
3.6 KiB
C#
93 lines
3.6 KiB
C#
using CommunityToolkit.Mvvm.Messaging;
|
|
using Microsoft.AspNetCore.Components.Authorization;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Logging;
|
|
using SteUp.Data.LocalDb;
|
|
using SteUp.Data.LocalDb.EntityServices;
|
|
using SteUp.Maui.Core.Logger;
|
|
using SteUp.Maui.Core.Services;
|
|
using SteUp.Maui.Core.System;
|
|
using SteUp.Maui.Core.System.Network;
|
|
using SteUp.Shared.Core.BarcodeReader;
|
|
using SteUp.Shared.Core.BarcodeReader.Contracts;
|
|
using SteUp.Shared.Core.Data;
|
|
using SteUp.Shared.Core.Data.Contracts;
|
|
using SteUp.Shared.Core.Interface;
|
|
using SteUp.Shared.Core.Interface.IntegryApi;
|
|
using SteUp.Shared.Core.Interface.LocalDb;
|
|
using SteUp.Shared.Core.Interface.System;
|
|
using SteUp.Shared.Core.Interface.System.Network;
|
|
using SteUp.Shared.Core.Messages.Scanner;
|
|
using SteUp.Shared.Core.Messages.System;
|
|
using SteUp.Shared.Core.Services;
|
|
|
|
namespace SteUp.Maui.Core;
|
|
|
|
public static class CoreModule
|
|
{
|
|
extension(MauiAppBuilder builder)
|
|
{
|
|
public void RegisterAppServices()
|
|
{
|
|
builder.Services.AddSingleton<IFormFactor, FormFactor>();
|
|
builder.Services.AddSingleton<IGenericSystemService, GenericSystemService>();
|
|
|
|
builder.Services.AddScoped<ISteupDataService, SteupDataService>();
|
|
builder.Services.AddSingleton<IBarcodeManager, BarcodeManager>();
|
|
}
|
|
|
|
public void RegisterIntegryServices()
|
|
{
|
|
builder.Services.AddScoped<IIntegryApiService, IntegryApiService>();
|
|
builder.Services.AddScoped<IIntegrySteupService, IntegrySteupService>();
|
|
}
|
|
|
|
public void RegisterSystemService()
|
|
{
|
|
builder.Services.AddSingleton<INetworkService, NetworkService>();
|
|
builder.Services.AddSingleton<IAttachedService, AttachedService>();
|
|
builder.Services.AddSingleton<IFileManager, FileManager>();
|
|
builder.Services.AddSingleton<IBarcodeReaderService, HoneywellScannerService>();
|
|
}
|
|
|
|
public void AddAuthorizationCore()
|
|
{
|
|
builder.Services.AddAuthorizationCore();
|
|
builder.Services.AddScoped<AppAuthenticationStateProvider>();
|
|
builder.Services.AddScoped<AuthenticationStateProvider>(provider =>
|
|
provider.GetRequiredService<AppAuthenticationStateProvider>());
|
|
}
|
|
|
|
public void RegisterMessageServices()
|
|
{
|
|
builder.Services.AddSingleton<IMessenger, WeakReferenceMessenger>();
|
|
builder.Services.AddSingleton<OnScannerService>();
|
|
builder.Services.AddSingleton<BackButtonService>();
|
|
builder.Services.AddSingleton<PageActionsService>();
|
|
}
|
|
|
|
public void RegisterDbServices()
|
|
{
|
|
builder.Services.AddSingleton<IDbPathProvider, DbPathProvider>();
|
|
builder.Services.AddDbContext<AppDbContext>((sp, options) =>
|
|
{
|
|
var dbPath = sp.GetRequiredService<IDbPathProvider>().GetDbPath();
|
|
options.UseSqlite($"Filename={dbPath}");
|
|
});
|
|
builder.Services.AddSingleton<IDbInitializer, DbInitializer>();
|
|
builder.Services.AddSingleton<IIspezioniService, IspezioniService>();
|
|
}
|
|
|
|
public void RegisterLoggerServices()
|
|
{
|
|
var logPath = Path.Combine(FileSystem.AppDataDirectory, "logs");
|
|
const string logFilePrefix = "SteUp-log";
|
|
|
|
builder.Services.AddLogging(loggingBuilder =>
|
|
{
|
|
loggingBuilder.AddProvider(new FileLoggerProvider(logPath, logFilePrefix));
|
|
loggingBuilder.SetMinimumLevel(LogLevel.Information);
|
|
});
|
|
}
|
|
}
|
|
} |