Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rounded Corners #8544

Open
1 of 4 tasks
Tracked by #8538
singhashish-wpf opened this issue Dec 14, 2023 · 1 comment
Open
1 of 4 tasks
Tracked by #8538

Rounded Corners #8544

singhashish-wpf opened this issue Dec 14, 2023 · 1 comment
Labels
User Story A single user-facing feature. Can be grouped under an epic. Win 11 Theming
Milestone

Comments

@singhashish-wpf
Copy link
Member

singhashish-wpf commented Dec 14, 2023

Description

As on now, most of the controls where CornerRadius is needed, we have set the default value that's defined in Fluent theme styles by using Border.CornerRadius property in style, however this is not customizable and developers cannot set is as follows :

<!-- this does not work -->
<Button Border.CornerRadius="8">...</Button>

The only way that can be used right now is as follows :

<Style x:Key="CustomButtonStyle" BasedOn="{StaticResource DefaultButtonStyle}" TargetType="Button">
    <Setter Property="Border.CornerRadius" Value="8" />
</Style>

<Button Style="{StaticResource CustomButtonStyle}" />

This will make it tougher for developers to customize corner radius. Here are the next steps / work items that need to be done regarding this task.

Primary Tasks

  • Prioritize controls where rounded corners add more visual value
  • Finalize a way to allow customizing CornerRadius for controls other than Border

Secondary Tasks

  • Write performance measurement benchmark for rounded corners.
  • For container controls - Check performance impact.

Notes:

  • CornerRadius Property and Converter already existing for wpf.
  • For button and some other controls this property is not Present in the backing cs file. We might need to add this property to those controls. [API Change]
  • We might not want to have CornerRadius property in all the xaml file with the same values to avoid duplication.
  • We can have a list of variables, which contains the cornerradius values, and we can set CornerRadius property with this value as a DynamicResource.
  • Performance needs to be assessed per control and multiple controls on the same window and for different categories of controls like container controls, nested controls.

Open Questions:

  • Clarify what happens when the Dev overrides the cornerRadius attribute in the app?
@singhashish-wpf singhashish-wpf converted this from a draft issue Dec 14, 2023
@dipeshmsft dipeshmsft added the User Story A single user-facing feature. Can be grouped under an epic. label Mar 21, 2024
@robert-abeo
Copy link

Also see the discussion: #9450

My proposal (if you don't add the CornerRadius property to each control that needs it) is to use an attached property like ModernWPF.

@dipeshmsft dipeshmsft moved this to In Progress in WPF Fluent Theming Feb 3, 2025
@dipeshmsft dipeshmsft added this to the .NET 10 milestone Feb 3, 2025
@dipeshmsft dipeshmsft moved this from In Progress to Todo in WPF Fluent Theming Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
User Story A single user-facing feature. Can be grouped under an epic. Win 11 Theming
Projects
Status: 🥅 Todo
Development

No branches or pull requests

3 participants