Skip to content

InkToolbar: honour CornerRadius and Padding in the control template - #11872

Open
Nitin Chaudhary (Nitin-100) wants to merge 1 commit into
microsoft:mainfrom
Nitin-100:user/nitinc/inktoolbar-cornerradius
Open

Nitin Chaudhary (Nitin-100) wants to merge 1 commit into
microsoft:mainfrom
Nitin-100:user/nitinc/inktoolbar-cornerradius

Conversation

@Nitin-100

Copy link
Copy Markdown
Contributor

Problem

CornerRadius has no effect on InkToolbar. Reported against the experimental release.

The template root binds Background, BorderBrush and BorderThickness, but not CornerRadius — so the property is silently ignored. Padding has the same latent gap and is fixed here too.

https://github.com/microsoft/microsoft-ui-xaml/blob/main/controls/dev/InkToolbar/InkToolbar.xaml#L1549

Fix

Bind both through on the template root. StackPanel supports CornerRadius and Padding (see microsoft.ui.xaml.controls.controls.idl), so no structural change is needed.

-<StackPanel x:Name="Panel" Orientation="Horizontal" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Margin="2,2,2,2" />
+<StackPanel x:Name="Panel" Orientation="Horizontal" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" Padding="{TemplateBinding Padding}" Margin="2,2,2,2" />

Note for reviewers: this deviates from UWP

Worth calling out explicitly, since the inking work has been held to strict UWP parity.

The UWP InkToolbar template omits these same two bindings — verified identical in Windows SDK 10.0.19041.0 and 10.0.26100.0:

<ControlTemplate TargetType="InkToolbar">
  <StackPanel x:Name="Panel" Orientation="Horizontal"
              Background="{TemplateBinding Background}"
              BorderBrush="{TemplateBinding BorderBrush}"
              BorderThickness="{TemplateBinding BorderThickness}" />
</ControlTemplate>

So this is not a port regression — it is a long-standing UWP gap we inherited faithfully. Control.CornerRadius postdates InkToolbar (RS5 vs 1607), which is likely why it was never wired up. WinUI 3's rounded design language makes callers reasonably expect it to work, so fixing it here is an intentional improvement rather than an oversight.

The change is purely additive: templates that never set CornerRadius/Padding are unaffected, since both default to zero.

Validation

With the template applied to an InkToolbar with CornerRadius="12":

  • InkToolbar.CornerRadius12 and the template root now receives 12 (previously 0)
  • The border renders rounded; before the change the same markup rendered square
  • No functional regression: tool selection, flyouts, orientation switching and ink capture all behave as before

Verified on an unpackaged WinUI 3 desktop app against a local product build.

The InkToolbar template root binds Background, BorderBrush and BorderThickness
but not CornerRadius or Padding, so setting either on an InkToolbar had no
effect. StackPanel supports both, so bind them through.

Note this is a deliberate deviation from strict UWP parity rather than a port
regression: the UWP template omits the same two bindings (verified in SDK
19041 and 26100). Control.CornerRadius postdates InkToolbar, and WinUI 3's
rounded design language makes callers reasonably expect it to work.

Verified with the template applied: InkToolbar.CornerRadius="12" now reaches
the template root (previously 0) and the border renders rounded.
@microsoft-github-policy-service microsoft-github-policy-service Bot added the needs-triage Issue needs to be triaged by the area owners label Sep 13, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Accessibility

@harshit7962 Harshit (harshit7962) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Nitin-100

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-triage Issue needs to be triaged by the area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants