Skip to content

Commit

Permalink
Add info about Page.OnAppearing. (#2368)
Browse files Browse the repository at this point in the history
* Add info about Page.OnAppearing.

* Edit.
  • Loading branch information
davidbritch authored Jul 18, 2024
1 parent 1d4e84a commit d452efb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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).

0 comments on commit d452efb

Please sign in to comment.