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

CheckBox CornerRadius not working #4050

Closed
PJonHar opened this issue Feb 23, 2021 · 4 comments · Fixed by #4056
Closed

CheckBox CornerRadius not working #4050

PJonHar opened this issue Feb 23, 2021 · 4 comments · Fixed by #4056
Assignees
Labels
Milestone

Comments

@PJonHar
Copy link

PJonHar commented Feb 23, 2021

I have tried to add a CornerRadius to the CheckBox control but it does not work?
Am I doing something wrong?

MahApps.Metro version: v2.4.3
Windows build number: Win10 1903 [Version 18362.1256]
Visual Studio: 2019 18.6.0
Target Framework: .Net 4.8

Screenshots

image

@PJonHar PJonHar added the Bug label Feb 23, 2021
@timunie
Copy link
Collaborator

timunie commented Feb 24, 2021

Hi @PJonHar

seems like it is currently not supported. I will add it if @punker76 gives me a 👍 .

@punker76 I can think of three possible solutions. Please mark the one you like most and I'll make a PR for it:

  • Change the Recangle to Border and use the ControlsHelper.CornerRadius-Property which is already available
  • Keep the Rectangle and add CheckBoxHelper.CheckMarkRadius-Property. This will then control both RadiusX and RadiusY of the Rectangle
  • Keep the Rectangle and add two CheckBoxHelper.CheckMarkRadius-Properties (one for X and one for Y. The user can control the appearance in more detail but needs to set two properties everytime.

My favorite is option 2 I think

Happy coding
Tim

@PJonHar
Copy link
Author

PJonHar commented Feb 24, 2021

Hi Tim,

I think that changing the Rectangle to a Border will be the cleanest solution ? As you say, the ControlsHelper.CornerRadius-Property is already available.

Cheers.

@timunie
Copy link
Collaborator

timunie commented Feb 24, 2021

mhh not necessarily. If you look into the Style you will notice that it is already used by another Border:

<Border x:Name="RootBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding mah:ControlsHelper.CornerRadius}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />

image

another point is that you control all CheckMark-related things in the CheckBoxHelper. So you why not the CornerRadius?

@PJonHar
Copy link
Author

PJonHar commented Feb 24, 2021

I used snoop and found this if it helps?
image

@punker76 punker76 self-assigned this Feb 28, 2021
@punker76 punker76 added this to the 2.4.4 milestone Feb 28, 2021
punker76 added a commit that referenced this issue Feb 28, 2021
Filters a CornerRadius by the given Filter property. Result can be a new CornerRadius or a value of it's 4 corners.
punker76 added a commit that referenced this issue Feb 28, 2021
The CheckCornerRadius property allows users to control the roundness of the CheckBox corners independently by setting a radius value for each corner.
punker76 added a commit that referenced this issue Feb 28, 2021
Fix CheckBox CornerRadius not working
batzen pushed a commit to batzen/MahApps.Metro that referenced this issue Mar 3, 2021
Filters a CornerRadius by the given Filter property. Result can be a new CornerRadius or a value of it's 4 corners.
batzen pushed a commit to batzen/MahApps.Metro that referenced this issue Mar 3, 2021
The CheckCornerRadius property allows users to control the roundness of the CheckBox corners independently by setting a radius value for each corner.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

3 participants