You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed we're depending directly on App.Current.MainPage.DisplayAlert. There's an argument that we should use custom dialogs, but that aside, we need an abstraction for using system dialogs (e.g. IAlertService).
Using IAlertService an in ViewModels instead of directly calling App.Current.MainPage.DisplayAlert promotes testability, separation of concerns, and better adherence to MVVM principles. It decouples the UI framework from the business logic, making it easier to mock alerts in unit tests and maintain cross-platform flexibility.
Cc: @zacharykeeping @AntPolkanov
Hi
Pain
I've noticed we're depending directly on
App.Current.MainPage.DisplayAlert
. There's an argument that we should use custom dialogs, but that aside, we need an abstraction for using system dialogs (e.g.IAlertService
).Using
IAlertService
an in ViewModels instead of directly callingApp.Current.MainPage.DisplayAlert
promotes testability, separation of concerns, and better adherence to MVVM principles. It decouples the UI framework from the business logic, making it easier to mock alerts in unit tests and maintain cross-platform flexibility.What code could be improved?
https://github.com/search?q=repo%3ASSWConsulting%2FSSW.Rewards.Mobile%20App.Current.MainPage.DisplayAlert&type=code
Tasks
App.Current.MainPage.DisplayAlert
with calls to the serviceAcceptance Criteria
Thanks!
The text was updated successfully, but these errors were encountered: