Skip to content

Commit

Permalink
Update shell.md | clarify the use of the OnPlatform markup extension (#…
Browse files Browse the repository at this point in the history
…2717)

* Update shell.md | Clarifying about OnPlatform markup extension

* Fix typo and clarify `OnPlatform` usage

---------

Co-authored-by: David Britch <[email protected]>
  • Loading branch information
bhavanesh2001 and davidbritch authored Jan 10, 2025
1 parent eaa5b85 commit 6a210d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/tutorials/notes-app/includes/shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Let's break down the key parts of the XAML:
- `<TabBar>` is the content of the <xref:Microsoft.Maui.Controls.Shell>.
- Two `<ShellContent>` objects inside of the `<TabBar>`. Before you replaced the template code, there was a single `<ShellContent>` object, pointing to the `MainPage` page.

The `TabBar` and its children don't represent any user interface elements, but rather the organization of the app's visual hierarchy. Shell takes these objects and produces the user interface for the content, with a bar at the top representing each page. The `ShellContent.Icon` property for each page uses special syntax: `{OnPlatform ...}`. This syntax is processed when the XAML pages are compiled for each platform, and with it you can specify a property value for each platform. In this case, every platform uses the `icon_about.png` icon by default, but iOS and MacCatalyst will use `icon_about_ios.png`.
The `TabBar` and its children don't represent any user interface elements, but rather the organization of the app's visual hierarchy. Shell takes these objects and produces the user interface for the content, with a bar at the top representing each page. The `ShellContent.Icon` property for each page uses the `OnPlatform` markup extension. This XAML markup extension is used to specify different values for different platforms. In this example, every platform uses the `icon_about.png` icon by default, but iOS and MacCatalyst use `icon_about_ios.png`.

Each `<ShellContent>` object is pointing to a page to display. This is set by the `ContentTemplate` property.

Expand Down

0 comments on commit 6a210d3

Please sign in to comment.