From c9545086838f0063ac408aea105dd9e9f5cde6fa Mon Sep 17 00:00:00 2001 From: HarryCordewener Date: Wed, 1 Jul 2026 09:05:45 -0500 Subject: [PATCH] fix(android): register TriggerAliasEditorViewModel so the Rules page works MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Opening the Rules page on Android threw "Cannot provide a value for property 'Vm' on type RulesPage. There is no registered service of type TriggerAliasEditorViewModel." — the view model was registered on the Web host (Program.cs) but never in the MAUI container (MauiProgram.cs), so DI failed when RulesPage tried to inject it. Register it in MauiProgram, mirroring the Web registration (IWorldStore-backed, transient). With this, the set of injected view models exactly matches the set registered in the MAUI container. Android head builds clean. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01HHCRc5CJ6595iMzEgYYdQp --- src/SharpClient.App/MauiProgram.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SharpClient.App/MauiProgram.cs b/src/SharpClient.App/MauiProgram.cs index 52c9083..c3090ab 100644 --- a/src/SharpClient.App/MauiProgram.cs +++ b/src/SharpClient.App/MauiProgram.cs @@ -123,6 +123,11 @@ public static MauiApp CreateMauiApp() new HistorySearchViewModel( sp.GetRequiredService(), sp.GetRequiredService())); + // Backs the Rules page (triggers/aliases editor). Was registered on the Web host but not + // here, so opening Rules on Android threw "no registered service ... TriggerAliasEditorViewModel". + builder.Services.AddTransient(sp => + new TriggerAliasEditorViewModel( + sp.GetRequiredService())); // ── Session launcher (real telnet) ──────────────────────────────── builder.Services.AddTransient();