Skip to content

Redesign XamlSamples with the gallery design system and add .NET 11 XAML pages - #798

Open
jfversluis wants to merge 3 commits into
mainfrom
jfversluis-xamlsamples-visual-redesign
Open

jfversluis wants to merge 3 commits into
mainfrom
jfversluis-xamlsamples-visual-redesign

Conversation

@jfversluis

@jfversluis jfversluis commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 63b1460896eb6cb1a90ae39752355708e26d1473

Dimension Assessment Rationale
Change confidence 8.5/10 ↑ Builds without warnings for iOS, Android, and Mac Catalyst.
↑ CI passed on macos-26 and windows-latest for this head, with no warnings for this sample.
↑ All 18 pages captured in light and dark on an iPhone 18 Pro simulator (iOS 27.2) and a physical Pixel 10.
↑ Pixel 10 real-touch checks of navigation, sliders, buttons, entries, the keypad (including the new backspace glyph), the docs link, and all four .NET 11 pages.
↑ GPT and Sonnet code reviews and a Gemini design review; findings addressed.
↓ iOS interactions driven through code rather than touch.
↓ Windows and Mac Catalyst built in CI but not run.
↓ On a phone in landscape, the HSL page's last slider is cut off, because the tutorial's layout doesn't scroll.

Redesigns 11.0/XAML/Fundamentals (XamlSamples) with the shared gallery design system used by ControlGallery, PlatformIntegrationDemos (#792), CollectionViewDemos (#793), and DataBindingDemos (#796), and adds pages for XAML features that are new in .NET 11.

This sample backs the XAML fundamentals tutorial, and readers type along with it, so the tutorial pages keep the XAML the tutorial teaches. The styling lives in resource dictionaries instead of page markup.

What changed

  • Demo page chrome: an implicit ContentPage style in Resources/Styles/DemoPage.xaml gives every page a control template. The template adds a header (part of the tutorial, title, a short explanation, and a "Read the tutorial" link) and a card around the page's content. On short windows, such as a phone in landscape, the header is hidden. Implicit StackLayout, VerticalStackLayout, Grid, and Button styles add the spacing and theme colors that the tutorial's XAML doesn't set.
  • Home page: a hero with the .NET 11 rocket bots, then the pages grouped by tutorial part, in tutorial order. NavigationPage replaces the single-page Shell.
  • Design system: colors, styles, Inter (SIL OFL 1.1), and Material Icons Round (Apache 2.0), with license files. OpenSans is removed. The implicit Label style also gains a trigger that switches to InterBold for FontAttributes="Bold", because iOS doesn't synthesize bold for a custom font. Without it, the tutorial's bold text rendered regular on iOS. The other gallery samples have the same issue.
  • Images: 3D Fluent Emoji (MIT) for the grocery list, with the license file.
  • README: light and dark screenshots that follow the reader's GitHub theme.

New in .NET 11

A new section on the home page has four pages. They use implicit XAML namespaces (no xmlns declarations). GlobalXmlns.cs adds the app's namespace to the global XAML namespace.

Feature Status in 11.0.10 In this PR
Implicit XAML namespace declarations (dotnet/maui#33834) Shipped, on by default Implicit namespaces page
C# expressions in XAML (dotnet/maui#33693; preview flag removed in dotnet/maui#39384) Shipped, no EnablePreviewFeatures needed C# expressions page: compiled bindings, interpolation, GT/GTE, event lambdas
Compiled RelativeSource AncestorType bindings (dotnet/maui#34408, dotnet/maui#36905) Shipped Ancestor bindings page; the home page cards use them too
Binding.ConverterCulture (dotnet/maui#35821) Shipped ConverterCulture page
Bindings with an explicit source in data templates, binding diagnostics, enum resolution (dotnet/maui#34447, dotnet/maui#34078, dotnet/maui#34446) Shipped, also in 10.0.60 Covered by the Ancestor bindings page
XAML source generation as the default; lazy resource dictionaries (dotnet/maui#33826) Shipped, nothing visible A note on the home page section
x:Code (dotnet/maui#34715) Fails to build in 11.0.10 (MAUIG1001, dotnet/maui#40328); fix in SR2 (dotnet/maui#40392); also needs EnablePreviewFeatures Skipped
InvalidateStyle / InvalidateVisualStates Shipped Skipped: has its own sample (UserInterface/Styles/InvalidateStyleDemo)

Tutorial page changes, and why

Per the docs plan, the tutorial will add .NET 11 code for these pages.

  • HelloXamlPage: TextColor="Blue" becomes MediumSlateBlue, which is readable on light and dark cards. The page now matches the tutorial snippet otherwise: no ContentPage.Content wrapper or IsVisible, and FontSize="18".
  • GridDemoPage: new named colors that work in both themes and have readable text: RoyalBlue, LightSteelBlue, Teal, Indigo on Lavender, White on SlateBlue, MidnightBlue on Gold, and White on Crimson. The redundant Grid.Row="0" and Grid.Column="0" are removed, as in the tutorial.
  • AbsoluteDemoPage: .NET purple checkerboard colors. This page isn't in the tutorial.
  • SharedResourcesPage: the OnPlatform text colors are IndianRed (iOS and Mac Catalyst), SeaGreen (Android), and SteelBlue (Windows), so they're readable on the buttons in both themes. Spacing="40" keeps the rotated buttons from overlapping.
  • StaticConstantsPage: uses an AppConstants class through x:Static, which is what the tutorial shows; the sample used literal colors before. The colors are lavender on .NET violet. Margin="0,150" reserves room for the BoxView scaled 100 times, which otherwise covered the label. The page Padding is removed.
  • SliderBindingsPage: Spacing="48" lets the rotating label clear the slider. The page now matches the tutorial otherwise.
  • SliderTransformsPage: the page Padding and slider margins are removed. The card provides the padding.
  • KeypadPage: the backspace button's text changes from ⇦ (⇦) to ← (←). Inter doesn't include ⇦, and the fallback font drew a thin outline arrow that looked disabled. Nothing else changes.
  • XamlPlusCodePage, OneShotDateTimePage, ClockPage: aligned with the tutorial snippets (font sizes, no slider margin, VerticalStackLayout, xmlns:local).
  • CollectionViewDemoPage, HslColorScrollPage: unchanged.

Screenshots

The screenshots follow your GitHub theme. Pages: home, Hello XAML, Grid, shared resources, static constants, and keypad.

iOS (iPhone 18 Pro simulator), before and after:

Before and after on iOS: home, Hello XAML, Grid, shared resources, static constants, and keypad pages

Android (Pixel 10), before and after:

Before and after on Android: the same six pages

The new .NET 11 pages:

The Implicit namespaces and Ancestor bindings pages on iOS, and the C# expressions and ConverterCulture pages on Android

Validation

  • Built for the iOS simulator (Xcode 27.2), Android, and Mac Catalyst. Ran on an iPhone 18 Pro simulator (iOS 27.2) and a physical Pixel 10, in light and dark themes.
  • Pixel 10 real-touch checks:
    • navigation from the home page
    • XAML + code slider and alert
    • slider rotation
    • keypad input and backspace
    • C# expressions: Entry TwoWay, ticket buttons, and IsEnabled/IsVisible expressions
    • ancestor-binding add and clear
    • ConverterCulture slider
    • "Learn more" link opening the browser
  • Landscape: the header hides and the keypad fits.
  • The docs states were captured for the docs-maui update.

jfversluis and others added 2 commits November 28, 2026 20:53
…AML pages

- Copy the gallery design system (colors, styles, Inter and Material Icons fonts) into the sample.
- Give every tutorial page a header and card through an implicit ContentPage style and
  control template (Resources/Styles/DemoPage.xaml), so the page XAML stays what the
  XAML fundamentals tutorial teaches.
- Replace Shell with NavigationPage and redesign the home page, grouped by tutorial part.
- Make small tutorial-page edits: colors that work in light and dark themes, an AppConstants
  class to match the tutorial's x:Static example, and spacing fixes for rotated content.
- Add a "New in .NET 11" section: implicit XAML namespaces, C# expressions in XAML, compiled
  RelativeSource ancestor bindings, and ConverterCulture.
- Fix bold text on iOS with the Inter font, and bundle Fluent Emoji (MIT) for the grocery list.
- Update the README with light and dark screenshots.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Avoids CsWinRT1032 warnings in the Windows build.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The ⇦ glyph isn't in Inter, and the fallback font drew a thin outline arrow
that looked disabled. ← (U+2190) is in Inter.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jfversluis

jfversluis commented Nov 28, 2026 •

Copy link
Copy Markdown
Member Author

The keypad's backspace key now uses ← (U+2190), which Inter includes. ⇦ fell back to a thin outline arrow that looked disabled. Updated before and after screenshots:

ios-light

ios-dark

android-light

android-dark

jfversluis added a commit to dotnet/docs-maui that referenced this pull request Nov 28, 2026
The redesigned sample uses U+2190 for the backspace button because the
Inter font has no U+21E6 glyph (dotnet/maui-samples#798, 63b14608).
Split the KeypadPage excerpt by version and replace keypad-net11.png
with the recapture. Earlier versions keep U+21E6.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
davidortinau pushed a commit to dotnet/docs-maui that referenced this pull request Dec 1, 2026
…ned XamlSamples sample (#3645)

* XAML fundamentals (.NET 11): use CollectionView in data binding basics

The 11.0 XamlSamples sample uses CollectionViewDemoPage, and ListView
is deprecated in .NET 10. Add a .NET 11 version of the bindings and
collections section that uses CollectionView with DataTemplate content
instead of ListView and ViewCell. Earlier versions keep ListView, which
matches the 10.0 sample. Also fix a typo (dsplays).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* XAML fundamentals (.NET 11): screenshots and excerpts for redesigned XamlSamples

Add .NET 11 versions of 14 tutorial screenshots (*-net11.png) from the
redesigned XamlSamples sample behind >=net-maui-11.0. Earlier versions
keep the original screenshots. new-solution.png isn't from the sample
and is unchanged.

Split the tutorial page excerpts that changed with the redesign:
HelloXamlPage (MediumSlateBlue), GridDemoPage colors,
SharedResourcesPage OnPlatform colors and spacing, StaticConstantsPage
AppConstants values and BoxView margin, SliderBindingsPage spacing, and
SliderTransformsPage (no page padding, label spans both columns, as in
the sample).

For all versions, the slider transforms text now names the Rotation,
RotationX, and RotationY properties.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* XAML fundamentals: address review feedback

Make the .NET 11 styling note specific, say that the shared resources
screenshot is from Android, explain SelectionMode in the CollectionView
example, and refer to VerticalStackLayout in the MVVM prose to match the
code (all versions).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* XAML fundamentals: fix page structure and versioned guidance

- get-started: move the explanation of the Hello XAML example back
  under it, promote the .NET 11 implicit namespace section out of the
  preview section and point the earlier note at it, and say that XAML
  source generation is the default in .NET 11.
- data-binding-basics: note that ListView is deprecated in .NET 10.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* MVVM (.NET 11): use the left arrow glyph in the keypad excerpt

The redesigned sample uses U+2190 for the backspace button because the
Inter font has no U+21E6 glyph (dotnet/maui-samples#798, 63b14608).
Split the KeypadPage excerpt by version and replace keypad-net11.png
with the recapture. Earlier versions keep U+21E6.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant