Introduce "Composition" > "Basics" page - #2205
Open
0x5bfa wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Composition > Basics entry to WinUI Gallery, introducing a dedicated sample page that demonstrates foundational XAML/Composition interop concepts (Visual retrieval, child visuals, transform matrices, and clipping).
Changes:
- Added a new Composition category and CompositionBasics item to
ControlInfoData.json, including docs links and related control wiring. - Introduced the new
CompositionBasicsPage(XAML + code-behind) with interactive examples for visuals, anchor points, transform matrices, and inset clipping. - Added associated
ControlExamplesample-definition.txtsnippets for the new page.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| WinUIGallery/SampleSupport/Data/ControlInfoData.json | Adds the new Composition category and CompositionBasics item metadata (docs, image, related controls). |
| WinUIGallery/Samples/CompositionBasics/CompositionBasicsPage.xaml | New UI page hosting Composition “Basics” demos using ControlExample. |
| WinUIGallery/Samples/CompositionBasics/CompositionBasicsPage.xaml.cs | Code-behind implementing the Composition interop demos (Visual, child visual, transform matrix, clip). |
| WinUIGallery/Samples/CompositionBasics/CompositionBasicsGetElementVisual.txt | Sample-definition snippet for retrieving/transforming an element Visual. |
| WinUIGallery/Samples/CompositionBasics/CompositionBasicsChildVisual.txt | Sample-definition snippet for attaching a child SpriteVisual and using AnchorPoint/Offset. |
| WinUIGallery/Samples/CompositionBasics/CompositionBasicsTransformMatrix.txt | Sample-definition snippet for composing multiple transforms via TransformMatrix. |
| WinUIGallery/Samples/CompositionBasics/CompositionBasicsClip.txt | Sample-definition snippet for clipping an element via InsetClip. |
| Compositor compositor = ElementCompositionPreview.GetElementVisual(ChildVisualHost).Compositor; | ||
| _childVisual = compositor.CreateSpriteVisual(); | ||
| _childVisual.Size = new Vector2(80); | ||
| _childVisual.Brush = compositor.CreateColorBrush(Windows.UI.Color.FromArgb(255, 0, 120, 212)); |
marcelwgn
reviewed
Jul 27, 2026
| "IconGlyph": "\uE81E", | ||
| "Items": [ | ||
| { | ||
| "UniqueId": "CompositionBasics", |
Contributor
There was a problem hiding this comment.
Do you expect an "CompositionAdvanced" page or why is this called basics?
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Motivation and Context
@marcelwgn
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes