Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add info about Page.OnAppearing. #2368

Merged
merged 3 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/fundamentals/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The <xref:Microsoft.Maui.Controls.Window> class defines the following events:
- <xref:Microsoft.Maui.Controls.Window.Destroying>, which is raised when the window is destroyed.
- <xref:Microsoft.Maui.Controls.Window.SizeChanged>, which is raised on desktop platforms when the window changes size.
- <xref:Microsoft.Maui.Controls.Window.Backgrounding>, with an accompanying `BackgroundingEventArgs` object, which is raised on iOS and Mac Catalyst when the window is closed or enters a background state. This event can be used to persist any `string` state to the `State` property of the `BackgroundingEventArgs` object, which the OS will preserve until it's time to resume the window. When the window is resumed the state is provided via the `IActivationState` argument to the `CreateWindow` method.
- <xref:Microsoft.Maui.Controls.Window`DisplayDensityChanged`, with an accompanying `DisplayDensityChangedEventArgs` object, which is raised on Android and Windows when the effective dots per inch (DPI) for the window has changed.
- <xref:Microsoft.Maui.Controls.Window.DisplayDensityChanged>, with an accompanying `DisplayDensityChangedEventArgs` object, which is raised on Android and Windows when the effective dots per inch (DPI) for the window has changed.

For more information about the lifecycle events, and their associated overrides, see [App lifecycle](app-lifecycle.md).

Expand Down
2 changes: 2 additions & 0 deletions docs/migration/includes/api-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ A small number of other APIs have been consolidated in the move from Xamarin.For
> | `Xamarin.Forms.Span.ForegroundColor` | <xref:Microsoft.Maui.Controls.Span.TextColor?displayProperty=fullName> | |
> | `Xamarin.Forms.ToolbarItem.Name` | <xref:Microsoft.Maui.Controls.MenuItem.Text?displayProperty=fullName> | <xref:Microsoft.Maui.Controls.MenuItem.Text?displayProperty=fullName> is the base class for <xref:Microsoft.Maui.Controls.ToolbarItem?displayProperty=fullName>, and so `ToolbarItem.Name` becomes `ToolbarItem.Text`. |

In addition, in Xamarin.Forms, the `Page.OnAppearing` override is called on Android when an app is backgrounded and then brought to the foreground. However, this override isn't called on iOS and Windows in the same scenario. In .NET MAUI, the <xref:Microsoft.Maui.Controls.Page.OnAppearing> override isn't called on any platforms when an app is backgrounded and then brought to the foreground. Instead, you should listen to lifecycle events on <xref:Microsoft.Maui.Controls.Window> to be notified when an app returns to the foreground. For more information, see [.NET MAUI windows](~/fundamentals/windows.md).

### Native forms changes

[Native forms](/xamarin/xamarin-forms/platform/native-forms) in Xamarin.Forms has become native embedding in .NET MAUI, and uses a different initialization approach and different extension methods to convert cross-platform controls to their native types. For more information, see [Native embedding](~/platform-integration/native-embedding.md).
Loading