Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
e40377d
Add catalog/windows-samples.json export for federated samples catalog
niels9001 Sep 4, 2026
9f49886
Merge branch 'main' into niels9001-sample-catalog-manifest
niels9001 Sep 14, 2026
ca20417
Add stable scenario ids, integer schemaVersion, and a scenario code file
Jaylyn-Barbee Sep 14, 2026
22a8073
Migrate the last inline ControlExample code to snippet bundles
Jaylyn-Barbee Sep 14, 2026
ff8b9f7
Resolve $(Token) placeholders to the values the gallery shows on load
Jaylyn-Barbee Sep 14, 2026
527effb
Emit the shared winapp sample-index contract
Jaylyn-Barbee Sep 14, 2026
343b3d1
Keep the CI step naming the one file it verifies
Jaylyn-Barbee Sep 14, 2026
c755b84
Honor the contract's usings, display names and namespace imports
Jaylyn-Barbee Sep 14, 2026
6e1938f
Merge branch 'main' into jay/sample-catalog-manifest
Jaylyn-Barbee Sep 14, 2026
d89cb74
Guarantee published sample XAML contains no substitution placeholders
Jaylyn-Barbee Sep 15, 2026
209359c
Merge remote-tracking branch 'fork/jay/sample-catalog-manifest' into …
Jaylyn-Barbee Sep 15, 2026
d8967fe
Regenerate the sample index for the new Windowing samples
Jaylyn-Barbee Sep 15, 2026
55c1575
Declare the $(Token) placeholders that published C# still contains
Jaylyn-Barbee Sep 15, 2026
cf665c3
Merge branch 'main' into jay/sample-catalog-manifest
Jaylyn-Barbee Sep 15, 2026
3db0b6d
Omit XAML that binds an undeclared prefix, and validate SampleDefinit…
Jaylyn-Barbee Sep 15, 2026
ec83c03
Drop LayoutPanel's unresolvable related-control references
Jaylyn-Barbee Sep 15, 2026
a562015
Use source-generated JSON metadata in the exporter
Jaylyn-Barbee Sep 15, 2026
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
7 changes: 7 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ Pages use the `ControlExample` custom control to show interactive demos:
2. Create a folder `Samples/{UniqueId}/` and add `{ControlName}Page.xaml` and `.xaml.cs` using the `ControlExample` pattern above. The folder name **must** match the `UniqueId` exactly.
3. The source generator auto-maps the `UniqueId` to the page type — no manual registration needed.
4. Add any code snippets as `.txt` files in the same `Samples/{UniqueId}/` folder. They are automatically included in the build as content.
5. Regenerate the sample index and commit the result:

```powershell
dotnet run --project tools/CatalogExporter -- generate
```

`catalog/windows-samples.json` is a checked-in file that other tools consume, and CI fails if it does not match the current samples. Run this whenever you add, rename, remove, or edit a control page or a snippet `.txt`.

## Accessibility

Expand Down
6 changes: 6 additions & 0 deletions .pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ steps:
feedsToUse: 'config'
nugetConfigPath: '$(System.DefaultWorkingDirectory)\nuget.config'

- task: DotNetCoreCLI@2
displayName: Verify catalog/windows-samples.json is up to date
inputs:
command: 'test'
projects: 'tests/WinUIGallery.CatalogExporter.Tests/WinUIGallery.CatalogExporter.Tests.csproj'

- task: PowerShell@2
displayName: Generate Test Signing Certificate
inputs:
Expand Down
18 changes: 18 additions & 0 deletions WinUIGallery.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@
<Deploy Solution="Debug|ARM64EC" />
<Deploy Solution="Release|ARM64EC" />
</Project>
<Project Path="tests/WinUIGallery.CatalogExporter.Tests/WinUIGallery.CatalogExporter.Tests.csproj">
<BuildType Solution="Debug-Unpackaged|*" Project="Debug" />
<BuildType Solution="Preview|*" Project="Release" />
<BuildType Solution="Release-Unpackaged|*" Project="Release" />
<BuildType Solution="Sideload|*" Project="Debug" />
<BuildType Solution="Stable|*" Project="Release" />
<BuildType Solution="Store|*" Project="Debug" />
</Project>
</Folder>
<Folder Name="/tools/">
<Project Path="tools/CatalogExporter/CatalogExporter.csproj">
<BuildType Solution="Debug-Unpackaged|*" Project="Debug" />
<BuildType Solution="Preview|*" Project="Release" />
<BuildType Solution="Release-Unpackaged|*" Project="Release" />
<BuildType Solution="Sideload|*" Project="Debug" />
<BuildType Solution="Stable|*" Project="Release" />
<BuildType Solution="Store|*" Project="Debug" />
</Project>
</Folder>
<Project Path="WinUIGallery.SourceGenerator/WinUIGallery.SourceGenerator.csproj">
<BuildType Solution="Debug-Unpackaged|*" Project="Debug" />
Expand Down
18 changes: 14 additions & 4 deletions WinUIGallery/SampleSupport/Data/ControlInfoData.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,13 @@
"Title": "XamlReader - API",
"Uri": "https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.markup.xamlreader"
}
]
],
"Catalog": {
"Aliases": [
"repl",
"live xaml preview"
]
}
}
]
},
Expand Down Expand Up @@ -1383,7 +1389,13 @@
"RepeatButton",
"HyperlinkButton",
"AppBarButton"
]
],
"Catalog": {
"Aliases": [
"cta",
"call to action"
]
}
},
{
"UniqueId": "DropDownButton",
Expand Down Expand Up @@ -2606,8 +2618,6 @@
}
],
"RelatedControls": [
"Panel",
"StackLayout",
"ItemsRepeater"
]
},
Expand Down
25 changes: 25 additions & 0 deletions WinUIGallery/SampleSupport/Data/ControlInfoDataSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,31 @@
},
"description": "Additional keywords used purely for search. If a search query matches one of these tags, this sample will be surfaced in the results even when the tag does not appear in the Title."
},
"Catalog": {
"type": "object",
"description": "Optional, opt-in overrides consumed only by tools/CatalogExporter when generating catalog/windows-samples.json. Everything here is additive/derivable metadata that the running gallery app itself never reads; omit this block entirely unless a sample genuinely needs to diverge from what the exporter can derive automatically from the fields above and the on-disk sample folder.",
"properties": {
"Exclude": {
"type": "boolean",
"default": false,
"description": "When true, this item is left out of the generated catalog manifest entirely (for example, a developer utility page rather than a genuine, documentable sample)."
},
"Aliases": {
"type": "array",
"items": {
"type": "string"
},
"description": "Additional search aliases that are useful for an external catalog/agent but too broad or noisy for the in-app search experience (which already uses Tags)."
},
"RelatedSamples": {
"type": "array",
"items": {
"type": "string"
},
"description": "Extra related-sample references that point outside this repository, formatted as '{owner}/{repo}#{uniqueId}'. Used to extend (not replace) RelatedControls, which can only reference other items in this same file."
}
}
}
},
"required": [ "UniqueId", "Title"]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
--- xaml
<Grid ColumnSpacing="8" RowSpacing="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>

<Rectangle x:Name="ColorRectangle" Fill="Red"
Height="30" RadiusX="4" RadiusY="4"
Grid.ColumnSpan="3"/>

<Button Click="MakeRedButton_Click" Content="Red" Grid.Row="1"
ToolTipService.ToolTip="Shortcut: Ctrl+R">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Modifiers="Control" Key="R" />
</Button.KeyboardAccelerators>
</Button>

<Button Click="MakeBlueButton_Click" Content="Blue"
Grid.Row="1" Grid.Column="1"
ToolTipService.ToolTip="Shortcut: Ctrl+B">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Modifiers="Control" Key="B" />
</Button.KeyboardAccelerators>
</Button>

<!--
Chartreuse is an uncommon color, so we explain it in the tooltip.
This replaces the auto-generated tooltip, so we manually mention
the hotkey in the custom tooltip.
-->
<Button Click="MakeChartreuseButton_Click" Content="Chartreuse"
Grid.Row="1" Grid.Column="1"
ToolTipService.ToolTip="A greenish yellow (Ctrl+G)">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Modifiers="Control" Key="G" />
</Button.KeyboardAccelerators>
</Button>
</Grid>
--- c#
private void MakeRedButton_Click(object sender, RoutedEventArgs e)
{
ColorRectangle.Fill = new SolidColorBrush(Colors.Red);
}
private void MakeBlueButton_Click(object sender, RoutedEventArgs e)
{
ColorRectangle.Fill = new SolidColorBrush(Colors.Blue);
}
private void MakeChartreuseButton_Click(object sender, RoutedEventArgs e)
{
ColorRectangle.Fill = new SolidColorBrush(Colors.Chartreuse);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- xaml
<MenuBar>
<MenuBarItem Title="File" AccessKey="F">
<MenuFlyoutItem Text="New" AccessKey="N" />
<MenuFlyoutItem Text="Open..." AccessKey="O" />
<MenuFlyoutItem Text="Save" AccessKey="S" />
<MenuFlyoutItem Text="Exit" AccessKey="E" />
</MenuBarItem>

<MenuBarItem Title="Edit" AccessKey="E">
<MenuFlyoutItem Text="Undo" AccessKey="U" />
<MenuFlyoutItem Text="Cut" AccessKey="X" />
<MenuFlyoutItem Text="Copy" AccessKey="C" />
<MenuFlyoutItem Text="Paste" AccessKey="V" />
</MenuBarItem>

<MenuBarItem Title="Help" AccessKey="H">
<MenuFlyoutItem Text="About" AccessKey="A" />
</MenuBarItem>
</MenuBar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- xaml
<!-- ListViews fully support arrow keys, for example -->
<ListView
Width="300"
AutomationProperties.Name="Colors">
<ListViewItem>Red</ListViewItem>
<ListViewItem>Blue</ListViewItem>
<ListViewItem>Green</ListViewItem>
<ListViewItem>Yellow</ListViewItem>
</ListView>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- xaml
<StackPanel Spacing="4">
<Button Content="First" />
<!-- Non-interactive controls should not be in the tab order -->
<TextBlock Text="(not present)" />
<Button Content="Second" />
<!-- Disabled controls should not be in the tab order -->
<Button Content="(not present)" IsEnabled="False" />
<Button Content="Third" />
</StackPanel>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
--- xaml
<StackPanel
Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"
BorderBrush="{ThemeResource SurfaceStrokeColorDefaultBrush}"
AutomationProperties.Name="Potatoes?"
BorderThickness="1"
Spacing="8"
Padding="8"
CornerRadius="4">
<TextBlock
Style="{ThemeResource BodyStrongTextBlockStyle}"
Text="Potatoes?" />
<!--
XYFocusKeyboardNavigation enables arrow keys between the buttons.

Note that:

- The buttons are still tabbable by default
- Home/End and PgUp/PgDn do not work
- Screen readers do not read PositionInSet/SizeOfSet ("1 of 3")

All of that would require custom work.
-->
<StackPanel
Spacing="4"
Orientation="Horizontal"
XYFocusKeyboardNavigation="Enabled">
<Button Content="Boil 'em" />
<Button Content="Mash 'em" />
<Button Content="Stick 'em in a stew" />
</StackPanel>
</StackPanel>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--- xaml
<Grid RowSpacing="8" ColumnSpacing="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>

<TextBlock Grid.Column="1" HorizontalAlignment="Center" Text="Column 1"/>
<TextBlock Grid.Column="2" HorizontalAlignment="Center" Text="Column 2"/>

<!--
This example is a bit contrived, since you could fix the
tab order by reordering the elements in the XAML, but
sometimes that is not easy to do.
-->
<TextBlock Grid.Row="1" VerticalAlignment="Center" Text="Row 1"/>
<Button Grid.Column="1" Grid.Row="1" Content="First stop" TabIndex="1" HorizontalAlignment="Stretch"/>
<Button Grid.Column="2" Grid.Row="1" Content="Third stop" TabIndex="3" HorizontalAlignment="Stretch"/>

<TextBlock Grid.Row="2" VerticalAlignment="Center" Text="Row 2"/>
<Button Grid.Column="1" Grid.Row="2" Content="Second stop" TabIndex="2" HorizontalAlignment="Stretch"/>
<Button Grid.Column="2" Grid.Row="2" Content="Not a stop" IsTabStop="False" HorizontalAlignment="Stretch"/>
</Grid>
Loading