dotnet / dotnet/maui

[Enhancement] IBorderElement.CornerRadius should be CornerRadius type

Open
#3,080 1 comment 7 reactions 0 assignees View on GitHub
area-controls-general proposal/open t/enhancement ☀️
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

## Summary
Some elements supports `IBorderElement` implementation (`Button`, `CheckBox`, `Frame`, `ImageButton`, `RadioButton`).

This is useful to set the `CornerRadius` directly on the `Element` or by `Style`, without the `Border` control.
But currently, the `CornerRadius` is a `int` property, this limits these possibilities and is not consistent with other properties that provide the same purpose.

In my opinion, all `CornerRadius` properties should be of type `CornerRadius`, not `int`. (eg: [WinUI 3 Control.CornerRadius](https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.control.cornerradius?view=winui-3.0))

## API Changes
```cs
public interface IBorderElement
{
...
CornerRadius CornerRadius { get; }
...
}
```

## Intended Use Case
Define rounded corners in the same way in all controls that support it.

Contributor guide

Open the contributing guide

Research direction

Start at the IBorderElement interface and search its implementations on Button, CheckBox, Frame, ImageButton, and RadioButton. Trace the existing CornerRadius properties and their usages, then verify that all affected controls expose the CornerRadius type consistently and that the relevant test suite passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.