Skip to content

Feature/pre migration viewmodel decoupling - #30

Merged
csontosati merged 3 commits into
mainfrom
feature/pre-migration-viewmodel-decoupling
Sep 20, 2026
Merged

csontosati merged 3 commits into
mainfrom
feature/pre-migration-viewmodel-decoupling

Conversation

@csontosati

Copy link
Copy Markdown
Owner

Decouple ViewModels from MAUI via IAlertService (#9, #10, #11)

Resolves the last direct MAUI dependencies in four ViewModels as part of the pre-migration cleanup epic.

What changed:

IAlertService extended with DisplayConfirmAsync (two-button confirm dialog)
AlertService updated with the new implementation
GameAddViewModel, GameDetailViewModel, UserAddViewModel, UserSettingsViewModel now accept IAlertService via constructor injection — all Application.Current!.MainPage!.DisplayAlert(...) calls replaced
GameDetailViewModel also drops the Microsoft.Maui.ApplicationModel.MainThread dependency from LoadLibrariesAsync
Result: These ViewModels are now 100% portable — no direct MAUI API calls remain.

✅ Build passes · ✅ 13/13 tests pass

csontosati and others added 3 commits September 3, 2026 19:05
- Extend IAlertService with DisplayConfirmAsync for two-button confirm dialogs
- Implement DisplayConfirmAsync in AlertService
- GameAddViewModel (#9): inject IAlertService, replace Application.Current DisplayAlert calls
- GameDetailViewModel (#10): inject IAlertService, replace Application.Current DisplayAlert calls and remove Microsoft.Maui.ApplicationModel.MainThread usage from LoadLibrariesAsync
- UserAddViewModel (#11): inject IAlertService, replace Application.Current DisplayAlert calls
- UserSettingsViewModel (#11): inject IAlertService, replace Application.Current DisplayAlert calls (including confirm dialog in DeleteAccountAsync)
@csontosati csontosati self-assigned this Sep 20, 2026
@csontosati
csontosati merged commit 9c1f13a into main Sep 20, 2026
4 checks passed
@csontosati
csontosati deleted the feature/pre-migration-viewmodel-decoupling branch September 20, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant