Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
lawrence_shaun_introducing_net_maui_build_and_deploy_crosspl.pdf
Скачиваний:
46
Добавлен:
26.06.2023
Размер:
5.15 Mб
Скачать

Chapter 3 The Fundamentals of .NET MAUI

protected override Window CreateWindow(IActivationState activationState)

{

return new StateAwareWindow(MainPage);

}

This will create a new instance of StateAwareWindow and pass it a reference to the application’s MainPage. If you do not pass in a reference to a Page to the Window implementation, you will experience exceptions being thrown.

Cross-Platform Mappings to Platform Lifecycle Events

I strongly believe that despite the fact that .NET MAUI provides us with these events, you should understand how they map to the underlying platforms. If you understand what is being called on the platform-specific side, it can really help to diagnose things when they go wrong or perhaps point you in the direction of a better approach for your scenarios.

Let’s break down how the .NET MAUI lifecycle events map to the platform-specific events and then show off the bits that are not mapped if you ever need to use them. See Table 3-1.

66