Skip to content

Add InkCanvas and InkToolBar control pages - #2168

Closed
Nitin Chaudhary (Nitin-100) wants to merge 35 commits into
microsoft:mainfrom
Nitin-100:user/nitchaudhary/inking-gallery-pages
Closed

Nitin Chaudhary (Nitin-100) wants to merge 35 commits into
microsoft:mainfrom
Nitin-100:user/nitchaudhary/inking-gallery-pages

Conversation

@Nitin-100

Copy link
Copy Markdown
Contributor

Summary

Adds Gallery demo pages for the new InkCanvas and InkToolBar lifted controls being introduced in WinAppSDK 2.0 / WinUI 3. These pages let users explore inking end-to-end inside WinUI Gallery alongside the existing controls.

Pairs with the corresponding microsoft-ui-xaml-lift PR that ships the controls themselves: PR #15101676 (user/nitinc/inking-support → main).

What's added

File Purpose
WinUIGallery/ControlPages/InkCanvasPage.xaml (+378) InkCanvas demo UI — pen / pencil / highlighter strokes, sample InkPresenter wiring
WinUIGallery/ControlPages/InkCanvasPage.xaml.cs (+774) Code-behind covering basic inking, custom drying, save/load, eraser, custom pen samples
WinUIGallery/ControlPages/InkToolBarPage.xaml (+76) InkToolBar demo UI — built-in buttons, stencils, custom buttons
WinUIGallery/ControlPages/InkToolBarPage.xaml.cs (+35) InkToolBar interactions and event wiring
WinUIGallery/DataModel/ControlInfoData.json (+19) Registers the new "Inking" section in left-nav
WinUIGallery/WinUIGallery.csproj (+2) Includes the new pages
Directory.Build.props, nuget.config (+3) Minor build/package config tweaks needed for the inking sample

Total: 8 files, +1,287 lines, all additive — no existing Gallery files modified destructively.

Validation

Built and ran locally on Windows 11 (amd64chk WinUI Gallery layout) against the matching lifted-controls DLL from PR #15101676. End-to-end checks pass:

  • Pen / pencil / highlighter draw strokes on the canvas
  • InkToolBar pen / eraser / color / size controls work as expected
  • Custom drying pipeline runs (BeginDry / EndDry cycles fire)
  • Independent input thread receives PointerPressing / Moving / Releasing
  • No threading errors (RPC_E_WRONG_THREAD) under switcher-engaged composition

Notes for reviewers

  • Pages will only have functional inking when the matching WinAppSDK build with the new InkCanvas / InkToolBar controls is in use; against current shipping WinAppSDK they'll fail to instantiate the controls (expected until the lift PR ships).
  • No changes to existing pages; navigation still works for everything else with the new pages absent or present.
  • Happy to split this into per-control PRs (one for InkCanvas, one for InkToolBar) if reviewers prefer smaller chunks.
@Nitin-100

Copy link
Copy Markdown
Contributor Author

Pairs with microsoft-ui-xaml-lift PR #15101676 which adds the InkCanvas and InkToolBar lifted controls these pages exercise.

@Nitin-100

Copy link
Copy Markdown
Contributor Author

Holding this PR pending rebase onto upstream main after the WASDK 2.0 layout migration. Will resubmit on the new .slnx layout post-May-26 CC. Demo pages validated locally May 14 against the WinUI3 InkCanvas/InkToolBar implementation.

Nitin Chaudhary added 2 commits July 7, 2026 16:26
Add demo pages for the new desktop InkCanvas control and InkToolBar, including pen/pencil/highlighter/eraser, save/load, StrokesCollected harvesting, and independent low-latency input. Register the pages in the control catalog. Fix duplicate Page item generation when building against the mock WinAppSDK package.
@niels9001
Niels Laute (niels9001) marked this pull request as draft August 2, 2026 15:38
@dotMorten Morten Nielsen (dotMorten) mentioned this pull request Sep 24, 2026
1 of 3 tasks
@dotMorten

Copy link
Copy Markdown
Collaborator

Closing in favor of #2245

Niels Laute (niels9001) added a commit that referenced this pull request Sep 28, 2026
## Description
Replacement PR for #2168
upgraded to latest.
See original PR for context.

## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):
<img width="317" height="158" alt="image"
src="https://github.com/user-attachments/assets/95826ec7-3fe7-4c5b-9ff6-f5ae8dd0177e"
/>

<img width="1288" height="1121" alt="image"
src="https://github.com/user-attachments/assets/12288451-a7fa-4fcc-88ca-117eabe244b4"
/>

<img width="959" height="1051" alt="image"
src="https://github.com/user-attachments/assets/09a54be9-e2c9-4ce4-908c-010095294c50"
/>

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)

---------

Co-authored-by: Niels Laute <niels.laute@live.nl>
Co-authored-by: niels9001 <niels9001@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

6 participants