using Microsoft.Maui; using Microsoft.Maui.Controls; using RBLNews.Shared.Services; namespace RBLNews.Maui { public partial class App : Application { private readonly AppLifecycleService _appLifecycleService; public App(AppLifecycleService appLifecycleService) { _appLifecycleService = appLifecycleService; InitializeComponent(); MainPage = new MainPage(); } protected override Window CreateWindow(IActivationState activationState) { Window window = base.CreateWindow(activationState); window.Activated += (sender, eventArgs) => { _appLifecycleService.Activated(); }; window.Resumed += (sender, eventArgs) => { _appLifecycleService.Resumed(); // take actions here... }; return window; } } }